From 48c4c4ecad44402bff76e3b4dbafeeda5424b6af Mon Sep 17 00:00:00 2001 From: Gouvernathor <44340603+Gouvernathor@users.noreply.github.com> Date: Thu, 16 Nov 2023 01:34:38 +0100 Subject: [PATCH] Fix and simplify the map in addition to benigh simplification, this actually fixes a bug : setting pos and align in the same line is a bug, it's always been unspecified, you should have been setting *anchor* instead. xycenter does that now. --- game/scripts/interface/map.rpy | 140 ++++++++++++++++----------------- 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/game/scripts/interface/map.rpy b/game/scripts/interface/map.rpy index 81a17286..1d2f2d1e 100644 --- a/game/scripts/interface/map.rpy +++ b/game/scripts/interface/map.rpy @@ -1,6 +1,3 @@ -default UI_xpos_offset = 230 -default UI_ypos_offset = 150 - default map_animated = "once" define map_scale = 0.35 @@ -41,24 +38,27 @@ screen map_screen(): if map_animated == "once": timer map_ani_time+1 action SetVariable("map_animated", False) - if unfold: - add "map_unfold" xpos UI_xpos_offset ypos UI_ypos_offset zoom map_scale # 588x420 - else: - add "interface/map/map.webp" xpos UI_xpos_offset ypos UI_ypos_offset zoom map_scale # 588x420 - fixed: + pos (230, 150) + if unfold: - at map_fadein - use map_buttons - use map_screen_characters + add "map_unfold" zoom map_scale # 588x420 + else: + add "interface/map/map.webp" zoom map_scale # 588x420 + + fixed: + if unfold: + at map_fadein + use map_buttons + use map_screen_characters screen map_buttons(): tag map zorder 4 #Office imagebutton: - xpos UI_xpos_offset +112 - ypos UI_ypos_offset +234 + xpos 112 + ypos 234 idle "interface/map/room_office_idle.webp" hover "interface/map/room_office_hover.webp" hovered SetScreenVariable("ball_hint", "office") @@ -67,8 +67,8 @@ screen map_buttons(): #Gryffindor imagebutton: - xpos UI_xpos_offset +148 - ypos UI_ypos_offset +214 + xpos 148 + ypos 214 idle "interface/map/room_gryffindor_idle.webp" # hover "interface/map/room_gryffindor_hover.webp" # hovered SetScreenVariable("ball_hint", "dorm_gryffindor") @@ -77,8 +77,8 @@ screen map_buttons(): #Ravenclaw imagebutton: - xpos UI_xpos_offset +286 - ypos UI_ypos_offset +256 + xpos 286 + ypos 256 idle "interface/map/room_ravenclaw_idle.webp" # hover "interface/map/room_ravenclaw_hover.webp" # hovered SetScreenVariable("ball_hint", "dorm_ravenclaw") @@ -87,8 +87,8 @@ screen map_buttons(): #Hufflepuff imagebutton: - xpos UI_xpos_offset +76 - ypos UI_ypos_offset +295 + xpos 76 + ypos 295 idle "interface/map/room_hufflepuff_idle.webp" #hovered SetScreenVariable("ball_hint", "dorm_hufflepuff") #unhovered SetScreenVariable("ball_hint", None) @@ -97,8 +97,8 @@ screen map_buttons(): #Slytherin imagebutton: - xpos UI_xpos_offset +214 - ypos UI_ypos_offset +136 + xpos 214 + ypos 136 idle "interface/map/room_slytherin_idle.webp" #hovered SetScreenVariable("ball_hint", "dorm_slytherin") #unhovered SetScreenVariable("ball_hint", None) @@ -107,10 +107,10 @@ screen map_buttons(): #Weasley Store 15 x 15 if not item_store_intro_done: - add "interface/achievements/glow.webp" pos (UI_xpos_offset+246, UI_ypos_offset+231) align (0.5, 0.5) offset (15, 15) zoom 0.15 alpha 0.5 at rotate_circular + add "interface/achievements/glow.webp" xycenter (246, 231) offset (15, 15) zoom 0.15 alpha 0.5 at rotate_circular imagebutton: - xpos UI_xpos_offset +246 - ypos UI_ypos_offset +231 + xpos 246 + ypos 231 idle "interface/map/room_weasley_store_idle.webp" hover "interface/map/room_weasley_store_hover.webp" hovered SetScreenVariable("ball_hint", "weasley_store") @@ -119,10 +119,10 @@ screen map_buttons(): #Clothing Store if not clothing_store_intro_done: - add "interface/achievements/glow.webp" pos (UI_xpos_offset+462, UI_ypos_offset+231) align (0.5, 0.5) offset (15, 15) zoom 0.15 alpha 0.5 at rotate_circular + add "interface/achievements/glow.webp" xycenter (462, 231) offset (15, 15) zoom 0.15 alpha 0.5 at rotate_circular imagebutton: - xpos UI_xpos_offset +462 - ypos UI_ypos_offset +231 + xpos 462 + ypos 231 idle "interface/map/room_clothing_store_idle.webp" hover "interface/map/room_clothing_store_hover.webp" hovered SetScreenVariable("ball_hint", "clothing_store") @@ -131,10 +131,10 @@ screen map_buttons(): # Snape's Office if not states.map.snape_office.visited: - add "interface/achievements/glow.webp" pos (UI_xpos_offset+314, UI_ypos_offset+331) align (0.5, 0.5) offset (15, 15) zoom 0.15 alpha 0.5 at rotate_circular + add "interface/achievements/glow.webp" xycenter (314, 331) offset (15, 15) zoom 0.15 alpha 0.5 at rotate_circular imagebutton: - xpos UI_xpos_offset +314 - ypos UI_ypos_offset +331 + xpos 314 + ypos 331 idle "interface/map/room_potions_idle.webp" hover "interface/map/room_potions_hover.webp" hovered SetScreenVariable("ball_hint", "potions") @@ -144,10 +144,10 @@ screen map_buttons(): #Room of Requirement if states.map.seventh_floor.unlocked: if not states.map.room_of_requirement.intro_e1: - add "interface/achievements/glow.webp" pos (UI_xpos_offset+116, UI_ypos_offset+160) align (0.5, 0.5) offset (15, 15) zoom 0.15 alpha 0.5 at rotate_circular + add "interface/achievements/glow.webp" xycenter (116, 160) offset (15, 15) zoom 0.15 alpha 0.5 at rotate_circular imagebutton: - xpos UI_xpos_offset +116 - ypos UI_ypos_offset +160 + xpos 116 + ypos 160 unhovered SetScreenVariable("ball_hint", None) hovered SetScreenVariable("ball_hint", "room_of_req") action Return("seventh_floor") @@ -160,8 +160,8 @@ screen map_buttons(): #Lake imagebutton: - xpos UI_xpos_offset +131 - ypos UI_ypos_offset +367 + xpos 131 + ypos 367 idle "interface/map/room_boat_house_idle.webp" # hover "interface/map/room_boat_house_hover.webp" # hovered SetScreenVariable("ball_hint", "lake") @@ -170,8 +170,8 @@ screen map_buttons(): #Forest imagebutton: - xpos UI_xpos_offset +103 - ypos UI_ypos_offset +12 + xpos 103 + ypos 12 idle "interface/map/room_north_courtyard_idle.webp" # hover "interface/map/room_north_courtyard_hover.webp" # hovered SetScreenVariable("ball_hint", "forest") @@ -181,10 +181,10 @@ screen map_buttons(): #Attic if states.her.ev.sealed_scroll.examined: if not states.her.ev.sealed_scroll.sample: - add "interface/achievements/glow.webp" pos (UI_xpos_offset+340, UI_ypos_offset+226) align (0.5, 0.5) offset (15, 15) zoom 0.15 alpha 0.5 at rotate_circular + add "interface/achievements/glow.webp" xycenter (340, 226) offset (15, 15) zoom 0.15 alpha 0.5 at rotate_circular imagebutton: - xpos UI_xpos_offset +340 - ypos UI_ypos_offset +226 + xpos 340 + ypos 226 idle "interface/map/room_attic_closed_idle.webp" hover "interface/map/room_attic_closed_hover.webp" hovered SetScreenVariable("ball_hint", "attic") @@ -192,8 +192,8 @@ screen map_buttons(): action Return("map_attic") else: imagebutton: - xpos UI_xpos_offset +340 - ypos UI_ypos_offset +226 + xpos 340 + ypos 226 idle "interface/map/room_attic_open_idle.webp" hover "interface/map/room_attic_open_hover.webp" hovered SetScreenVariable("ball_hint", "attic") @@ -203,7 +203,7 @@ screen map_buttons(): # Map animation toggle textbutton "Animation": style gui.theme("check_button") - pos (700, 530) + pos (470, 380) selected map_animated tooltip "Toggles map folding animation" action ToggleVariable("map_animated", True, False) @@ -318,72 +318,72 @@ label set_cho_map_location(location = ""): label update_character_map_locations: if states.her.map_location == "library": - $ her_map_xpos = 685 + $ her_map_xpos = 455 $ her_map_ypos = 94 elif states.her.map_location == "room_g": - $ her_map_xpos = 340 + $ her_map_xpos = 110 $ her_map_ypos = 212 elif states.her.map_location == "room_s": - $ her_map_xpos = 440 + $ her_map_xpos = 210 $ her_map_ypos = 184 elif states.her.map_location == "great_hall": - $ her_map_xpos = 300 + $ her_map_xpos = 70 $ her_map_ypos = 240 elif states.her.map_location == "courtyard": - $ her_map_xpos = 674 + $ her_map_xpos = 444 $ her_map_ypos = 216 elif states.her.map_location == "forest": - $ her_map_xpos = 290 + $ her_map_xpos = 60 $ her_map_ypos = 40 #Luna if states.lun.map_location == "room_r": - $ lun_map_xpos = 536 + $ lun_map_xpos = 306 $ lun_map_ypos = 242 elif states.lun.map_location == "forest": - $ lun_map_xpos = 430 + $ lun_map_xpos = 200 $ lun_map_ypos = 50 elif states.lun.map_location == "greenhouse": - $ lun_map_xpos = 680 + $ lun_map_xpos = 450 $ lun_map_ypos = 320 #Astoria if states.ast.map_location == "room_s": - $ ast_map_xpos = 476 + $ ast_map_xpos = 246 $ ast_map_ypos = 118 elif states.ast.map_location == "courtyard": - $ ast_map_xpos = 634 + $ ast_map_xpos = 404 $ ast_map_ypos = 254 elif states.ast.map_location == "defense": #Event - $ ast_map_xpos = 530 + $ ast_map_xpos = 300 $ ast_map_ypos = 190 #Susan if states.sus.map_location == "room_h": - $ sus_map_xpos = 360 + $ sus_map_xpos = 130 $ sus_map_ypos = 320 elif states.sus.map_location == "great_hall": - $ sus_map_xpos = 300 + $ sus_map_xpos = 70 $ sus_map_ypos = 280 #Cho if states.cho.map_location == "room_r": - $ cho_map_xpos = 494 + $ cho_map_xpos = 264 $ cho_map_ypos = 276 elif states.cho.map_location == "training_grounds": - $ cho_map_xpos = 750 + $ cho_map_xpos = 520 $ cho_map_ypos = 50 #Tonks - $ ton_map_xpos = 548 + $ ton_map_xpos = 318 $ ton_map_ypos = 156 #Snape if game.daytime: - $ sna_map_xpos = 595 + $ sna_map_xpos = 365 $ sna_map_ypos = 270 else: - $ sna_map_xpos = 598 + $ sna_map_xpos = 368 $ sna_map_ypos = 348 return @@ -395,10 +395,10 @@ screen map_screen_characters(): #Hermione if states.her.unlocked: if states.her.map_location == "forest": # Mark forest event. - add "interface/achievements/glow.webp" pos (her_map_xpos, UI_ypos_offset+her_map_ypos) align (0.5, 0.5) zoom 0.15 alpha 0.5 at rotate_circular + add "interface/achievements/glow.webp" xycenter (her_map_xpos, her_map_ypos) zoom 0.15 alpha 0.5 at rotate_circular imagebutton: xpos her_map_xpos - ypos +UI_ypos_offset +her_map_ypos + ypos her_map_ypos xalign 0.5 yalign 0.5 idle "interface/map/name_hermione.webp" @@ -411,7 +411,7 @@ screen map_screen_characters(): if states.lun.unlocked: imagebutton: xpos lun_map_xpos - ypos UI_ypos_offset+ lun_map_ypos + ypos lun_map_ypos xalign 0.5 yalign 0.5 idle "interface/map/name_luna.webp" @@ -424,7 +424,7 @@ screen map_screen_characters(): if states.ast.unlocked: imagebutton: xpos ast_map_xpos - ypos UI_ypos_offset +ast_map_ypos + ypos ast_map_ypos xalign 0.5 yalign 0.5 idle "interface/map/name_astoria.webp" @@ -437,7 +437,7 @@ screen map_screen_characters(): if states.sus.unlocked: imagebutton: xpos sus_map_xpos - ypos UI_ypos_offset +sus_map_ypos + ypos sus_map_ypos xalign 0.5 yalign 0.5 idle "interface/map/name_susan.webp" @@ -450,7 +450,7 @@ screen map_screen_characters(): if states.cho.unlocked: imagebutton: xpos cho_map_xpos - ypos UI_ypos_offset +cho_map_ypos + ypos cho_map_ypos xalign 0.5 yalign 0.5 idle "interface/map/name_cho.webp" @@ -463,7 +463,7 @@ screen map_screen_characters(): if states.sna.unlocked: imagebutton: xpos sna_map_xpos - ypos UI_ypos_offset +sna_map_ypos + ypos sna_map_ypos xalign 0.5 yalign 0.5 idle "interface/map/name_snape.webp" @@ -476,7 +476,7 @@ screen map_screen_characters(): if states.ton.unlocked: imagebutton: xpos ton_map_xpos - ypos UI_ypos_offset +ton_map_ypos + ypos ton_map_ypos xalign 0.5 yalign 0.5 idle "interface/map/name_tonks.webp"