From 4ba14425ed8631f89129d36de5dfb2cb2ecb527d Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Wed, 16 Jan 2013 23:04:50 -0600 Subject: [PATCH] Add togglemenu to q3_ui controls menu --- code/q3_ui/ui_controls2.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/code/q3_ui/ui_controls2.c b/code/q3_ui/ui_controls2.c index 907ad00f..55d33289 100644 --- a/code/q3_ui/ui_controls2.c +++ b/code/q3_ui/ui_controls2.c @@ -111,16 +111,17 @@ typedef struct #define ID_CHAT2 31 #define ID_CHAT3 32 #define ID_CHAT4 33 +#define ID_TOGGLEMENU 34 // all others -#define ID_FREELOOK 34 -#define ID_INVERTMOUSE 35 -#define ID_ALWAYSRUN 36 -#define ID_AUTOSWITCH 37 -#define ID_MOUSESPEED 38 -#define ID_JOYENABLE 39 -#define ID_JOYTHRESHOLD 40 -#define ID_SMOOTHMOUSE 41 +#define ID_FREELOOK 35 +#define ID_INVERTMOUSE 36 +#define ID_ALWAYSRUN 37 +#define ID_AUTOSWITCH 38 +#define ID_MOUSESPEED 39 +#define ID_JOYENABLE 40 +#define ID_JOYTHRESHOLD 41 +#define ID_SMOOTHMOUSE 42 #define ANIM_IDLE 0 #define ANIM_RUN 1 @@ -205,6 +206,7 @@ typedef struct menuaction_s chat2; menuaction_s chat3; menuaction_s chat4; + menuaction_s togglemenu; menuradiobutton_s joyenable; menuslider_s joythreshold; int section; @@ -261,6 +263,7 @@ static bind_t g_bindings[] = {"messagemode2", "chat - team", ID_CHAT2, ANIM_CHAT, -1, -1, -1, -1}, {"messagemode3", "chat - target", ID_CHAT3, ANIM_CHAT, -1, -1, -1, -1}, {"messagemode4", "chat - attacker", ID_CHAT4, ANIM_CHAT, -1, -1, -1, -1}, + {"togglemenu", "toggle menu", ID_TOGGLEMENU, ANIM_IDLE, K_ESCAPE, -1, -1, -1}, {(char*)NULL, (char*)NULL, 0, 0, -1, -1, -1, -1}, }; @@ -333,6 +336,7 @@ static menucommon_s *g_misc_controls[] = { (menucommon_s *)&s_controls.chat2, (menucommon_s *)&s_controls.chat3, (menucommon_s *)&s_controls.chat4, + (menucommon_s *)&s_controls.togglemenu, NULL, }; @@ -1532,6 +1536,12 @@ static void Controls_MenuInit( void ) s_controls.chat4.generic.ownerdraw = Controls_DrawKeyBinding; s_controls.chat4.generic.id = ID_CHAT4; + s_controls.togglemenu.generic.type = MTYPE_ACTION; + s_controls.togglemenu.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS|QMF_GRAYED|QMF_HIDDEN; + s_controls.togglemenu.generic.callback = Controls_ActionEvent; + s_controls.togglemenu.generic.ownerdraw = Controls_DrawKeyBinding; + s_controls.togglemenu.generic.id = ID_TOGGLEMENU; + s_controls.joyenable.generic.type = MTYPE_RADIOBUTTON; s_controls.joyenable.generic.flags = QMF_SMALLFONT; s_controls.joyenable.generic.x = SCREEN_WIDTH/2; @@ -1614,6 +1624,7 @@ static void Controls_MenuInit( void ) Menu_AddItem( &s_controls.menu, &s_controls.chat2 ); Menu_AddItem( &s_controls.menu, &s_controls.chat3 ); Menu_AddItem( &s_controls.menu, &s_controls.chat4 ); + Menu_AddItem( &s_controls.menu, &s_controls.togglemenu ); Menu_AddItem( &s_controls.menu, &s_controls.back );