]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
hud_panel_quickmenu_time 5 "quickmenu expires after this number of seconds in the...
authorterencehill <piuntn@gmail.com>
Mon, 20 Jan 2014 13:15:54 +0000 (14:15 +0100)
committerterencehill <piuntn@gmail.com>
Mon, 20 Jan 2014 13:15:54 +0000 (14:15 +0100)
_hud_common.cfg
qcsrc/client/autocvars.qh
qcsrc/client/hud.qc

index 6541f0ea3bc79d19c48f257855739b29603e780d..6371e7b8097f4e9201071972abceeb18f07ef432 100644 (file)
@@ -39,6 +39,7 @@ seta hud_panel_engineinfo_framecounter_exponentialmovingaverage_instantupdate_ch
 
 seta hud_panel_quickmenu_file "" "load the quick menu from this file (empty or 0 to disable)"
 seta hud_panel_quickmenu_translatecommands 0 "when the game is translated, translate strings inside commands too (useful for chat commands)"
+seta hud_panel_quickmenu_time 5 "quickmenu expires after this number of seconds in the same page"
 
 // hud panel aliases
 alias hud_panel_radar_rotate "toggle hud_panel_radar_rotation 0 1 2 3 4"
index 0844628ed663288403bc05f665780c586142d1ab..4656c7867219ccaec7e47b493e12818d7f18b549 100644 (file)
@@ -299,6 +299,7 @@ float autocvar_hud_panel_pressedkeys_aspect;
 float autocvar_hud_panel_pressedkeys_attack;
 float autocvar_hud_panel_quickmenu_translatecommands;
 string autocvar_hud_panel_quickmenu_file;
+float autocvar_hud_panel_quickmenu_time;
 float autocvar_hud_panel_racetimer;
 float autocvar_hud_panel_radar;
 float autocvar_hud_panel_radar_foreground_alpha;
index 0906b624d7cadf2c78b8e23cab473ef4a1e21cf5..4b07b9935029d6221ab962b1622f3c4b528f1ced 100644 (file)
@@ -4410,6 +4410,7 @@ float QuickMenu_Buffer_Index;
 string QuickMenu_CurrentSubMenu;
 float QuickMenu_CurrentPage_FirstEntry;
 var float QuickMenu_Entries;
+float QuickMenu_TimeOut;
 void HUD_QuickMenu_load_entry(float i, string s, string s1)
 {
        //printf("^xc80 entry %d: %s, %s\n", i, s, s1);
@@ -4444,6 +4445,7 @@ float HUD_QuickMenu_Buffer_Init()
                if(QuickMenu_Buffer < 0)
                        return false;
                HUD_QuickMenu_Load_DefaultEntries();
+               QuickMenu_TimeOut = time + autocvar_hud_panel_quickmenu_time;
                return true;
        }
 
@@ -4476,6 +4478,7 @@ float HUD_QuickMenu_Buffer_Init()
                        bufstr_set(QuickMenu_Buffer, QuickMenu_Buffer_Size, argv(1)); // command
                }
                ++QuickMenu_Buffer_Size;
+               QuickMenu_TimeOut = time + autocvar_hud_panel_quickmenu_time;
        }
 
        if (QuickMenu_Buffer_Size <= 0)
@@ -4621,6 +4624,7 @@ float HUD_QuickMenu_Page(string target_submenu, float new_page)
                HUD_QuickMenu_Close();
                return 0;
        }
+       QuickMenu_TimeOut = time + autocvar_hud_panel_quickmenu_time;
        return 1;
 }
 
@@ -4824,6 +4828,12 @@ void HUD_QuickMenu(void)
                if(mv_active) return;
                //if(!autocvar_hud_panel_quickmenu) return;
                if(!hud_panel_quickmenu) return;
+
+               if(time > QuickMenu_TimeOut)
+               {
+                       HUD_QuickMenu_Close();
+                       return;
+               }
        }
        else
        {