From e5a2a576fdb6d0cfd9ca5b33cffaf531394a1a68 Mon Sep 17 00:00:00 2001 From: Bishop Date: Sat, 1 Aug 2026 12:23:41 -0500 Subject: [PATCH] More consts --- .../construction/ConstructionInterface.kt | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Server/src/main/content/global/skill/construction/ConstructionInterface.kt b/Server/src/main/content/global/skill/construction/ConstructionInterface.kt index 2451bf06b..21d4d0e07 100644 --- a/Server/src/main/content/global/skill/construction/ConstructionInterface.kt +++ b/Server/src/main/content/global/skill/construction/ConstructionInterface.kt @@ -18,8 +18,13 @@ import org.rs09.consts.Components class ConstructionInterface : InterfaceListener { companion object { - const val ATTRIBUTE_HOTSPOT = "con:hotspot" - const val ATTRIBUTE_HOTSPOT_OBJ = "con:hsobject" + const val ATTRIBUTE_HOTSPOT = "con:hotspot" + const val ATTRIBUTE_HOTSPOT_OBJ = "con:hsobject" + private const val DECO_BUTTON_BUILD = 132 + private const val HOUSE_BUTTON_BUILDMODE_ON = 14 + private const val HOUSE_BUTTON_BUILDMODE_OFF = 1 + private const val HOUSE_BUTTON_EXPEL_GUESTS = 15 + private const val HOUSE_BUTTON_LEAVE_HOUSE = 13 // Register furniture here when it is only obtainable by upgrading, to send the correct rejection message. val upgradeOnly = arrayOf( @@ -34,7 +39,7 @@ class ConstructionInterface : InterfaceListener { */ on(Components.POH_DECORATION_396) { player, _, _, buttonID, slot, _ -> when (buttonID) { - 132 -> { + DECO_BUTTON_BUILD -> { val hotspot = getAttribute(player, ATTRIBUTE_HOTSPOT, null) val hotspotObj = getAttribute(player, ATTRIBUTE_HOTSPOT_OBJ, null) val flatpackMode = getAttribute(player, WorkbenchListeners.ATTRIBUTE_FLATPACK_MODE, false) @@ -117,19 +122,19 @@ class ConstructionInterface : InterfaceListener { */ on(Components.POH_HOUSE_OPTIONS_398) { player, _, _, buttonID, _, _ -> when (buttonID) { - 14 -> { + HOUSE_BUTTON_BUILDMODE_ON -> { player.houseManager.toggleBuildingMode(player, true) return@on true } - 1 -> { + HOUSE_BUTTON_BUILDMODE_OFF -> { player.houseManager.toggleBuildingMode(player, false) return@on true } - 15 -> { + HOUSE_BUTTON_EXPEL_GUESTS -> { player.houseManager.expelGuests(player) return@on true } - 13 -> { + HOUSE_BUTTON_LEAVE_HOUSE -> { if (!player.houseManager.isInHouse(player)) { sendMessage(player, "You can't do this outside of your house.") return@on true