mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2026-08-01 14:39:13 -06:00
More consts
This commit is contained in:
parent
b54c8c7bb6
commit
e5a2a576fd
1 changed files with 12 additions and 7 deletions
|
|
@ -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<Hotspot?>(player, ATTRIBUTE_HOTSPOT, null)
|
||||
val hotspotObj = getAttribute<Scenery?>(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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue