WTS/game/scripts/rooms/main_room/init.rpy
LoafyLemon 1d3a12f0f6 Wheelmenu, Bug fixes
* Implement disabled state for wheelmenu buttons
* Simplify wheelmenu definitions
* Fix bogus warning for doll elements during stale displayable evaluation (cache)
2024-09-24 19:59:59 +01:00

141 lines
6.5 KiB
Plaintext

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={
"Open Inventory": (Text("🎒", align=(0.5, 0.5)), Jump("inventory")),
"Rummage": (Text("🖐️", align=(0.5, 0.5)), Jump("cupboard")),
"Calendar": (Text("📆", align=(0.5, 0.5)), Jump("calendar")),
},
tooltip="Cupboard"
)
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("🍔", align=(0.5, 0.5)), Jump("phoenix_feed")),
"Pet": (Text("🖐️", align=(0.5, 0.5)), Jump("phoenix_pet"))
},
tooltip="Phoenix"
)
default door_OBJ = RoomObject(
main_room,
"door",
pos=(898, 315),
idle="door_idle",
focus_mask="door_hover",
action={
"Summon Snape": (Transform("wheelmenu_snape", align=(0.5, 0.5), xysize=(32, 32)), IfExpr("states.sna.busy", None, Jump("summon_snape")), "states.sna.unlocked", "states.sna.busy"),
"Summon Tonks": (Transform("wheelmenu_tonks", align=(0.5, 0.5), xysize=(32, 32)), IfExpr("states.ton.busy", None, Jump("summon_tonks")), "states.ton.unlocked", "states.ton.busy"),
"Summon Hermione": (Transform("wheelmenu_hermione", align=(0.5, 0.5), xysize=(32, 32)), IfExpr("states.her.busy", None, Jump("summon_hermione")), "states.her.unlocked", "states.her.busy"),
"Summon Cho": (Transform("wheelmenu_cho", align=(0.5, 0.5), xysize=(32, 32)), IfExpr("states.cho.busy", None, Jump("summon_cho")), "states.cho.unlocked", "states.cho.busy"),
"Summon Luna": (Transform("wheelmenu_luna", align=(0.5, 0.5), xysize=(32, 32)), IfExpr("states.lun.busy", None, Jump("summon_luna")), "states.lun.unlocked", "states.lun.busy"),
"Summon Astoria": (Transform("wheelmenu_astoria", align=(0.5, 0.5), xysize=(32, 32)), IfExpr("states.ast.busy", None, Jump("summon_astoria")), "states.ast.unlocked", "states.ast.busy"),
"Summon Susan": (Transform("wheelmenu_susan", align=(0.5, 0.5), xysize=(32, 32)), IfExpr("states.sus.busy", None, Jump("summon_susan")), "states.sus.unlocked", "states.sus.busy"),
"Exit": (Text("🚪", align=(0.5, 0.5)), IfExpr("states.map.unlocked", Jump("map"), 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={
"Sleep": (Text("💤", align=(0.5, 0.5)), IfExpr("states.env.daytime", Jump("night_start"), Jump("day_start"))),
"Jerk Off": (Text("🍆", align=(0.5, 0.5)), Jump("jerk_off")),
"Do Paperwork": (Text("📝", align=(0.5, 0.5)), Jump("paperwork"), "states.paperwork_unlocked"),
"Open Deck Builder": (Text("🃏", align=(0.5, 0.5)), Jump("deck_builder"), "states.cardgame.unlocked"),
"Open Cheats Menu": (Text("🕹️", align=(0.5, 0.5)), Jump("cheats"), "states.env.cheats"),
"Open Achievements Menu": (Text("⭐", align=(0.5, 0.5)), Jump("achievements")),
},
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)
default chair_left_OBJ = RoomObject(main_room, "chair", pos=(333, 300), idle="chair_left", action=None, zorder=0, hidden=True)
default owl_OBJ = RoomObject(main_room, "owl", pos=(455, 289), idle="owl_letter", hover="owl_letter_hover", action=Jump("letter_open_all"), tooltip=_("Check Mail"), hidden=True, anchor=(0.5, 1.0))
default parcel_OBJ = RoomObject(main_room, "parcel", pos=(402, 290), idle="parcel", action=Jump("parcel_open_all"), tooltip=_("Check Parcel"), hidden=True, anchor=(0.5, 1.0))
default rug_OBJ = RoomObject(main_room, "rug", pos=(482, 392), idle=Null(), action=None, zorder=0)
default chandelier_OBJ = RoomObject(main_room, "chandelier", pos=(536, 24), idle=Null(), action=None, zorder=5)
default window_OBJ = RoomObject(main_room, "window", pos=(459, 192), idle=Null(), action=None, zorder=0)
default safe_OBJ = RoomObject(main_room, "safe", pos=(73, 324), idle=Text("Safe", color="#fff"), action=Jump("inventory"), zorder=0)
screen main_room():
tag room
zorder 0
sensitive room_menu_active
default objects = sorted(main_room.objects, key=lambda x: x.zorder)
# Hotkeys
if room_menu_active and states.env.day > 1 and not renpy.android:
use hotkeys_main
add "weather [states.env.weather]" xycenter (430, 218)
# Walls
if states.env.daytime:
add "main_room_idle_day"
else:
add "main_room_idle_night"
for obj in objects:
imagebutton:
anchor obj.get_anchor()
pos obj.get_pos()
idle obj.get_idle()
hover obj.get_hover()
foreground obj.get_foreground()
background obj.background
focus_mask obj.focus_mask
tooltip obj.tooltip
hovered obj.hovered
unhovered obj.unhovered
action obj.get_action()
label main_room:
call room("main_room", stop_sound=False)
call gen_walk(action="enter", xpos="desk", ypos="base", speed=1.5)
call gen_chibi("sit_behind_desk")
with d3
if states.env.daytime:
jump day_resume
else:
jump night_resume
# Return to main_room at menu point (after quests and events)
# Used to return from main room interactions
label main_room_menu:
hide screen bld1
with d3
if states.env.daytime:
jump day_resume
else:
jump night_resume