Wheelmenu + Phoenix

* Added wheel menu constructor
* Added new features to the phoenix
* Added desk and phoenix objects to the wheelmenu
This commit is contained in:
LoafyLemon 2024-04-15 19:06:18 +01:00
parent e295fbb791
commit 588f1df01b
4 changed files with 256 additions and 19 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2,8 +2,9 @@
init -1 python:
class Room(object):
def __init__(self, id):
def __init__(self, id, menu=None):
self.id = id
self.menu = menu
self.objects = set()
def add(self, obj):
@ -95,9 +96,18 @@ init -1 python:
deco = self.decoration
if deco and deco.replace_action:
return deco.replace_action
action = deco.replace_action
else:
action = self.action
return self.action
if isinstance(action, dict):
if not action:
raise IndexError(f"Action dict was provided for '{self.id}' but it is empty.")
btns = create_wheelmenu(action)
return Call("wheelmenu", btns=btns, ret=self.room.menu)
return action
def get_anchor(self):
deco = self.decoration

View File

@ -1,12 +1,46 @@
default main_room = Room("main_room")
default main_room = Room("main_room", "main_room_menu")
default fireplace_OBJ = RoomObject(main_room, "fireplace", pos=(693, 277), idle="fireplace_idle_shadow", focus_mask="fireplace_hover", foreground=None, action=Jump("fireplace"), tooltip="Light/Extinguish")
default cupboard_OBJ = RoomObject(main_room, "cupboard", pos=(260, 280), idle="cupboard_idle", action=Jump("cupboard"), tooltip="Rummage")
default phoenix_OBJ = RoomObject(main_room, "phoenix", pos=(557, 272), idle="phoenix_idle", hover="phoenix_hover", focus_mask="phoenix_idle", background="phoenix_feather", action=Jump("phoenix"), tooltip="Interact")
default door_OBJ = RoomObject(main_room, "door", pos=(898, 315), idle="door_idle", focus_mask="door_hover", action=Jump("door"), tooltip="Summon")
default phoenix_OBJ = RoomObject(
main_room, "phoenix",
pos=(557, 272),
idle="phoenix_idle",
hover="phoenix_hover",
focus_mask="phoenix_idle",
background="phoenix_feather",
action={
"Feed": (Text("Feed"), Jump("phoenix_feed"), "True"),
"Pet": (Text("Pet"), Jump("phoenix_pet"), "True")
},
tooltip="Phoenix"
)
default door_OBJ = RoomObject(main_room, "door", pos=(898, 315), idle="door_idle", focus_mask="door_hover", action=Jump("door"), tooltip="Door")
default candleL_OBJ = RoomObject(main_room, "candle_left", pos=(350, 160), idle="candle_left", foreground=None, action=ToggleVariable("candleL_OBJ.foreground", "candle_fire", None), zorder=3)
default candleR_OBJ = RoomObject(main_room, "candle_right", pos=(833, 225), idle="candle_right", foreground=None, action=ToggleVariable("candleR_OBJ.foreground", "candle_fire", None), zorder=3)
default desk_OBJ = RoomObject(main_room, "desk", pos=(370, 336), idle="ch_gen sit_behind_desk", hover="ch_gen sit_behind_desk_hover", focus_mask="ch_gen sit_behind_desk", action=Jump("desk"), hovered=Show("gui_tooltip", img="emo_exclaim", xx=335, yy=210), unhovered=Hide("gui_tooltip"), tooltip="Desk", zorder=1)
default desk_OBJ = RoomObject(
main_room, "desk",
pos=(370, 336),
idle="ch_gen sit_behind_desk",
hover="ch_gen sit_behind_desk_hover",
focus_mask="ch_gen sit_behind_desk",
action={
"Sleep": (Text("Slee"), If(game.daytime, Return("night_start"), Return("day_start")), "True"),
"Jerk Off": (Text("Jerk"), Jump("jerk_off"), "True"),
"Do Paperwork": (Text("Work"), Jump("paperwork"), "True"),
"Open Inventory": (Text("Inve"), Jump("inventory"), "True"),
"Open Deck Builder": (Text("Deck"), Jump("deck_builder"), "states.cardgame.unlocked"),
},
hovered=Show(
"gui_tooltip",
img="emo_exclaim",
xx=335,
yy=210
),
unhovered=Hide("gui_tooltip"),
tooltip="Desk",
zorder=1
)
default poster_OBJ = RoomObject(main_room, "poster", pos=(364, 285), idle=Null(127, 166), action=Jump("enlarge_poster"), zorder=-1)
default trophy_OBJ = RoomObject(main_room, "trophy", pos=(650, 120), idle=Null(), action=None, zorder=-1)
default chair_OBJ = RoomObject(main_room, "chair", pos=(793, 300), idle="chair_right", action=None, zorder=0)

File diff suppressed because it is too large Load Diff