}
-void
+int
runmenuloop(struct dg_menu *menu)
{
struct dg_banner ban;
struct dg_menuoption *tmpopt;
int userchoice = 0;
- if (!menu) return;
+ if (!menu) return 1;
ban.lines = NULL;
ban.len = 0;
mvprintw(menu->cursor_y, menu->cursor_x, "");
refresh();
userchoice = getch();
- if (userchoice == ERR) return;
+ if (userchoice == ERR) return 1;
tmpopt = menu->options;
while (tmpopt) {
if (strchr(tmpopt->keys, userchoice)) {
if (return_from_submenu) {
return_from_submenu = 0;
- return;
+ return 0;
}
if (check_retard(0)) {
initcurses ();
while (1) {
- runmenuloop(dgl_find_menu(loggedin ? "mainmenu_user" : "mainmenu_anon"));
+ if (runmenuloop(dgl_find_menu(loggedin ? "mainmenu_user" : "mainmenu_anon")))
+ break;
}
/* NOW we can safely kill this */
extern struct dg_game **sort_games(struct dg_game **games, int len, dg_sortmode sortmode);
-void runmenuloop(struct dg_menu *menu);
+int runmenuloop(struct dg_menu *menu);
extern void inprogressmenu(int gameid);
extern void change_email(void);