From 80ab34a8f20756492773499b5dedfe46de60b2ca Mon Sep 17 00:00:00 2001 From: Spoike Date: Tue, 12 Mar 2013 22:41:34 +0000 Subject: [PATCH] ------------------------------------------------------------------------ r4186 | acceptthis | 2013-01-29 03:25:21 +0000 (Tue, 29 Jan 2013) | 1 line misc fixes for menus. mostly the quit menu, which can finally be used properly with a mouse. ------------------------------------------------------------------------ git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4184 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/cl_main.c | 8 ++++++-- engine/client/m_items.c | 4 ++-- engine/client/menu.c | 13 ++++++------- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index a9c68fbec..a303ca4b0 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -311,8 +311,12 @@ void CL_Quit_f (void) { if (forcesaveprompt) { - Cmd_ExecuteString("menu_quit", RESTRICT_LOCAL); - return; + forcesaveprompt =false; + if (Cmd_Exists("menu_quit")) + { + Cmd_ExecuteString("menu_quit", RESTRICT_LOCAL); + return; + } } TP_ExecTrigger("f_quit"); diff --git a/engine/client/m_items.c b/engine/client/m_items.c index 14030b4a1..bea7da1b1 100644 --- a/engine/client/m_items.c +++ b/engine/client/m_items.c @@ -1508,9 +1508,9 @@ void M_RemoveAllMenus (void) } void M_MenuPop_f (void) { - if (!firstmenu) + if (!currentmenu) return; - M_RemoveMenu(firstmenu); + M_RemoveMenu(currentmenu); } void M_Complex_Draw(void) diff --git a/engine/client/menu.c b/engine/client/menu.c index 856481347..49f9751f2 100644 --- a/engine/client/menu.c +++ b/engine/client/menu.c @@ -432,7 +432,7 @@ int M_FindKeysForBind (char *command, int *keylist, int total) b = keybindings[j][0]; if (!b) continue; - if (!strncmp (b, command, l) ) + if (!strncmp (b, command, l) && (!b[l] || b[l] == ' ' || b[l] == ';')) { keylist[count] = j; count++; @@ -739,7 +739,7 @@ qboolean MC_Quit_Key (int key, menu_t *menu) break; default: - break; + return false; } return true; @@ -772,7 +772,7 @@ qboolean MC_SaveQuit_Key (int key, menu_t *menu) break; default: - break; + return false; } return true; @@ -825,12 +825,11 @@ void M_Menu_Quit_f (void) MC_AddWhiteText(quitmenu, 64, 84, "You have unsaved settings ", false); MC_AddWhiteText(quitmenu, 64, 92, " Would you like to ", false); MC_AddWhiteText(quitmenu, 64, 100, " save them now? ", false); - MC_AddWhiteText(quitmenu, 64, 108, " [Y/N/ESC] ", false); quitmenu->selecteditem = (menuoption_t *) - MC_AddConsoleCommand (quitmenu, 64, 116, "Yes", "menu_quit forcesave\n"); - MC_AddConsoleCommand (quitmenu, 144,116, "No", "menu_quit force\n"); - MC_AddConsoleCommand (quitmenu, 224,116, "Cancel", "menupop\n"); + MC_AddConsoleCommand (quitmenu, 64, 116, "Yes", "menu_quit forcesave\n"); + MC_AddConsoleCommand (quitmenu, 144,116, "No", "menu_quit force\n"); + MC_AddConsoleCommand (quitmenu, 224,116, "Cancel", "menupop\n"); MC_AddBox (quitmenu, 56, 76, 25, 5); break;