Don't clear the menu screen if the keypress wasn't recognized.

git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@505 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
Pasi Kallinen 2009-10-19 15:17:28 +00:00
parent be6b2a6073
commit 91675def98
1 changed files with 6 additions and 1 deletions

View File

@ -1876,6 +1876,7 @@ runmenuloop(struct dg_menu *menu)
struct dg_banner ban; struct dg_banner ban;
struct dg_menuoption *tmpopt; struct dg_menuoption *tmpopt;
int userchoice = 0; int userchoice = 0;
int doclear = 1;
if (!menu) return 1; if (!menu) return 1;
@ -1884,7 +1885,10 @@ runmenuloop(struct dg_menu *menu)
loadbanner(menu->banner_fn, &ban); loadbanner(menu->banner_fn, &ban);
while (1) { while (1) {
clear(); if (doclear) {
doclear = 0;
clear();
}
drawbanner(&ban, 1, 0); drawbanner(&ban, 1, 0);
mvprintw(menu->cursor_y, menu->cursor_x, ""); mvprintw(menu->cursor_y, menu->cursor_x, "");
refresh(); refresh();
@ -1894,6 +1898,7 @@ runmenuloop(struct dg_menu *menu)
while (tmpopt) { while (tmpopt) {
if (strchr(tmpopt->keys, userchoice)) { if (strchr(tmpopt->keys, userchoice)) {
dgl_exec_cmdqueue(tmpopt->cmdqueue, selected_game, me); dgl_exec_cmdqueue(tmpopt->cmdqueue, selected_game, me);
doclear = 1;
break; break;
} else { } else {
tmpopt = tmpopt->next; tmpopt = tmpopt->next;