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 package content.region.asgarnia.burthorpe.quest.deathplateau
import content.data.Quests import content.data.Quests
import content.global.handlers.iface.ScrollInterface
import core.api.* import core.api.*
import core.game.global.action.DoorActionHandler import core.game.global.action.DoorActionHandler
import core.game.interaction.IntType import core.game.interaction.IntType
import core.game.interaction.InteractionListener import core.game.interaction.InteractionListener
import core.game.node.item.GroundItemManager import core.game.node.item.GroundItemManager
import org.rs09.consts.Components
import org.rs09.consts.Items import org.rs09.consts.Items
import org.rs09.consts.Scenery import org.rs09.consts.Scenery
@@ -23,6 +25,11 @@ class DeathPlateauInteractionListener : InteractionListener {
Scenery.STONE_MECHANISM_3676, // 4 Outer stone plates Scenery.STONE_MECHANISM_3676, // 4 Outer stone plates
Scenery.STONE_MECHANISM_3677 // 2 Inner 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() { override fun defineListeners() {
on(Scenery.DOOR_3747, SCENERY, "open") { player, node -> on(Scenery.DOOR_3747, SCENERY, "open") { player, node ->
@@ -48,10 +55,10 @@ class DeathPlateauInteractionListener : InteractionListener {
} }
on(Items.COMBINATION_3102, ITEM, "read") { player, _ -> on(Items.COMBINATION_3102, ITEM, "read") { player, _ ->
openInterface(player, 220) // https://youtu.be/C8n8Yi-J8wU?t=466
setInterfaceText(player, "<col=3D1E00>Red is North of Blue. Yellow is South of Purple.", 220, 7) openInterface(player, 222)
setInterfaceText(player, "<col=3D1E00>Green is North of Purple. Blue is West of", 220, 8) setInterfaceText(player, combinationScroll.joinToString("<br>"), 222, 5)
setInterfaceText(player, "<col=3D1E00>Yellow. Purple is East of Red.", 220, 9)
return@on true return@on true
} }
@@ -4,6 +4,9 @@ import content.data.Quests
import core.api.* import core.api.*
import core.game.dialogue.DialogueFile import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression 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 core.tools.END_DIALOGUE
import org.rs09.consts.Items import org.rs09.consts.Items
@@ -26,10 +29,7 @@ class IOUNoteDialogueFile : DialogueFile() {
4 -> { 4 -> {
end() end()
stage = END_DIALOGUE stage = END_DIALOGUE
openInterface(player!!, 220) InteractionListeners.run(Items.COMBINATION_3102, IntType.ITEM, "read", player!!, Item(Items.COMBINATION_3102))
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)
} }
} }
} }
@@ -14,6 +14,7 @@ import core.game.world.update.flag.context.Animation
import core.game.world.update.flag.context.Graphics import core.game.world.update.flag.context.Graphics
import core.plugin.Initializable import core.plugin.Initializable
import core.tools.RandomFunction import core.tools.RandomFunction
import core.tools.colorize
import org.rs09.consts.Items import org.rs09.consts.Items
import org.rs09.consts.NPCs import org.rs09.consts.NPCs
import org.rs09.consts.Scenery import org.rs09.consts.Scenery
@@ -119,9 +120,8 @@ class MudSkipperPointListeners : InteractionListener {
} }
on(Scenery.SIGNPOST_10090, IntType.SCENERY, "read") { player, _ -> on(Scenery.SIGNPOST_10090, IntType.SCENERY, "read") { player, _ ->
setInterfaceText(player, "Mudskipper Point.", 220, 2) // https://runescape.wiki/w/Mudskipper_Point?oldid=969991
setInterfaceText(player, "WARNING! BEWARE OF THE MUDSKIPPERS!", 220, 4) sendDialogue(player, colorize("%RBEWARE OF THE MUDSKIPPERS!"))
openInterface(player, 220)
return@on true return@on true
} }
@@ -9,6 +9,7 @@ import org.rs09.consts.NPCs
import core.game.dialogue.DialogueBuilder import core.game.dialogue.DialogueBuilder
import core.game.dialogue.DialogueBuilderFile import core.game.dialogue.DialogueBuilderFile
import content.data.Quests import content.data.Quests
import content.global.handlers.iface.ScrollLine
@Initializable @Initializable
public final class ClayGolemDialoguePlugin(player: Player? = null) : DialoguePlugin(player) { 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( val LETTER_LINES = arrayOf(
"", ScrollLine("Dearest Varmen,", 3),
"", ScrollLine("I hope this finds you well. Here are the books you asked for", 4),
"Dearest Varmen,", ScrollLine("There has been an exciting development closer to home --", 5),
"I hope this finds you well. Here are the books you asked for", ScrollLine("another city from the same period has been discovered east", 6),
"There has been an exciting development closer to home --", ScrollLine("of Varrock, and we are starting a huge excavation project", 7),
"another city from the same period has been discovered east", ScrollLine("here. I don't know if the museum will be able to finance your", 8),
"of Varrock, and we are starting a huge excavation project", ScrollLine("expedition as well as this one, so I fear your current trip will be", 9),
"here. I don't know if the museum will be able to finance your", ScrollLine("the last.", 10),
"expedition as well as this one, so I fear your current trip will be", ScrollLine("May Saradomin grant you a safe journey home", 11),
"the last.", ScrollLine("Your loving Elissa.", 12)
"May Saradomin grant you a safe journey home",
"Your loving Elissa.",
) )
val DISPLAY_CASE_TEXT = arrayOf("3rd age - yr 3000-4000", 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.interaction.InterfaceListener
import core.game.world.GameWorld import core.game.world.GameWorld
import content.data.Quests import content.data.Quests
import content.global.handlers.iface.ScrollInterface
import org.rs09.consts.Components
@Initializable @Initializable
class TheGolemQuest : Quest(Quests.THE_GOLEM, 70, 69, 1, 437, 0, 1, 10) { 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 { class DisplayCaseListener : InterfaceListener {
override fun defineInterfaceListeners() { override fun defineInterfaceListeners() {
onOpen(534) { player, component -> 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(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(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 -> on(4615, IntType.ITEM, "read") { player, node ->
player.setAttribute("ifaces:220:lines", LETTER_LINES)
player.setAttribute("/save:the-golem:read-elissa-letter", true) player.setAttribute("/save:the-golem:read-elissa-letter", true)
openInterface(player, 220) ScrollInterface.scrollSetup(player, Components.MESSAGESCROLL_220, LETTER_LINES)
return@on true return@on true
} }
on(35226, IntType.SCENERY, "search") { player, node -> 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) { private fun scruffyNote(player: Player) {
val scruffynotes = val scruffynotes =
arrayOf( arrayOf(
"Got a bncket of nnilk", "Got a bncket of nnilk",
"Tlen grind sorne lhoculate", "Tlen qrind sorne lhoculate",
"vnith a pestal and rnortar", "vnith a pestal and rnortar",
"ald the grourd dlocolate to tho milt", "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() { override fun defineDestinationOverrides() {
@@ -15,6 +15,9 @@ import org.rs09.consts.Items
import org.rs09.consts.NPCs import org.rs09.consts.NPCs
import org.rs09.consts.Sounds import org.rs09.consts.Sounds
import content.data.Quests import content.data.Quests
import content.global.handlers.iface.ScrollInterface
import content.global.handlers.iface.ScrollLine
import org.rs09.consts.Components
class GrandTreeListeners: InteractionListener { class GrandTreeListeners: InteractionListener {
@@ -26,12 +29,11 @@ class GrandTreeListeners: InteractionListener {
Location(2473,9897,0), Location(2473,9897,0),
) )
val hazelmerescroll = Items.HAZELMERES_SCROLL_786 // https://youtu.be/-jfueZpRhzU?t=184
val hazelmereScrollText = arrayOf(
val hazelmerescrollText = arrayOf( ScrollLine("Es lemanto meso pro eis prit ta Cinqo mond.", 6),
"<col=FFF900>Es lemanto meso pro eis prit ta Cinqo mond.</col>", ScrollLine("Mi lovos ta lemanto Daconia arpos", 7),
"<col=FFF900>Mi lovos ta lemanto Daconia arpos</col>", ScrollLine("et Daconia arpos eto meriz ta priw!", 8)
"<col=FFF900>et Daconia arpos eto meriz ta priw!</col>",
) )
fun unlockTUZODoor(player: Player) { fun unlockTUZODoor(player: Player) {
@@ -84,8 +86,8 @@ class GrandTreeListeners: InteractionListener {
openDialogue(player, AnitaDialogue(), npc) openDialogue(player, AnitaDialogue(), npc)
return@on true return@on true
} }
on(hazelmerescroll, IntType.ITEM, "read") { player, node -> on(Items.HAZELMERES_SCROLL_786, IntType.ITEM, "read") { player, node ->
hazelmereScroll(player, node.asItem()) ScrollInterface.scrollSetup(player, Components.MESSAGESCROLL_220, hazelmereScrollText)
return@on true return@on true
} }
@@ -209,14 +211,5 @@ class GrandTreeListeners: InteractionListener {
return@on true 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)
}
}
}
} }