allow use of escape to exit ok/cancel and yes/no dialogs with negative results
This commit is contained in:
parent
84fc9a1925
commit
926ee25c94
1 changed files with 10 additions and 0 deletions
|
@ -501,6 +501,16 @@ int show_dialog(display& disp, SDL_Surface* image,
|
|||
return -1;
|
||||
}
|
||||
|
||||
if(!key_down && key[KEY_ESCAPE] &&
|
||||
(type == YES_NO || type == OK_CANCEL)) {
|
||||
|
||||
if(menu_.height() == 0) {
|
||||
return 1;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if(menu_.selection() != cur_selection || first_time) {
|
||||
cur_selection = menu_.selection();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue