From f9cf059f16635787fdca84e12ef3d6f4dfbb4076 Mon Sep 17 00:00:00 2001 From: Gouvernathor <44340603+Gouvernathor@users.noreply.github.com> Date: Wed, 15 Nov 2023 00:17:26 +0100 Subject: [PATCH] Convert ball_hint to a screen variable no leak --- game/scripts/interface/map.rpy | 80 +++++++++---------- game/scripts/rooms/main_room/objects/desk.rpy | 33 ++++---- 2 files changed, 56 insertions(+), 57 deletions(-) diff --git a/game/scripts/interface/map.rpy b/game/scripts/interface/map.rpy index b27c1a0c..4b150b9f 100644 --- a/game/scripts/interface/map.rpy +++ b/game/scripts/interface/map.rpy @@ -53,8 +53,8 @@ screen map_buttons(): ypos UI_ypos_offset +234 idle "interface/map/room_office_idle.webp" hover "interface/map/room_office_hover.webp" - hovered SetVariable("ball_hint", "office") - unhovered SetVariable("ball_hint", None) + hovered SetScreenVariable("ball_hint", "office") + unhovered SetScreenVariable("ball_hint", None) action Return("main_room_menu") #Gryffindor @@ -63,8 +63,8 @@ screen map_buttons(): ypos UI_ypos_offset +214 idle "interface/map/room_gryffindor_idle.webp" # hover "interface/map/room_gryffindor_hover.webp" - # hovered SetVariable("ball_hint", "dorm_gryffindor") - # unhovered SetVariable("ball_hint", None) + # hovered SetScreenVariable("ball_hint", "dorm_gryffindor") + # unhovered SetScreenVariable("ball_hint", None) # action Return("gryffindor_dormitories") #Ravenclaw @@ -73,8 +73,8 @@ screen map_buttons(): ypos UI_ypos_offset +256 idle "interface/map/room_ravenclaw_idle.webp" # hover "interface/map/room_ravenclaw_hover.webp" - # hovered SetVariable("ball_hint", "dorm_ravenclaw") - # unhovered SetVariable("ball_hint", None) + # hovered SetScreenVariable("ball_hint", "dorm_ravenclaw") + # unhovered SetScreenVariable("ball_hint", None) # action Return("ravenclaw_dormitories") #Hufflepuff @@ -82,8 +82,8 @@ screen map_buttons(): xpos UI_xpos_offset +76 ypos UI_ypos_offset +295 idle "interface/map/room_hufflepuff_idle.webp" - #hovered SetVariable("ball_hint", "dorm_hufflepuff") - #unhovered SetVariable("ball_hint", None) + #hovered SetScreenVariable("ball_hint", "dorm_hufflepuff") + #unhovered SetScreenVariable("ball_hint", None) #hover "interface/map/room_hufflepuff_hover.webp" #action Return("hufflepuff_dormitories") @@ -92,8 +92,8 @@ screen map_buttons(): xpos UI_xpos_offset +214 ypos UI_ypos_offset +136 idle "interface/map/room_slytherin_idle.webp" - #hovered SetVariable("ball_hint", "dorm_slytherin") - #unhovered SetVariable("ball_hint", None) + #hovered SetScreenVariable("ball_hint", "dorm_slytherin") + #unhovered SetScreenVariable("ball_hint", None) #hover "interface/map/room_slytherin_hover.webp" #action Return("slytherin_dormitories") @@ -105,8 +105,8 @@ screen map_buttons(): ypos UI_ypos_offset +231 idle "interface/map/room_weasley_store_idle.webp" hover "interface/map/room_weasley_store_hover.webp" - hovered SetVariable("ball_hint", "weasley_store") - unhovered SetVariable("ball_hint", None) + hovered SetScreenVariable("ball_hint", "weasley_store") + unhovered SetScreenVariable("ball_hint", None) action Return("item_store") #Clothing Store @@ -117,8 +117,8 @@ screen map_buttons(): ypos UI_ypos_offset +231 idle "interface/map/room_clothing_store_idle.webp" hover "interface/map/room_clothing_store_hover.webp" - hovered SetVariable("ball_hint", "clothing_store") - unhovered SetVariable("ball_hint", None) + hovered SetScreenVariable("ball_hint", "clothing_store") + unhovered SetScreenVariable("ball_hint", None) action Return("clothing_store") # Snape's Office @@ -129,8 +129,8 @@ screen map_buttons(): ypos UI_ypos_offset +331 idle "interface/map/room_potions_idle.webp" hover "interface/map/room_potions_hover.webp" - hovered SetVariable("ball_hint", "potions") - unhovered SetVariable("ball_hint", None) + hovered SetScreenVariable("ball_hint", "potions") + unhovered SetScreenVariable("ball_hint", None) action Return("snape_office") #Room of Requirement @@ -140,8 +140,8 @@ screen map_buttons(): imagebutton: xpos UI_xpos_offset +116 ypos UI_ypos_offset +160 - unhovered SetVariable("ball_hint", None) - hovered SetVariable("ball_hint", "room_of_req") + unhovered SetScreenVariable("ball_hint", None) + hovered SetScreenVariable("ball_hint", "room_of_req") action Return("seventh_floor") if not states.map.seventh_floor.visited: idle "interface/map/room_ror_empty_idle.webp" @@ -156,8 +156,8 @@ screen map_buttons(): ypos UI_ypos_offset +367 idle "interface/map/room_boat_house_idle.webp" # hover "interface/map/room_boat_house_hover.webp" - # hovered SetVariable("ball_hint", "lake") - # unhovered SetVariable("ball_hint", None) + # hovered SetScreenVariable("ball_hint", "lake") + # unhovered SetScreenVariable("ball_hint", None) # action Return("map_lake") #Forest @@ -166,8 +166,8 @@ screen map_buttons(): ypos UI_ypos_offset +12 idle "interface/map/room_north_courtyard_idle.webp" # hover "interface/map/room_north_courtyard_hover.webp" - # hovered SetVariable("ball_hint", "forest") - # unhovered SetVariable("ball_hint", None) + # hovered SetScreenVariable("ball_hint", "forest") + # unhovered SetScreenVariable("ball_hint", None) # action Return("map_forest") #Attic @@ -179,8 +179,8 @@ screen map_buttons(): ypos UI_ypos_offset +226 idle "interface/map/room_attic_closed_idle.webp" hover "interface/map/room_attic_closed_hover.webp" - hovered SetVariable("ball_hint", "attic") - unhovered SetVariable("ball_hint", None) + hovered SetScreenVariable("ball_hint", "attic") + unhovered SetScreenVariable("ball_hint", None) action Return("map_attic") else: imagebutton: @@ -188,8 +188,8 @@ screen map_buttons(): ypos UI_ypos_offset +226 idle "interface/map/room_attic_open_idle.webp" hover "interface/map/room_attic_open_hover.webp" - hovered SetVariable("ball_hint", "attic") - unhovered SetVariable("ball_hint", None) + hovered SetScreenVariable("ball_hint", "attic") + unhovered SetScreenVariable("ball_hint", None) action Return("map_attic") # Map animation toggle @@ -409,8 +409,8 @@ screen map_screen_characters(): yalign 0.5 idle "interface/map/name_hermione.webp" hover "interface/map/name_hermione_hover.webp" - hovered SetVariable("ball_hint", "summon_hermione") - unhovered SetVariable("ball_hint", None) + hovered SetScreenVariable("ball_hint", "summon_hermione") + unhovered SetScreenVariable("ball_hint", None) action Return("hermione") #Luna @@ -422,8 +422,8 @@ screen map_screen_characters(): yalign 0.5 idle "interface/map/name_luna.webp" hover "interface/map/name_luna_hover.webp" - hovered SetVariable("ball_hint", "summon_luna") - unhovered SetVariable("ball_hint", None) + hovered SetScreenVariable("ball_hint", "summon_luna") + unhovered SetScreenVariable("ball_hint", None) action Return("luna") #Astoria @@ -435,8 +435,8 @@ screen map_screen_characters(): yalign 0.5 idle "interface/map/name_astoria.webp" hover "interface/map/name_astoria_hover.webp" - hovered SetVariable("ball_hint", "summon_astoria") - unhovered SetVariable("ball_hint", None) + hovered SetScreenVariable("ball_hint", "summon_astoria") + unhovered SetScreenVariable("ball_hint", None) action Return("astoria") #Susan @@ -448,8 +448,8 @@ screen map_screen_characters(): yalign 0.5 idle "interface/map/name_susan.webp" hover "interface/map/name_susan_hover.webp" - hovered SetVariable("ball_hint", "summon_susan") - unhovered SetVariable("ball_hint", None) + hovered SetScreenVariable("ball_hint", "summon_susan") + unhovered SetScreenVariable("ball_hint", None) action Return("susan") #Cho @@ -461,8 +461,8 @@ screen map_screen_characters(): yalign 0.5 idle "interface/map/name_cho.webp" hover "interface/map/name_cho_hover.webp" - hovered SetVariable("ball_hint", "summon_cho") - unhovered SetVariable("ball_hint", None) + hovered SetScreenVariable("ball_hint", "summon_cho") + unhovered SetScreenVariable("ball_hint", None) action Return("cho") #Snape @@ -474,8 +474,8 @@ screen map_screen_characters(): yalign 0.5 idle "interface/map/name_snape.webp" hover "interface/map/name_snape_hover.webp" - hovered SetVariable("ball_hint", "summon_snape") - unhovered SetVariable("ball_hint", None) + hovered SetScreenVariable("ball_hint", "summon_snape") + unhovered SetScreenVariable("ball_hint", None) action Return("snape") #Tonks @@ -487,6 +487,6 @@ screen map_screen_characters(): yalign 0.5 idle "interface/map/name_tonks.webp" hover "interface/map/name_tonks_hover.webp" - hovered SetVariable("ball_hint", "summon_tonks") - unhovered SetVariable("ball_hint", None) + hovered SetScreenVariable("ball_hint", "summon_tonks") + unhovered SetScreenVariable("ball_hint", None) action Return("tonks") diff --git a/game/scripts/rooms/main_room/objects/desk.rpy b/game/scripts/rooms/main_room/objects/desk.rpy index 4ca2d5fe..1baf8a41 100644 --- a/game/scripts/rooms/main_room/objects/desk.rpy +++ b/game/scripts/rooms/main_room/objects/desk.rpy @@ -34,9 +34,6 @@ label desk: else: jump main_room_menu - #Define hints variable - $ ball_hint = None - # TODO: Refactor. Low priority. call update_character_map_locations @@ -148,6 +145,8 @@ screen desk_menu(): zorder 5 + default ball_hint = None + #Background add "interface/desk/_bg_.webp" @@ -157,7 +156,7 @@ screen desk_menu(): # Ugly hands # add "interface/desk/_hands_.webp" xpos 0 ypos -30 - use crystal_ball + use crystal_ball(ball_hint) use watch #Book @@ -169,9 +168,9 @@ screen desk_menu(): xalign 1.0 idle "interface/desk/book.webp" hover "interface/desk/book_hover.webp" - hovered SetVariable("ball_hint", "book") + hovered SetScreenVariable("ball_hint", "book") keysym "inventory" - unhovered SetVariable("ball_hint", None) + unhovered SetScreenVariable("ball_hint", None) action Return("inventory") #Tissue Box @@ -182,9 +181,9 @@ screen desk_menu(): xalign 1.0 idle "interface/desk/tissues.webp" hover "interface/desk/tissues_hover.webp" - hovered SetVariable("ball_hint", "jerk_off") + hovered SetScreenVariable("ball_hint", "jerk_off") keysym "fap" - unhovered SetVariable("ball_hint", None) + unhovered SetScreenVariable("ball_hint", None) action Return("jerk_off") #Work @@ -195,9 +194,9 @@ screen desk_menu(): xalign 0.0 idle "interface/desk/work.webp" hover "interface/desk/work_hover.webp" - hovered SetVariable("ball_hint", "work") + hovered SetScreenVariable("ball_hint", "work") keysym "work" - unhovered SetVariable("ball_hint", None) + unhovered SetScreenVariable("ball_hint", None) action Return("paperwork") #Cards @@ -209,8 +208,8 @@ screen desk_menu(): yalign 1.0 idle "interface/desk/cards.webp" hover "interface/desk/cards_hover.webp" - hovered SetVariable("ball_hint", "cards") - unhovered SetVariable("ball_hint", None) + hovered SetScreenVariable("ball_hint", "cards") + unhovered SetScreenVariable("ball_hint", None) action Return("deck_builder") #exit @@ -221,8 +220,8 @@ screen desk_menu(): ypos 600 idle "interface/desk/exit_mask.webp" hover "interface/desk/exit.webp" - hovered SetVariable("ball_hint", "exit") - unhovered SetVariable("ball_hint", None) + hovered SetScreenVariable("ball_hint", "exit") + unhovered SetScreenVariable("ball_hint", None) action Return("Close") #Night Overlay @@ -232,7 +231,7 @@ screen desk_menu(): use close_button -screen crystal_ball(): +screen crystal_ball(ball_hint): tag desk_interface zorder 8 @@ -250,9 +249,9 @@ screen watch(): ypos 0 idle "interface/desk/watch.webp" hover "interface/desk/watch_hover.webp" - unhovered SetVariable("ball_hint", None) + unhovered SetScreenVariable("ball_hint", None) keysym "sleep" - hovered If(game.daytime, SetVariable("ball_hint", "doze_off"), SetVariable("ball_hint", "sleep")) + hovered If(game.daytime, SetScreenVariable("ball_hint", "doze_off"), SetScreenVariable("ball_hint", "sleep")) action If(game.daytime, Return("night_start"), Return("day_start")) $ watch_x = 603 +67