Item sets now appear and can be unpacked at the GE

Added a proper mock session that gets used for mock players in unit tests. Allows verifying that certain packets made it to the IoSession (the stage right before sending it to the client)
This commit is contained in:
Ceikry
2022-05-14 10:24:47 +00:00
committed by Ryan
parent 6f092d17d8
commit 90060fde21
2 changed files with 58 additions and 12 deletions
@@ -15,12 +15,6 @@ import rs09.game.interaction.InterfaceListener
class ExchangeItemSets : InterfaceListener {
override fun defineInterfaceListeners() {
onOpen(Components.EXCHANGE_ITEMSETS_645) { player, _ ->
val listener: InventoryListener
setAttribute(player, "ge-listener", InventoryListener(player).also { listener = it })
player.inventory.listeners.add(listener)
}
onClose(Components.EXCHANGE_ITEMSETS_645){player, _ ->
val listener = getAttribute<InventoryListener?>(player, "ge-listener", null)
player.inventory.listeners.remove(listener)
@@ -37,6 +31,9 @@ class ExchangeItemSets : InterfaceListener {
{
openInterface(player, Components.EXCHANGE_ITEMSETS_645)
player.interfaceManager.openSingleTab(Component(Components.EXCHANGE_SETS_SIDE_644))
val listener: InventoryListener
setAttribute(player, "ge-listener", InventoryListener(player).also { listener = it })
player.inventory.listeners.add(listener)
}
}
@@ -62,9 +59,9 @@ class ExchangeItemSets : InterfaceListener {
player.inventory.toArray(),
arrayOf("Examine", "Exchange", "Components"),
Components.EXCHANGE_SETS_SIDE_644,
16,
15,
10
0,
7,
4
)
)