From fa3e1e44509081fd4c6c9ad738c91adea19b0970 Mon Sep 17 00:00:00 2001 From: Gouvernathor <44340603+Gouvernathor@users.noreply.github.com> Date: Thu, 16 Nov 2023 01:51:18 +0100 Subject: [PATCH] Refactor states.menu_pos and remove reset_menu_position (cherry picked from commit fbe8035c43eadcced7ab3fd1ed8b57613ec0562c) --- .../astoria/events/spells/imperio_tonks.rpy | 1 - game/scripts/characters/astoria/summon.rpy | 8 +++----- .../cho/events/quidditch/hufflepuff_practice.rpy | 2 -- .../characters/cho/events/quidditch/training.rpy | 2 -- game/scripts/characters/cho/summon.rpy | 3 --- .../favors/hg_pf_T3a_look_at_ass_INCOMPLETE.txt | 2 -- game/scripts/characters/hermione/summon.rpy | 4 +--- game/scripts/characters/luna/summon.rpy | 4 +--- game/scripts/characters/tonks/summon.rpy | 2 -- game/scripts/events/variables.rpy | 1 - game/scripts/gui/say.rpy | 4 ++-- game/scripts/interface/letter.rpy | 6 +----- game/scripts/rooms/main_room/init.rpy | 3 --- game/scripts/rooms/seventh_floor/init.rpy | 1 - game/scripts/utility/common_labels.rpy | 13 +------------ 15 files changed, 9 insertions(+), 47 deletions(-) diff --git a/game/scripts/characters/astoria/events/spells/imperio_tonks.rpy b/game/scripts/characters/astoria/events/spells/imperio_tonks.rpy index 86184163..c10d75eb 100644 --- a/game/scripts/characters/astoria/events/spells/imperio_tonks.rpy +++ b/game/scripts/characters/astoria/events/spells/imperio_tonks.rpy @@ -1720,7 +1720,6 @@ label ag_st_imperio_E5: "\"You're nothing more than a whore!\"": ton @ hair horny "Yes!" ("mad", "base", "worried", "mid") ton @ hair horny "I'm nothing but a cheap,{w=0.6} {b}fucking{/b}{w=0.4} whore!" ("open_wide_tongue", "closed", "worried", "mid") - call reset_menu_position ton "... {w}This is what I want!" ("mad", "wide", "annoyed", "down") gen "Good, you're doing this for yourself, and nobody else..." ("base", xpos="far_left", ypos="head") diff --git a/game/scripts/characters/astoria/summon.rpy b/game/scripts/characters/astoria/summon.rpy index a2e76321..e3dd1419 100644 --- a/game/scripts/characters/astoria/summon.rpy +++ b/game/scripts/characters/astoria/summon.rpy @@ -14,8 +14,6 @@ label summon_astoria: label astoria_requests: - # Reset - call reset_menu_position ast "" (xpos="base",ypos="base") menu: @@ -28,7 +26,7 @@ label summon_astoria: call astoria_chitchat jump astoria_talk - "-Sexual favours-" (icon="interface/icons/small/condom.webp"): # TODO: add 'if states.ast.favors_unlocked' once her story is looked over again + "-Sexual favours-" (icon="interface/icons/small/condom.webp"): # TODO: add 'if states.ast.favors_unlocked' once her story is looked over again if states.ast.mood != 0: ast "I don't want to today..." ("annoyed", "narrow", "base", "R") nar "Astoria is upset with you." @@ -284,7 +282,7 @@ label astoria_favor_menu: label .requests: call not_available - + # $ result = show_events_menu(hermione_requests) # if result in ("disabled", "noncompliant"): @@ -313,4 +311,4 @@ label astoria_favor_menu: $ result.start() "-Never mind-": - jump astoria_requests \ No newline at end of file + jump astoria_requests diff --git a/game/scripts/characters/cho/events/quidditch/hufflepuff_practice.rpy b/game/scripts/characters/cho/events/quidditch/hufflepuff_practice.rpy index 128ef34c..84a7edbf 100644 --- a/game/scripts/characters/cho/events/quidditch/hufflepuff_practice.rpy +++ b/game/scripts/characters/cho/events/quidditch/hufflepuff_practice.rpy @@ -147,8 +147,6 @@ label cc_ht_talk: call cho_chibi("stand", "mid", "base") call gen_chibi("sit_behind_desk") - call reset_menu_position - hide screen blkfade cho "" ("base", "base", "base", "mid", xpos="base", ypos="base", trans=fade) diff --git a/game/scripts/characters/cho/events/quidditch/training.rpy b/game/scripts/characters/cho/events/quidditch/training.rpy index 4f58a1d6..5d83bffe 100644 --- a/game/scripts/characters/cho/events/quidditch/training.rpy +++ b/game/scripts/characters/cho/events/quidditch/training.rpy @@ -398,8 +398,6 @@ label cho_training: call cho_chibi("stand", "mid", "base") call gen_chibi("sit_behind_desk") - call reset_menu_position - hide screen blkfade cho "" ("base", "base", "base", "mid", xpos="base", ypos="base", trans=fade) jump cho_requests diff --git a/game/scripts/characters/cho/summon.rpy b/game/scripts/characters/cho/summon.rpy index c07cf91e..392da71d 100644 --- a/game/scripts/characters/cho/summon.rpy +++ b/game/scripts/characters/cho/summon.rpy @@ -32,8 +32,6 @@ label summon_cho: label cho_requests: - # Reset - call reset_menu_position cho "" (xpos="base", ypos="base") menu: @@ -195,4 +193,3 @@ label cho_favor_menu: label not_available: $ TBA_message("This feature is currently not available as of version %s." % config.version) return - diff --git a/game/scripts/characters/hermione/events/favors/hg_pf_T3a_look_at_ass_INCOMPLETE.txt b/game/scripts/characters/hermione/events/favors/hg_pf_T3a_look_at_ass_INCOMPLETE.txt index 929bcdf3..561754dd 100644 --- a/game/scripts/characters/hermione/events/favors/hg_pf_T3a_look_at_ass_INCOMPLETE.txt +++ b/game/scripts/characters/hermione/events/favors/hg_pf_T3a_look_at_ass_INCOMPLETE.txt @@ -4,8 +4,6 @@ label hg_pf_look_at_ass: #LV.3 (Whoring = 9 - 11) - call reset_menu_position - if hg_pf_look_at_ass.points == 0: gen "{size=-4}(I feel like checking out that ass.){/size}" ("base", xpos="far_left", ypos="head") else: diff --git a/game/scripts/characters/hermione/summon.rpy b/game/scripts/characters/hermione/summon.rpy index e05690f9..9fc61642 100644 --- a/game/scripts/characters/hermione/summon.rpy +++ b/game/scripts/characters/hermione/summon.rpy @@ -18,8 +18,6 @@ label summon_hermione: label hermione_requests: - # Reset - call reset_menu_position her "" (xpos="base",ypos="base") menu: @@ -262,7 +260,7 @@ label hermione_favor_menu: gen "Are you sure it's not within your house best interests?" ("base", xpos="far_left", ypos="head") her "What do you mean?" ("soft", "happy", "base", "mid") gen "Think about the future..." ("grin", xpos="far_left", ypos="head") - + label .convinced: if states.her.level >=20: diff --git a/game/scripts/characters/luna/summon.rpy b/game/scripts/characters/luna/summon.rpy index 3202320e..16a31fcc 100644 --- a/game/scripts/characters/luna/summon.rpy +++ b/game/scripts/characters/luna/summon.rpy @@ -22,8 +22,6 @@ label summon_luna: label luna_requests: - # Reset - call reset_menu_position lun "" (xpos="base",ypos="base") menu: @@ -150,7 +148,7 @@ label luna_favor_menu: label .requests: call not_available - + # $ result = show_events_menu(hermione_requests) # if result in ("disabled", "noncompliant"): diff --git a/game/scripts/characters/tonks/summon.rpy b/game/scripts/characters/tonks/summon.rpy index 1f5eb33f..5dde409b 100644 --- a/game/scripts/characters/tonks/summon.rpy +++ b/game/scripts/characters/tonks/summon.rpy @@ -18,8 +18,6 @@ label summon_tonks: label tonks_requests: - # Reset - call reset_menu_position ton "" (xpos="base",ypos="base") menu: diff --git a/game/scripts/events/variables.rpy b/game/scripts/events/variables.rpy index 92d552a1..768b2c60 100644 --- a/game/scripts/events/variables.rpy +++ b/game/scripts/events/variables.rpy @@ -3,7 +3,6 @@ default states.active_girl = None default states.last_girl = None default states.room = "main_room" -default states.menu_pos = (0.5, 0.5) default states.map.unlocked = False default states.map.seventh_floor.unlocked = False diff --git a/game/scripts/gui/say.rpy b/game/scripts/gui/say.rpy index e5c51366..e8625130 100644 --- a/game/scripts/gui/say.rpy +++ b/game/scripts/gui/say.rpy @@ -153,7 +153,7 @@ style quick_alt_button_text: # # https://www.renpy.org/doc/html/screen_special.html#choice -screen choice(items): +screen choice(items, menu_align=(.5, .6)): tag menu modal True zorder 30 @@ -169,7 +169,7 @@ screen choice(items): window at fade_show_hide(0.15): style "empty" - align states.menu_pos + align menu_align vbox: spacing 0 diff --git a/game/scripts/interface/letter.rpy b/game/scripts/interface/letter.rpy index 91dfe90f..d39c2e91 100644 --- a/game/scripts/interface/letter.rpy +++ b/game/scripts/interface/letter.rpy @@ -210,14 +210,10 @@ label letter(text, lbl): show screen letter(text) with d3 - $ states.menu_pos = (0.5, 0.9) - - menu: + menu (menu_align=(.5, .9)): "-Done reading-": pass - call reset_menu_position - hide screen letter hide screen blktone hide screen bld1 diff --git a/game/scripts/rooms/main_room/init.rpy b/game/scripts/rooms/main_room/init.rpy index fe0ca0a7..73bddc2f 100644 --- a/game/scripts/rooms/main_room/init.rpy +++ b/game/scripts/rooms/main_room/init.rpy @@ -55,7 +55,6 @@ screen main_room(): label main_room: call room("main_room", stop_sound=False) - call reset_menu_position call gen_walk(action="enter", xpos="desk", ypos="base", speed=1.5) call gen_chibi("sit_behind_desk") with d3 @@ -71,8 +70,6 @@ label main_room_menu: hide screen bld1 with d3 - call reset_menu_position - if game.daytime: jump day_resume else: diff --git a/game/scripts/rooms/seventh_floor/init.rpy b/game/scripts/rooms/seventh_floor/init.rpy index ceee5229..1150f951 100644 --- a/game/scripts/rooms/seventh_floor/init.rpy +++ b/game/scripts/rooms/seventh_floor/init.rpy @@ -29,7 +29,6 @@ screen seventh_floor(): label seventh_floor: call room("seventh_floor") - call reset_menu_position play music "music/the-chamber-by-kevin-macleod.ogg" fadein 1 fadeout 3 if_changed call gen_chibi("stand", -100, "base") call gen_walk(xpos="left_mid", ypos="base", speed=1.5) diff --git a/game/scripts/utility/common_labels.rpy b/game/scripts/utility/common_labels.rpy index 5ca6001b..7baa2463 100644 --- a/game/scripts/utility/common_labels.rpy +++ b/game/scripts/utility/common_labels.rpy @@ -11,13 +11,6 @@ label hide_characters: # Do not add transitions. Use one after return. return -# Reset menu -label reset_menu_position: - - $ states.menu_pos = (0.5, 0.6) - - return - label bld(action=None): if action == "hide": hide screen bld1 @@ -90,13 +83,11 @@ label music_block: label unlock_clothing(text="", item="interface/icons/box_blue_1.webp"): - $ states.menu_pos = (0.5, 0.75) - show screen clothing_unlock(item) show screen blktone with d3 - menu: + menu (menu_align=(.5, .75)): "[text]" "-Done Reading-": pass @@ -107,8 +98,6 @@ label unlock_clothing(text="", item="interface/icons/box_blue_1.webp"): $ item.unlock() - call reset_menu_position - return