allow use of escape to exit ok/cancel and yes/no dialogs with negative results

This commit is contained in:
Dave White 2003-11-08 19:52:41 +00:00
parent 84fc9a1925
commit 926ee25c94

View file

@ -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();