Skip to content

Commit 23f44b9

Browse files
committed
fix(zc): consume button presses in subscreen menu
The subscreen refactor ~6 months ago resulted in button presses not being eaten. One side effect of this was the item selection sfx playing for every frame the button was down, instead of the intended one time.
1 parent 5f7ab3c commit 23f44b9

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/zc/zc_subscr.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,16 @@ void dosubscr()
148148
// Consume whatever input was registered during opening animation.
149149
if (replay_version_check(18))
150150
load_control_state();
151-
151+
152+
bool legacy_btn_press_peek = false;
153+
if (replay_is_active())
154+
{
155+
std::string qst = replay_get_meta_str("qst");
156+
legacy_btn_press_peek |= qst == "demosp253.qst";
157+
legacy_btn_press_peek |= qst == "first_quest_layered.qst";
158+
legacy_btn_press_peek |= qst == "hell_awaits.qst";
159+
}
160+
152161
do
153162
{
154163
if (replay_version_check(0, 11))
@@ -162,7 +171,7 @@ void dosubscr()
162171
bool can_btn = !subscr_pg_animating;
163172
if(can_btn)
164173
{
165-
byte btn_press = getIntBtnInput(0xFF, true, false, false, false, true);
174+
byte btn_press = getIntBtnInput(0xFF, true, false, false, false, legacy_btn_press_peek);
166175
int32_t pos = pg.cursor_pos;
167176

168177
if(rUp()) pg.move_cursor(SEL_UP);

0 commit comments

Comments
 (0)