Skip to content

Commit

Permalink
fix(zc): unreliable behavior of ESC in title screen
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark committed Sep 6, 2023
1 parent 62d266e commit b5e21a8
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions src/zc/title.cpp
Expand Up @@ -1167,6 +1167,23 @@ static void select_game(bool skip = false)
bool popup_choose_quest = false;
do
{
if (keypressed())
{
int32_t k=readkey()>>8;
if (k == KEY_ESC && mode)
{
mode = 0;
select_mode();
while(key[KEY_ESC])
{
poll_keyboard();
/* do nothing */
rest(1);
}
}
}
disabledKeys[KEY_ESC] = mode != 0;

if ( moduledata.refresh_title_screen ) //refresh
{
selectscreen();
Expand Down Expand Up @@ -1351,25 +1368,10 @@ static void select_game(bool skip = false)
chosecustomquest = false;
selectscreen();
}

if (keypressed())
{
int32_t k=readkey()>>8;
if (k == KEY_ESC)
{
mode = 0;
select_mode();
while(key[KEY_ESC])
{
poll_keyboard();
/* do nothing */
rest(1);
}
}
}
}
while(!Quit && !done);


disabledKeys[KEY_ESC] = false;
saveslot = -1;
}

Expand Down

0 comments on commit b5e21a8

Please sign in to comment.