Fixed some text display bugs on some interfaces

This commit is contained in:
Sam Marder
2026-06-21 12:57:31 +00:00
committed by Ryan
parent fd8f672728
commit 5670ac5e9d
7 changed files with 47 additions and 58 deletions
@@ -1,11 +1,13 @@
package content.region.asgarnia.burthorpe.quest.deathplateau
import content.data.Quests
import content.global.handlers.iface.ScrollInterface
import core.api.*
import core.game.global.action.DoorActionHandler
import core.game.interaction.IntType
import core.game.interaction.InteractionListener
import core.game.node.item.GroundItemManager
import org.rs09.consts.Components
import org.rs09.consts.Items
import org.rs09.consts.Scenery
@@ -23,6 +25,11 @@ class DeathPlateauInteractionListener : InteractionListener {
Scenery.STONE_MECHANISM_3676, // 4 Outer stone plates
Scenery.STONE_MECHANISM_3677 // 2 Inner stone plates
)
val combinationScroll = arrayOf(
"Red is North of Blue. Yellow is South of Purple.",
"Green is North of Purple. Blue is West of",
"Yellow. Purple is East of Red."
)
}
override fun defineListeners() {
on(Scenery.DOOR_3747, SCENERY, "open") { player, node ->
@@ -48,10 +55,10 @@ class DeathPlateauInteractionListener : InteractionListener {
}
on(Items.COMBINATION_3102, ITEM, "read") { player, _ ->
openInterface(player, 220)
setInterfaceText(player, "<col=3D1E00>Red is North of Blue. Yellow is South of Purple.", 220, 7)
setInterfaceText(player, "<col=3D1E00>Green is North of Purple. Blue is West of", 220, 8)
setInterfaceText(player, "<col=3D1E00>Yellow. Purple is East of Red.", 220, 9)
// https://youtu.be/C8n8Yi-J8wU?t=466
openInterface(player, 222)
setInterfaceText(player, combinationScroll.joinToString("<br>"), 222, 5)
return@on true
}
@@ -4,6 +4,9 @@ import content.data.Quests
import core.api.*
import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression
import core.game.interaction.IntType
import core.game.interaction.InteractionListeners
import core.game.node.item.Item
import core.tools.END_DIALOGUE
import org.rs09.consts.Items
@@ -26,10 +29,7 @@ class IOUNoteDialogueFile : DialogueFile() {
4 -> {
end()
stage = END_DIALOGUE
openInterface(player!!, 220)
setInterfaceText(player!!, "<col=3D1E00>Red is North of Blue. Yellow is South of Purple.", 220, 7)
setInterfaceText(player!!, "<col=3D1E00>Green is North of Purple. Blue is West of", 220, 8)
setInterfaceText(player!!, "<col=3D1E00>Yellow. Purple is East of Red.", 220, 9)
InteractionListeners.run(Items.COMBINATION_3102, IntType.ITEM, "read", player!!, Item(Items.COMBINATION_3102))
}
}
}
@@ -14,6 +14,7 @@ import core.game.world.update.flag.context.Animation
import core.game.world.update.flag.context.Graphics
import core.plugin.Initializable
import core.tools.RandomFunction
import core.tools.colorize
import org.rs09.consts.Items
import org.rs09.consts.NPCs
import org.rs09.consts.Scenery
@@ -119,9 +120,8 @@ class MudSkipperPointListeners : InteractionListener {
}
on(Scenery.SIGNPOST_10090, IntType.SCENERY, "read") { player, _ ->
setInterfaceText(player, "Mudskipper Point.", 220, 2)
setInterfaceText(player, "WARNING! BEWARE OF THE MUDSKIPPERS!", 220, 4)
openInterface(player, 220)
// https://runescape.wiki/w/Mudskipper_Point?oldid=969991
sendDialogue(player, colorize("%RBEWARE OF THE MUDSKIPPERS!"))
return@on true
}
@@ -9,6 +9,7 @@ import org.rs09.consts.NPCs
import core.game.dialogue.DialogueBuilder
import core.game.dialogue.DialogueBuilderFile
import content.data.Quests
import content.global.handlers.iface.ScrollLine
@Initializable
public final class ClayGolemDialoguePlugin(player: Player? = null) : DialoguePlugin(player) {
@@ -107,19 +108,18 @@ class CuratorHaigHalenGolemDialogue : DialogueBuilderFile() {
}
}
// https://youtu.be/owPSLUB9E8k?t=261
val LETTER_LINES = arrayOf(
"",
"",
"Dearest Varmen,",
"I hope this finds you well. Here are the books you asked for",
"There has been an exciting development closer to home --",
"another city from the same period has been discovered east",
"of Varrock, and we are starting a huge excavation project",
"here. I don't know if the museum will be able to finance your",
"expedition as well as this one, so I fear your current trip will be",
"the last.",
"May Saradomin grant you a safe journey home",
"Your loving Elissa.",
ScrollLine("Dearest Varmen,", 3),
ScrollLine("I hope this finds you well. Here are the books you asked for", 4),
ScrollLine("There has been an exciting development closer to home --", 5),
ScrollLine("another city from the same period has been discovered east", 6),
ScrollLine("of Varrock, and we are starting a huge excavation project", 7),
ScrollLine("here. I don't know if the museum will be able to finance your", 8),
ScrollLine("expedition as well as this one, so I fear your current trip will be", 9),
ScrollLine("the last.", 10),
ScrollLine("May Saradomin grant you a safe journey home", 11),
ScrollLine("Your loving Elissa.", 12)
)
val DISPLAY_CASE_TEXT = arrayOf("3rd age - yr 3000-4000",
@@ -20,6 +20,8 @@ import core.game.interaction.InteractionListener
import core.game.interaction.InterfaceListener
import core.game.world.GameWorld
import content.data.Quests
import content.global.handlers.iface.ScrollInterface
import org.rs09.consts.Components
@Initializable
class TheGolemQuest : Quest(Quests.THE_GOLEM, 70, 69, 1, 437, 0, 1, 10) {
@@ -112,19 +114,6 @@ class ClayGolemNPC : AbstractNPC {
}
}
class LetterListener : InterfaceListener {
override fun defineInterfaceListeners() {
onOpen(220) { player, component ->
val lines: Array<String> = player.getAttribute("ifaces:220:lines", arrayOf())
for(i in 0 until Math.min(lines.size, 15)) {
setInterfaceText(player, lines[i], 220, i+1)
//setInterfaceText(player, "${i}", 220, i+1)
}
return@onOpen true
}
}
}
class DisplayCaseListener : InterfaceListener {
override fun defineInterfaceListeners() {
onOpen(534) { player, component ->
@@ -372,9 +361,8 @@ class TheGolemListeners : InteractionListener {
on(34978, IntType.SCENERY, "climb-down") { player, node -> core.game.global.action.ClimbActionHandler.climb(player, core.game.global.action.ClimbActionHandler.CLIMB_DOWN, core.game.global.action.SpecialLadders.getDestination(node.location)); return@on true }
on(6372, IntType.SCENERY, "climb-up") { player, node -> core.game.global.action.ClimbActionHandler.climb(player, core.game.global.action.ClimbActionHandler.CLIMB_UP, core.game.global.action.SpecialLadders.getDestination(node.location)); return@on true }
on(4615, IntType.ITEM, "read") { player, node ->
player.setAttribute("ifaces:220:lines", LETTER_LINES)
player.setAttribute("/save:the-golem:read-elissa-letter", true)
openInterface(player, 220)
ScrollInterface.scrollSetup(player, Components.MESSAGESCROLL_220, LETTER_LINES)
return@on true
}
on(35226, IntType.SCENERY, "search") { player, node ->
@@ -406,16 +406,17 @@ class PlagueCityListeners : InteractionListener {
}
}
// https://youtu.be/AG81LH51WME?t=302
private fun scruffyNote(player: Player) {
val scruffynotes =
arrayOf(
"Got a bncket of nnilk",
"Tlen grind sorne lhoculate",
"Tlen qrind sorne lhoculate",
"vnith a pestal and rnortar",
"ald the grourd dlocolate to tho milt",
"finales add 5cme snape gras5",
"fnales add 5cme snape gras5",
)
setInterfaceText(player, scruffynotes.joinToString("<br>"), 222, 5)
setInterfaceText(player, scruffynotes.joinToString("<br>"), 222, 4)
}
override fun defineDestinationOverrides() {
@@ -15,6 +15,9 @@ import org.rs09.consts.Items
import org.rs09.consts.NPCs
import org.rs09.consts.Sounds
import content.data.Quests
import content.global.handlers.iface.ScrollInterface
import content.global.handlers.iface.ScrollLine
import org.rs09.consts.Components
class GrandTreeListeners: InteractionListener {
@@ -26,12 +29,11 @@ class GrandTreeListeners: InteractionListener {
Location(2473,9897,0),
)
val hazelmerescroll = Items.HAZELMERES_SCROLL_786
val hazelmerescrollText = arrayOf(
"<col=FFF900>Es lemanto meso pro eis prit ta Cinqo mond.</col>",
"<col=FFF900>Mi lovos ta lemanto Daconia arpos</col>",
"<col=FFF900>et Daconia arpos eto meriz ta priw!</col>",
// https://youtu.be/-jfueZpRhzU?t=184
val hazelmereScrollText = arrayOf(
ScrollLine("Es lemanto meso pro eis prit ta Cinqo mond.", 6),
ScrollLine("Mi lovos ta lemanto Daconia arpos", 7),
ScrollLine("et Daconia arpos eto meriz ta priw!", 8)
)
fun unlockTUZODoor(player: Player) {
@@ -84,8 +86,8 @@ class GrandTreeListeners: InteractionListener {
openDialogue(player, AnitaDialogue(), npc)
return@on true
}
on(hazelmerescroll, IntType.ITEM, "read") { player, node ->
hazelmereScroll(player, node.asItem())
on(Items.HAZELMERES_SCROLL_786, IntType.ITEM, "read") { player, node ->
ScrollInterface.scrollSetup(player, Components.MESSAGESCROLL_220, hazelmereScrollText)
return@on true
}
@@ -209,14 +211,5 @@ class GrandTreeListeners: InteractionListener {
return@on true
}
}
private fun hazelmereScroll(player: Player, item: Item) {
val id = item.id
openInterface(player, 222).also {
when (id) {
hazelmerescroll -> setInterfaceText(player, hazelmerescrollText.joinToString("<br>"), 222, 6)
}
}
}
}