]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into terencehill/quickmenu
authorterencehill <piuntn@gmail.com>
Tue, 3 Feb 2015 14:58:10 +0000 (15:58 +0100)
committerterencehill <piuntn@gmail.com>
Tue, 3 Feb 2015 16:26:33 +0000 (17:26 +0100)
Conflicts:
qcsrc/client/autocvars.qh
qcsrc/client/hud.qh
qcsrc/client/mapvoting.qc
qcsrc/menu/classes.c

21 files changed:
_hud_common.cfg
_hud_descriptions.cfg
common.it.po
hud_luminos.cfg
hud_luminos_minimal.cfg
hud_luminos_minimal_xhair.cfg
hud_luminos_old.cfg
hud_nexuiz.cfg
keybinds.txt
qcsrc/client/autocvars.qh
qcsrc/client/command/cl_cmd.qc
qcsrc/client/hud.qc
qcsrc/client/hud.qh
qcsrc/client/hud_config.qc
qcsrc/client/main.qc
qcsrc/client/mapvoting.qh
qcsrc/client/scoreboard.qc
qcsrc/client/view.qc
qcsrc/menu/classes.qc
qcsrc/menu/xonotic/dialog_hudpanel_quickmenu.qc [new file with mode: 0644]
qcsrc/menu/xonotic/mainwindow.qc

index 5aa1bbfeea3203469aedb2a4b248d08951d12617..c1f580525cf5b01f360db83f1a19403d72231a9a 100644 (file)
@@ -38,7 +38,13 @@ seta hud_panel_engineinfo_framecounter_exponentialmovingaverage 1 "use an averag
 seta hud_panel_engineinfo_framecounter_exponentialmovingaverage_new_weight 0.1 "weight of latest data point"
 seta hud_panel_engineinfo_framecounter_exponentialmovingaverage_instantupdate_change_threshold 0.5 "threshold for fps change when to update instantly, to make big fps changes update faster"
 
+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 quickmenu "cl_cmd hud quickmenu ${* ?}"
+
 alias hud_panel_radar_rotate "toggle hud_panel_radar_rotation 0 1 2 3 4"
 alias +hud_panel_radar_maximized "cl_cmd hud radar 1"
 alias -hud_panel_radar_maximized "cl_cmd hud radar 0"
index a47884ef05f586d66da20ad330a33b864eb3d017..834e7a0071659f7156b8f0a297272be456b957ab 100644 (file)
@@ -310,3 +310,14 @@ seta hud_panel_buffs_bg_color_team "" "override panel color with team color in t
 seta hud_panel_buffs_bg_alpha "" "if set to something else than \"\" = override default panel background alpha"
 seta hud_panel_buffs_bg_border "" "if set to something else than \"\" = override default size of border around the background"
 seta hud_panel_buffs_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
+
+seta hud_panel_quickmenu "" "enable/disable this panel"
+seta hud_panel_quickmenu_pos "" "position of this base of the panel"
+seta hud_panel_quickmenu_size "" "size of this panel"
+seta hud_panel_quickmenu_bg "" "if set to something else than \"\" = override default background"
+seta hud_panel_quickmenu_bg_color "" "if set to something else than \"\" = override default panel background color"
+seta hud_panel_quickmenu_bg_color_team "" "override panel color with team color in team based games"
+seta hud_panel_quickmenu_bg_alpha "" "if set to something else than \"\" = override default panel background alpha"
+seta hud_panel_quickmenu_bg_border "" "if set to something else than \"\" = override default size of border around the background"
+seta hud_panel_quickmenu_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
+seta hud_panel_quickmenu_align "" "text alignment: 0 left, 0.5 center, 1 right"
index 2afa84f8a6939d3ad0f4bd0426b8198dba46a1c2..cba47047c4b41d608c1de3fb286a33ebe3541853 100644 (file)
@@ -7242,3 +7242,19 @@ msgstr "Abilita pannello"
 #, c-format
 msgid "%s (mutator weapon)"
 msgstr "%s (arma mutatore)"
+
+
+#: command title is translated
+msgid "QMCMD^nice one"
+msgstr "bella"
+
+#: missing translation for this command
+msgid "QMCMD^:-) / nice one"
+msgstr ""
+
+#: fully translated command (title and command are the same)
+msgid "QMCMD^good game"
+msgstr "bella partita"
+
+msgid "QMCMD^Chat"
+msgstr "Parla"
\ No newline at end of file
index 34db2beb663e7cdf118e8cdb3814575a18529ef1..af05997a47bd948cc9c2a401e57b989b0ad4838e 100644 (file)
@@ -24,7 +24,7 @@ seta hud_progressbar_speed_color "1 0.75 0"
 seta hud_progressbar_acceleration_color "0.5 0.75 1"
 seta hud_progressbar_acceleration_neg_color "0.125 0.25 0.5"
 
-seta _hud_panelorder "15 12 9 10 5 6 14 0 7 4 11 2 1 3 8 13 16 "
+seta _hud_panelorder "18 15 12 9 10 5 6 14 0 7 4 11 2 1 3 8 13 16 17 "
 
 seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.010000"
@@ -309,4 +309,15 @@ seta hud_panel_buffs_bg_alpha ""
 seta hud_panel_buffs_bg_border ""
 seta hud_panel_buffs_bg_padding ""
 
+seta hud_panel_quickmenu 1
+seta hud_panel_quickmenu_pos "0.010000 0.410000"
+seta hud_panel_quickmenu_size "0.210000 0.250000"
+seta hud_panel_quickmenu_bg ""
+seta hud_panel_quickmenu_bg_color ""
+seta hud_panel_quickmenu_bg_color_team ""
+seta hud_panel_quickmenu_bg_alpha ""
+seta hud_panel_quickmenu_bg_border ""
+seta hud_panel_quickmenu_bg_padding ""
+seta hud_panel_quickmenu_align "0"
+
 menu_sync
index 39a6fd2eddbcb8547c9be24ca5cc983ad6ac0c7c..6d85c08b07ca8aa94f3472a17e1d95700104704b 100644 (file)
@@ -24,7 +24,7 @@ seta hud_progressbar_speed_color "1 0.75 0"
 seta hud_progressbar_acceleration_color "0.5 0.75 1"
 seta hud_progressbar_acceleration_neg_color "0.125 0.25 0.5"
 
-seta _hud_panelorder "10 3 0 14 6 9 13 4 1 2 11 12 7 5 8 15 16 "
+seta _hud_panelorder "18 10 3 0 14 6 9 13 4 1 2 11 12 7 5 8 15 16 17 "
 
 seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.010000"
@@ -309,4 +309,15 @@ seta hud_panel_buffs_bg_alpha ""
 seta hud_panel_buffs_bg_border ""
 seta hud_panel_buffs_bg_padding ""
 
+seta hud_panel_quickmenu 1
+seta hud_panel_quickmenu_pos "0.010000 0.410000"
+seta hud_panel_quickmenu_size "0.210000 0.250000"
+seta hud_panel_quickmenu_bg ""
+seta hud_panel_quickmenu_bg_color ""
+seta hud_panel_quickmenu_bg_color_team ""
+seta hud_panel_quickmenu_bg_alpha ""
+seta hud_panel_quickmenu_bg_border ""
+seta hud_panel_quickmenu_bg_padding ""
+seta hud_panel_quickmenu_align "0"
+
 menu_sync
index 4b6b7e4a74288362ce8761363045f4d2e8767042..dd8ac3077f280bdc32b19dd2c7844f3cefc02cf3 100644 (file)
@@ -24,7 +24,7 @@ seta hud_progressbar_speed_color "1 0.75 0"
 seta hud_progressbar_acceleration_color "0.5 0.75 1"
 seta hud_progressbar_acceleration_neg_color "0.125 0.25 0.5"
 
-seta _hud_panelorder "15 3 1 2 11 10 0 14 6 9 13 4 12 7 5 8 16 "
+seta _hud_panelorder "18 15 3 1 2 11 10 0 14 6 9 13 4 12 7 5 8 16 17 "
 
 seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.010000"
@@ -309,4 +309,15 @@ seta hud_panel_buffs_bg_alpha ""
 seta hud_panel_buffs_bg_border ""
 seta hud_panel_buffs_bg_padding ""
 
+seta hud_panel_quickmenu 1
+seta hud_panel_quickmenu_pos "0.010000 0.410000"
+seta hud_panel_quickmenu_size "0.210000 0.250000"
+seta hud_panel_quickmenu_bg ""
+seta hud_panel_quickmenu_bg_color ""
+seta hud_panel_quickmenu_bg_color_team ""
+seta hud_panel_quickmenu_bg_alpha ""
+seta hud_panel_quickmenu_bg_border ""
+seta hud_panel_quickmenu_bg_padding ""
+seta hud_panel_quickmenu_align "0"
+
 menu_sync
index 20650899e77de25e7e1e33d485fbeb5beb2e243f..fd5c13b92cb074c5df5222819d066fdde1bcd853 100644 (file)
@@ -24,7 +24,7 @@ seta hud_progressbar_speed_color "1 0.75 0"
 seta hud_progressbar_acceleration_color "0.5 0.75 1"
 seta hud_progressbar_acceleration_neg_color "0.125 0.25 0.5"
 
-seta _hud_panelorder "15 10 9 6 8 14 5 0 4 13 2 7 1 3 11 12 16 "
+seta _hud_panelorder "18 15 10 9 6 8 14 5 0 4 13 2 7 1 3 11 12 16 17 "
 
 seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.010000"
@@ -309,4 +309,15 @@ seta hud_panel_buffs_bg_alpha ""
 seta hud_panel_buffs_bg_border ""
 seta hud_panel_buffs_bg_padding ""
 
+seta hud_panel_quickmenu 1
+seta hud_panel_quickmenu_pos "0.700000 0.460000"
+seta hud_panel_quickmenu_size "0.210000 0.250000"
+seta hud_panel_quickmenu_bg ""
+seta hud_panel_quickmenu_bg_color ""
+seta hud_panel_quickmenu_bg_color_team ""
+seta hud_panel_quickmenu_bg_alpha ""
+seta hud_panel_quickmenu_bg_border ""
+seta hud_panel_quickmenu_bg_padding ""
+seta hud_panel_quickmenu_align "1"
+
 menu_sync
index 2d86881f5fa81c7827cf133718987757fd0da4df..24959fb8b843ec87755c8b903f004e6849dbf260 100644 (file)
@@ -24,7 +24,7 @@ seta hud_progressbar_speed_color "1 0.75 0"
 seta hud_progressbar_acceleration_color "0.5 0.75 1"
 seta hud_progressbar_acceleration_neg_color "0.125 0.25 0.5"
 
-seta _hud_panelorder "15 0 11 8 5 6 14 9 13 7 2 3 1 10 12 4 16 "
+seta _hud_panelorder "18 15 0 11 8 5 6 14 9 13 7 2 3 1 10 12 4 16 17 "
 
 seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.01"
@@ -309,4 +309,15 @@ seta hud_panel_buffs_bg_alpha ""
 seta hud_panel_buffs_bg_border ""
 seta hud_panel_buffs_bg_padding ""
 
+seta hud_panel_quickmenu 1
+seta hud_panel_quickmenu_pos "0.010000 0.380000"
+seta hud_panel_quickmenu_size "0.210000 0.250000"
+seta hud_panel_quickmenu_bg ""
+seta hud_panel_quickmenu_bg_color ""
+seta hud_panel_quickmenu_bg_color_team ""
+seta hud_panel_quickmenu_bg_alpha ""
+seta hud_panel_quickmenu_bg_border ""
+seta hud_panel_quickmenu_bg_padding ""
+seta hud_panel_quickmenu_align "0"
+
 menu_sync
index 189d02eb4ddf0135ab0ed9ededd38db602495949..cda287ebe2d3ef23f3d68bd89ee283000a34346d 100644 (file)
@@ -45,6 +45,7 @@
 "ready"                                 "ready"
 ""                                      ""
 ""                                      "Client"
+"quickmenu"                             "quick menu"
 "+show_info"                            "server info"
 "toggleconsole"                         "enter console"
 "disconnect"                            "disconnect"
index e35bf82dd2759122afc2cf11d46707ef5fc1177b..06f547aa9345df61780d98b7dc3fe5f87cb7edb4 100644 (file)
@@ -312,6 +312,9 @@ bool autocvar_hud_panel_powerups_text;
 int autocvar_hud_panel_pressedkeys;
 float autocvar_hud_panel_pressedkeys_aspect;
 bool autocvar_hud_panel_pressedkeys_attack;
+float autocvar_hud_panel_quickmenu_translatecommands;
+string autocvar_hud_panel_quickmenu_file;
+float autocvar_hud_panel_quickmenu_time;
 bool autocvar_hud_panel_racetimer;
 int autocvar_hud_panel_radar;
 float autocvar_hud_panel_radar_foreground_alpha;
@@ -358,6 +361,8 @@ float autocvar_hud_panel_weapons_timeout_fadebgmin;
 float autocvar_hud_panel_weapons_timeout_fadefgmin;
 float autocvar_hud_panel_weapons_timeout_speed_in = 0.25;
 float autocvar_hud_panel_weapons_timeout_speed_out = 0.75;
+//float autocvar_hud_panel_quickmenu;
+float autocvar_hud_panel_quickmenu_align;
 vector autocvar_hud_progressbar_acceleration_color;
 vector autocvar_hud_progressbar_acceleration_neg_color;
 float autocvar_hud_progressbar_alpha;
index 7b74d2dd7fa56752889ee75f6abb3cdbb1e08115..b3fd3a4928cd87988b499097a68931dd59eb453a 100644 (file)
@@ -240,6 +240,15 @@ void LocalCommand_hud(int request, int argc)
                                        return;
                                }
 
+                               case "quickmenu":
+                               {
+                                       if(HUD_QuickMenu_IsOpened())
+                                               HUD_QuickMenu_Close();
+                                       else
+                                               HUD_QuickMenu_Open(argv(2), argv(3)); // mode, submenu
+                                       return;
+                               }
+
                                case "save":
                                {
                                        if(argv(2))
@@ -285,7 +294,7 @@ void LocalCommand_hud(int request, int argc)
                        print("  'configname' is the name to save to for \"save\" action,\n");
                        print("  'radartoggle' is to control hud_panel_radar_maximized for \"radar\" action,\n");
                        print("  and 'layout' is how to organize the scoreboard columns for the set action.\n");
-                       print("  Full list of commands here: \"configure, save, scoreboard_columns_help, scoreboard_columns_set, radar.\"\n");
+                       print("  Full list of commands here: \"configure, quickmenu, save, scoreboard_columns_help, scoreboard_columns_set, radar.\"\n");
                        return;
                }
        }
index e33b9b0203705e87c0895d687e609dec265492ba..345993dfc31755b39740ac8cd86bbd13c620755f 100644 (file)
@@ -4401,7 +4401,7 @@ void HUD_CenterPrint (void)
        }
 }
 
-// Buffs (#18)
+// Buffs (#17)
 //
 void HUD_Buffs(void)
 {
@@ -4460,6 +4460,755 @@ void HUD_Buffs(void)
        draw_endBoldFont();
 }
 
+// QuickMenu (#18)
+//
+// QUICKMENU_MAXLINES must be <= 10
+#define QUICKMENU_MAXLINES 10
+#define QUICKMENU_MAXENTRIES 256
+string QuickMenu_Command[QUICKMENU_MAXLINES];
+string QuickMenu_Description[QUICKMENU_MAXLINES];
+float QuickMenu_CurrentPage;
+float QuickMenu_IsLastPage;
+// each quickmenu entry (submenu or command) is composed of 2 entries in the buffer
+#define QUICKMENU_BUFFER_MAXENTRIES 2*QUICKMENU_MAXENTRIES
+var float QuickMenu_Buffer = -1;
+float QuickMenu_Buffer_Size;
+float QuickMenu_Buffer_Index;
+string QuickMenu_CurrentSubMenu;
+float QuickMenu_CurrentPage_FirstEntry;
+var float QuickMenu_Entries;
+float QuickMenu_TimeOut;
+// if s1 is not empty s will be displayed as command otherwise as submenu
+void HUD_QuickMenu_load_entry(float i, string s, string s1)
+{
+       //printf("^xc80 entry %d: %s, %s\n", i, s, s1);
+       if (QuickMenu_Description[i])
+               strunzone(QuickMenu_Description[i]);
+       QuickMenu_Description[i] = strzone(s);
+       if (QuickMenu_Command[i])
+               strunzone(QuickMenu_Command[i]);
+       QuickMenu_Command[i] = strzone(s1);
+}
+void HUD_QuickMenu_clear_entry(float i)
+{
+       if (QuickMenu_Description[i])
+               strunzone(QuickMenu_Description[i]);
+       QuickMenu_Description[i] = string_null;
+       if (QuickMenu_Command[i])
+               strunzone(QuickMenu_Command[i]);
+       QuickMenu_Command[i] = string_null;
+}
+
+float HUD_QuickMenu_Page(string target_submenu, float new_page);
+void HUD_QuickMenu_Default(string submenu);
+float HUD_QuickMenu_Open(string mode, string submenu)
+{
+       float fh = -1;
+       string s;
+
+       if(mode == "")
+       {
+               if(autocvar_hud_panel_quickmenu_file == "" || autocvar_hud_panel_quickmenu_file == "0")
+                       mode = "default";
+               else
+                       mode = "file";
+       }
+
+       if(mode == "default")
+       {
+               QuickMenu_Buffer = buf_create();
+               if(QuickMenu_Buffer < 0)
+                       return false;
+
+               HUD_QuickMenu_Default(submenu);
+       }
+       else if(mode == "file")
+       {
+               if(autocvar_hud_panel_quickmenu_file != "")
+               if(autocvar_hud_panel_quickmenu_file != "0")
+                       fh = fopen(autocvar_hud_panel_quickmenu_file, FILE_READ);
+               if(fh < 0)
+               {
+                       printf("Couldn't open file \"%s\"\n", autocvar_hud_panel_quickmenu_file);
+                       return false;
+               }
+
+               QuickMenu_Buffer = buf_create();
+               if(QuickMenu_Buffer < 0)
+               {
+                       fclose(fh);
+                       return false;
+               }
+
+               QuickMenu_Buffer_Size = 0;
+               while((s = fgets(fh)) && QuickMenu_Buffer_Size < QUICKMENU_BUFFER_MAXENTRIES)
+               {
+                       // first skip invalid entries, so we don't check them anymore
+                       float argc;
+                       argc = tokenize_console(s);
+                       if(argc == 0 || argv(0) == "" || substring(argv(0), 0, 2) == "////")
+                               continue;
+                       if(argc == 1)
+                               bufstr_set(QuickMenu_Buffer, QuickMenu_Buffer_Size, strcat("S", argv(0))); // Submenu
+                       else if(argc == 2)
+                       {
+                               if(argv(1) == "")
+                                       continue;
+                               bufstr_set(QuickMenu_Buffer, QuickMenu_Buffer_Size, strcat("T", argv(0))); // command Title
+                               ++QuickMenu_Buffer_Size;
+                               bufstr_set(QuickMenu_Buffer, QuickMenu_Buffer_Size, strcat("C", argv(1))); // command
+                       }
+                       else if(argc == 3)
+                       {
+                               // check for special keywords
+                               float teamplayers = 0, without_me = 0;
+                               switch(argv(2))
+                               {
+                                       case "ALLPLAYERS_BUT_ME":               without_me = 1;
+                                       case "ALLPLAYERS":                              teamplayers = 0; break;
+                                       case "OWNTEAMPLAYERS_BUT_ME":   without_me = 1;
+                                       case "OWNTEAMPLAYERS":                  teamplayers = 1; break;
+                                       case "ENEMYTEAMPLAYERS":                teamplayers = 2; break;
+                                       default: continue;
+                               }
+
+                               if(QuickMenu_Buffer_Size + 3 < QUICKMENU_BUFFER_MAXENTRIES)
+                               {
+                                       bufstr_set(QuickMenu_Buffer, QuickMenu_Buffer_Size, strcat("S", argv(0))); // Submenu
+                                       ++QuickMenu_Buffer_Size;
+                                       bufstr_set(QuickMenu_Buffer, QuickMenu_Buffer_Size, strcat("T", ftos(teamplayers), ftos(without_me))); // command arguments
+                                       ++QuickMenu_Buffer_Size;
+                                       bufstr_set(QuickMenu_Buffer, QuickMenu_Buffer_Size, strcat("P", argv(1))); // command for each player
+                                       ++QuickMenu_Buffer_Size;
+                                       bufstr_set(QuickMenu_Buffer, QuickMenu_Buffer_Size, strcat("S", argv(0))); // Submenu
+                               }
+                       }
+                       ++QuickMenu_Buffer_Size;
+               }
+               fclose(fh);
+       }
+       else
+       {
+               printf("Unrecognized mode %s\n", mode);
+               return false;
+       }
+
+       if (QuickMenu_Buffer_Size <= 0)
+       {
+               buf_del(QuickMenu_Buffer);
+               QuickMenu_Buffer = -1;
+               return false;
+       }
+
+       if(mode == "file")
+               HUD_QuickMenu_Page(submenu, 0);
+       else
+               HUD_QuickMenu_Page("", 0);
+
+       hud_panel_quickmenu = 1;
+       if(autocvar_hud_cursormode)
+               setcursormode(1);
+       hudShiftState = 0;
+
+       QuickMenu_TimeOut = time + autocvar_hud_panel_quickmenu_time;
+       return true;
+}
+
+void HUD_QuickMenu_Buffer_Close()
+{
+       if (QuickMenu_Buffer >= 0)
+       {
+               buf_del(QuickMenu_Buffer);
+               QuickMenu_Buffer = -1;
+               QuickMenu_Buffer_Size = 0;
+       }
+}
+
+void HUD_QuickMenu_Close()
+{
+       if (QuickMenu_CurrentSubMenu)
+               strunzone(QuickMenu_CurrentSubMenu);
+       QuickMenu_CurrentSubMenu = string_null;
+       float i;
+       for (i = 0; i < QUICKMENU_MAXLINES; ++i)
+               HUD_QuickMenu_clear_entry(i);
+       QuickMenu_Entries = 0;
+       hud_panel_quickmenu = 0;
+       mouseClicked = 0;
+       prevMouseClicked = 0;
+       HUD_QuickMenu_Buffer_Close();
+
+       if(autocvar_hud_cursormode)
+       if(!mv_active)
+               setcursormode(0);
+}
+
+// It assumes submenu open tag is already detected
+void HUD_QuickMenu_skip_submenu(string submenu)
+{
+       string s, z_submenu;
+       z_submenu = strzone(submenu);
+       for(++QuickMenu_Buffer_Index ; QuickMenu_Buffer_Index < QuickMenu_Buffer_Size; ++QuickMenu_Buffer_Index)
+       {
+               s = bufstr_get(QuickMenu_Buffer, QuickMenu_Buffer_Index);
+               if(substring(s, 0, 1) != "S")
+                       continue;
+               if(substring(s, 1, -1) == z_submenu) // submenu end
+                       break;
+               HUD_QuickMenu_skip_submenu(substring(s, 1, -1));
+       }
+       strunzone(z_submenu);
+}
+
+float HUD_QuickMenu_IsOpened()
+{
+       return (QuickMenu_Entries > 0);
+}
+
+void HUD_Quickmenu_PlayerListEntries(string cmd, float teamplayers, float without_me);
+float HUD_Quickmenu_PlayerListEntries_Create(string cmd, float teamplayers, float without_me)
+{
+       float i;
+       for(i = 0; i < QUICKMENU_MAXLINES; ++i)
+               HUD_QuickMenu_clear_entry(i);
+       HUD_QuickMenu_Buffer_Close();
+
+       QuickMenu_Buffer = buf_create();
+       if(QuickMenu_Buffer < 0)
+               return false;
+
+       HUD_Quickmenu_PlayerListEntries(cmd, teamplayers, without_me);
+
+       if(QuickMenu_Buffer_Size <= 0)
+       {
+               buf_del(QuickMenu_Buffer);
+               QuickMenu_Buffer = -1;
+               return false;
+       }
+       return true;
+}
+
+// new_page 0 means page 0, new_page != 0 means next page
+float QuickMenu_Buffer_Index_Prev;
+float HUD_QuickMenu_Page(string target_submenu, float new_page)
+{
+       string s = string_null, cmd = string_null, z_submenu;
+
+       if (new_page == 0)
+               QuickMenu_CurrentPage = 0;
+       else
+               ++QuickMenu_CurrentPage;
+       QuickMenu_CurrentPage_FirstEntry = QuickMenu_CurrentPage * (QUICKMENU_MAXLINES - 2);
+
+       z_submenu = strzone(target_submenu);
+       if (QuickMenu_CurrentSubMenu)
+               strunzone(QuickMenu_CurrentSubMenu);
+       QuickMenu_CurrentSubMenu = strzone(z_submenu);
+
+       QuickMenu_IsLastPage = TRUE;
+       QuickMenu_Entries = 0;
+
+       QuickMenu_Buffer_Index = 0;
+       if (z_submenu != "")
+       {
+               // skip everything until the submenu open tag is found
+               for( ; QuickMenu_Buffer_Index < QuickMenu_Buffer_Size; ++QuickMenu_Buffer_Index)
+               {
+                       s = bufstr_get(QuickMenu_Buffer, QuickMenu_Buffer_Index);
+                       if(substring(s, 0, 1) == "S" && substring(s, 1, -1) == z_submenu)
+                       {
+                               // printf("^3 beginning of %s\n", z_submenu);
+                               ++QuickMenu_Buffer_Index;
+                               break;
+                       }
+                       // printf("^1 skipping %s\n", s);
+               }
+               if(QuickMenu_Buffer_Index == QuickMenu_Buffer_Size)
+                       printf("Couldn't find submenu \"%s\"\n", z_submenu);
+       }
+       float entry_num = 0;
+       for( ; QuickMenu_Buffer_Index < QuickMenu_Buffer_Size; ++QuickMenu_Buffer_Index)
+       {
+               s = bufstr_get(QuickMenu_Buffer, QuickMenu_Buffer_Index);
+
+               if(z_submenu != "" && substring(s, 1, -1) == z_submenu)
+               {
+                       // printf("^3 end of %s\n", z_submenu);
+                       break;
+               }
+
+               if(entry_num >= QuickMenu_CurrentPage_FirstEntry)
+               {
+                       ++QuickMenu_Entries;
+                       if(QuickMenu_Entries == QUICKMENU_MAXLINES - 2)
+                               QuickMenu_Buffer_Index_Prev = QuickMenu_Buffer_Index;
+                       else if(QuickMenu_Entries == QUICKMENU_MAXLINES)
+                       {
+                               HUD_QuickMenu_clear_entry(QUICKMENU_MAXLINES - 1);
+                               QuickMenu_Buffer_Index = QuickMenu_Buffer_Index_Prev;
+                               QuickMenu_IsLastPage = FALSE;
+                               break;
+                       }
+               }
+
+               // NOTE: entries are loaded starting from 1, not from 0
+               if(substring(s, 0, 1) == "S") // submenu
+               {
+                       if(entry_num >= QuickMenu_CurrentPage_FirstEntry)
+                               HUD_QuickMenu_load_entry(QuickMenu_Entries, substring(s, 1, -1), "");
+                       HUD_QuickMenu_skip_submenu(substring(s, 1, -1));
+               }
+               else if(entry_num >= QuickMenu_CurrentPage_FirstEntry && substring(s, 0, 1) == "T")
+               {
+                       ++QuickMenu_Buffer_Index;
+                       cmd = bufstr_get(QuickMenu_Buffer, QuickMenu_Buffer_Index);
+                       string command_code = substring(cmd, 0, 1);
+                       if(command_code == "C")
+                               cmd = substring(cmd, 1, -1);
+                       else if(command_code == "P")
+                       {
+                               cmd = substring(cmd, 1, -1);
+                               strunzone(z_submenu);
+                               if(HUD_Quickmenu_PlayerListEntries_Create(cmd, stof(substring(s, 1, 1)), stof(substring(s, 2, 1))))
+                                       return HUD_QuickMenu_Page("", 0);
+                               HUD_QuickMenu_Close();
+                               return 0;
+                       }
+                       HUD_QuickMenu_load_entry(QuickMenu_Entries, substring(s, 1, -1), cmd);
+               }
+
+               ++entry_num;
+       }
+       strunzone(z_submenu);
+       if (QuickMenu_Entries == 0)
+       {
+               HUD_QuickMenu_Close();
+               return 0;
+       }
+       QuickMenu_TimeOut = time + autocvar_hud_panel_quickmenu_time;
+       return 1;
+}
+
+float HUD_QuickMenu_ActionForNumber(float num)
+{
+       if (!QuickMenu_IsLastPage)
+       {
+               if (num < 0 || num >= QUICKMENU_MAXLINES)
+                       return 0;
+               if (num == QUICKMENU_MAXLINES - 1)
+                       return 0;
+               if (num == 0)
+               {
+                       HUD_QuickMenu_Page(QuickMenu_CurrentSubMenu, +1);
+                       return 0;
+               }
+       } else if (num <= 0 || num > QuickMenu_Entries)
+               return 0;
+
+       if (QuickMenu_Command[num] != "")
+       {
+               localcmd(strcat("\n", QuickMenu_Command[num], "\n"));
+               return 1;
+       }
+       if (QuickMenu_Description[num] != "")
+               HUD_QuickMenu_Page(QuickMenu_Description[num], 0);
+       return 0;
+}
+
+float HUD_QuickMenu_InputEvent(float bInputType, float nPrimary, float nSecondary)
+{
+       // we only care for keyboard events
+       if(bInputType == 2)
+               return false;
+
+       if(!HUD_QuickMenu_IsOpened() || autocvar__hud_configure || mv_active)
+               return false;
+
+       if(bInputType == 3)
+       {
+               mousepos_x = nPrimary;
+               mousepos_y = nSecondary;
+               return true;
+       }
+
+       // allow console bind to work
+       string con_keys;
+       float keys;
+       con_keys = findkeysforcommand("toggleconsole", 0);
+       keys = tokenize(con_keys); // findkeysforcommand returns data for this
+
+       float hit_con_bind = 0, i;
+       for (i = 0; i < keys; ++i)
+       {
+               if(nPrimary == stof(argv(i)))
+                       hit_con_bind = 1;
+       }
+
+       if(bInputType == 0) {
+               if(nPrimary == K_ALT) hudShiftState |= S_ALT;
+               if(nPrimary == K_CTRL) hudShiftState |= S_CTRL;
+               if(nPrimary == K_SHIFT) hudShiftState |= S_SHIFT;
+       }
+       else if(bInputType == 1) {
+               if(nPrimary == K_ALT) hudShiftState -= (hudShiftState & S_ALT);
+               if(nPrimary == K_CTRL) hudShiftState -= (hudShiftState & S_CTRL);
+               if(nPrimary == K_SHIFT) hudShiftState -= (hudShiftState & S_SHIFT);
+       }
+
+       if(nPrimary == K_ESCAPE)
+       {
+               if (bInputType == 1)
+                       return true;
+               HUD_QuickMenu_Close();
+       }
+       else if(nPrimary >= '0' && nPrimary <= '9')
+       {
+               if (bInputType == 1)
+                       return true;
+               HUD_QuickMenu_ActionForNumber(stof(chr2str(nPrimary)));
+       }
+       if(nPrimary == K_MOUSE1)
+       {
+               if(bInputType == 0) // key pressed
+                       mouseClicked |= S_MOUSE1;
+               else if(bInputType == 1) // key released
+                       mouseClicked -= (mouseClicked & S_MOUSE1);
+       }
+       else if(nPrimary == K_MOUSE2)
+       {
+               if(bInputType == 0) // key pressed
+                       mouseClicked |= S_MOUSE2;
+               else if(bInputType == 1) // key released
+                       mouseClicked -= (mouseClicked & S_MOUSE2);
+       }
+       else if(hit_con_bind)
+               return false;
+
+       return true;
+}
+void HUD_QuickMenu_Mouse()
+{
+       if(mv_active) return;
+
+       if(!mouseClicked)
+       if(prevMouseClicked & S_MOUSE2)
+       {
+               HUD_QuickMenu_Close();
+               return;
+       }
+
+       if(!autocvar_hud_cursormode)
+       {
+               mousepos = mousepos + getmousepos() * autocvar_menu_mouse_speed;
+
+               mousepos_x = bound(0, mousepos_x, vid_conwidth);
+               mousepos_y = bound(0, mousepos_y, vid_conheight);
+       }
+
+       HUD_Panel_UpdateCvars()
+
+       if(panel_bg_padding)
+       {
+               panel_pos += '1 1 0' * panel_bg_padding;
+               panel_size -= '2 2 0' * panel_bg_padding;
+       }
+
+       float first_entry_pos, entries_height;
+       vector fontsize;
+       fontsize = '1 1 0' * (panel_size_y / QUICKMENU_MAXLINES);
+       first_entry_pos = panel_pos_y + ((QUICKMENU_MAXLINES - QuickMenu_Entries) * fontsize_y) / 2;
+       entries_height = panel_size_y - ((QUICKMENU_MAXLINES - QuickMenu_Entries) * fontsize_y);
+
+       if (mousepos_x >= panel_pos_x && mousepos_y >= first_entry_pos && mousepos_x <= panel_pos_x + panel_size_x && mousepos_y <= first_entry_pos + entries_height)
+       {
+               float entry_num;
+               entry_num = floor((mousepos_y - first_entry_pos) / fontsize_y);
+               if (QuickMenu_IsLastPage || entry_num != QUICKMENU_MAXLINES - 2)
+               {
+                       panel_pos_y = first_entry_pos + entry_num * fontsize_y;
+                       vector color;
+                       if(mouseClicked & S_MOUSE1)
+                               color = '0.5 1 0.5';
+                       else if(hudShiftState & S_CTRL)
+                               color = '1 1 0.3';
+                       else
+                               color = '1 1 1';
+                       drawfill(panel_pos, eX * panel_size_x + eY * fontsize_y, color, .2, DRAWFLAG_NORMAL);
+
+                       if(!mouseClicked && (prevMouseClicked & S_MOUSE1))
+                       {
+                               float f;
+                               if (entry_num < QUICKMENU_MAXLINES - 1)
+                                       f = HUD_QuickMenu_ActionForNumber(entry_num + 1);
+                               else
+                                       f = HUD_QuickMenu_ActionForNumber(0);
+                               if(f && !(hudShiftState & S_CTRL))
+                                       HUD_QuickMenu_Close();
+                       }
+               }
+       }
+
+       const vector cursorsize = '32 32 0';
+       drawpic(mousepos, strcat("gfx/menu/", autocvar_menu_skin, "/cursor.tga"), cursorsize, '1 1 1', 0.8, DRAWFLAG_NORMAL);
+
+       prevMouseClicked = mouseClicked;
+}
+void HUD_QuickMenu_DrawEntry(vector pos, string s, vector fontsize)
+{
+       string entry;
+       float offset;
+       entry = textShortenToWidth(s, panel_size_x, fontsize, stringwidth_colors);
+       if (autocvar_hud_panel_quickmenu_align > 0)
+       {
+               offset = (panel_size_x - stringwidth_colors(entry, fontsize)) * min(autocvar_hud_panel_quickmenu_align, 1);
+               drawcolorcodedstring(pos + eX * offset, entry, fontsize, panel_fg_alpha, DRAWFLAG_ADDITIVE);
+       }
+       else
+               drawcolorcodedstring(pos, entry, fontsize, panel_fg_alpha, DRAWFLAG_ADDITIVE);
+}
+void HUD_QuickMenu(void)
+{
+       if(!autocvar__hud_configure)
+       {
+               if (hud_configure_prev && hud_configure_prev != -1)
+                       HUD_QuickMenu_Close();
+
+               if(!hud_draw_maximized) return;
+               if(mv_active) return;
+               //if(!autocvar_hud_panel_quickmenu) return;
+               if(!hud_panel_quickmenu) return;
+
+               if(time > QuickMenu_TimeOut)
+               {
+                       HUD_QuickMenu_Close();
+                       return;
+               }
+       }
+       else
+       {
+               if(!HUD_QuickMenu_IsOpened())
+               {
+                       QuickMenu_Entries = 1;
+                       HUD_QuickMenu_load_entry(QuickMenu_Entries, sprintf(_("Submenu%d"), QuickMenu_Entries), "");
+                       ++QuickMenu_Entries;
+                       HUD_QuickMenu_load_entry(QuickMenu_Entries, sprintf(_("Submenu%d"), QuickMenu_Entries), "");
+                       ++QuickMenu_Entries;
+                       // although real command doesn't matter here, it must not be empty
+                       // otherwise the entry is displayed like a submenu
+                       for (; QuickMenu_Entries < QUICKMENU_MAXLINES - 1; ++QuickMenu_Entries)
+                               HUD_QuickMenu_load_entry(QuickMenu_Entries, sprintf(_("Command%d"), QuickMenu_Entries), "-");
+                       ++QuickMenu_Entries;
+                       HUD_QuickMenu_clear_entry(QuickMenu_Entries);
+                       QuickMenu_IsLastPage = FALSE;
+               }
+       }
+
+       HUD_Panel_UpdateCvars();
+
+       HUD_Panel_DrawBg(1);
+
+       if(panel_bg_padding)
+       {
+               panel_pos += '1 1 0' * panel_bg_padding;
+               panel_size -= '2 2 0' * panel_bg_padding;
+       }
+
+       float i;
+       vector fontsize;
+       string color;
+       fontsize = '1 1 0' * (panel_size_y / QUICKMENU_MAXLINES);
+
+       if (!QuickMenu_IsLastPage)
+       {
+               color = "^5";
+               HUD_QuickMenu_DrawEntry(panel_pos + eY * (panel_size_y - fontsize_y), sprintf("%d: %s%s", 0, color, _("Continue...")), fontsize);
+       }
+       else
+               panel_pos_y += ((QUICKMENU_MAXLINES - QuickMenu_Entries) * fontsize_y) / 2;
+
+       for (i = 1; i <= QuickMenu_Entries; ++i) {
+               if (QuickMenu_Description[i] == "")
+                       break;
+               if (QuickMenu_Command[i] == "")
+                       color = "^4";
+               else
+                       color = "^3";
+               HUD_QuickMenu_DrawEntry(panel_pos, sprintf("%d: %s%s", i, color, QuickMenu_Description[i]), fontsize);
+               panel_pos_y += fontsize_y;
+       }
+}
+
+
+#define QUICKMENU_SMENU(submenu,eng_submenu) { \
+       if(target_submenu == eng_submenu && target_submenu_found) \
+               return; /* target_submenu entries are now loaded, exit */ \
+       if(QuickMenu_Buffer_Size < QUICKMENU_BUFFER_MAXENTRIES) \
+               bufstr_set(QuickMenu_Buffer, QuickMenu_Buffer_Size, strcat("S", submenu)); \
+       ++QuickMenu_Buffer_Size; \
+       if(target_submenu == eng_submenu && !target_submenu_found) { \
+               QuickMenu_Buffer_Size = 0; /* enable load of next entries */ \
+               target_submenu_found = TRUE; \
+       } \
+}
+
+#define QUICKMENU_ENTRY(title,command) { \
+       if(QuickMenu_Buffer_Size + 1 < QUICKMENU_BUFFER_MAXENTRIES) \
+       { \
+               bufstr_set(QuickMenu_Buffer, QuickMenu_Buffer_Size, strcat("T", title)); \
+               ++QuickMenu_Buffer_Size; \
+               bufstr_set(QuickMenu_Buffer, QuickMenu_Buffer_Size, strcat("C", command)); \
+       } \
+       ++QuickMenu_Buffer_Size; \
+}
+
+#define QUICKMENU_SMENU_PL(submenu,eng_submenu,command,teamplayers,without_me) { \
+       if(QuickMenu_Buffer_Size + 3 < QUICKMENU_BUFFER_MAXENTRIES) {\
+               QUICKMENU_SMENU(submenu,eng_submenu) \
+               bufstr_set(QuickMenu_Buffer, QuickMenu_Buffer_Size, strcat("T", ftos(teamplayers), ftos(without_me))); \
+               ++QuickMenu_Buffer_Size; \
+               bufstr_set(QuickMenu_Buffer, QuickMenu_Buffer_Size, strcat("P", command)); \
+               ++QuickMenu_Buffer_Size; \
+               QUICKMENU_SMENU(submenu,eng_submenu) \
+       } \
+}
+
+
+
+// useful to Translate a string inside the Command
+#define QUICKMENU_ENTRY_TC(title,command,text,translated_text) {\
+       if(prvm_language == "en") \
+               QUICKMENU_ENTRY(title, sprintf(command, text)) \
+       else if(!autocvar_hud_panel_quickmenu_translatecommands || translated_text == text) \
+               QUICKMENU_ENTRY(strcat("(en)", title), sprintf(command, text)) \
+       else \
+               QUICKMENU_ENTRY(strcat("(", prvm_language, ")", title), sprintf(command, translated_text)) \
+}
+
+void HUD_Quickmenu_PlayerListEntries(string cmd, float teamplayers, float without_me)
+{
+       entity pl;
+       if(teamplayers && !team_count)
+               return;
+
+       for(pl = players.sort_next; pl; pl = pl.sort_next)
+       {
+               if(teamplayers == 1 && (pl.team != myteam || pl.team == NUM_SPECTATOR)) // only own team players
+                       continue;
+               if(teamplayers == 2 && (pl.team == myteam || pl.team == NUM_SPECTATOR)) // only enemy team players
+                       continue;
+               if(without_me && pl.sv_entnum == player_localnum)
+                       continue;
+               QUICKMENU_ENTRY(GetPlayerName(pl.sv_entnum), sprintf(cmd, GetPlayerName(pl.sv_entnum)))
+       }
+
+       return;
+}
+
+
+// Specifying target_submenu, this function only loads entries inside target_submenu
+// NOTE: alternatively we could have loaded the whole default quickmenu and
+// then called HUD_QuickMenu_Page(target_submenu, 0);
+// but this sytem is more reliable since we can always refer to target_submenu
+// with the English title even if a translation is active
+void HUD_QuickMenu_Default(string target_submenu)
+{
+       float target_submenu_found = FALSE;
+       if(target_submenu != "")
+               QuickMenu_Buffer_Size = QUICKMENU_BUFFER_MAXENTRIES; // forbids load of next entries until target_submenu
+
+       QUICKMENU_SMENU(CTX(_("QMCMD^Chat")), "Chat")
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^nice one")), "say %s", ":-) / nice one", CTX(_("QMCMD^:-) / nice one")))
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^good game")), "say %s", "good game", CTX(_("QMCMD^good game")))
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^hi / good luck")), "say %s", "hi / good luck and have fun", CTX(_("QMCMD^hi / good luck and have fun")))
+       QUICKMENU_SMENU(CTX(_("QMCMD^Chat")), "Chat")
+
+       if(teamplay)
+       {
+       QUICKMENU_SMENU(CTX(_("QMCMD^Team chat")), "Team chat")
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^quad soon")), "say_team %s", "quad soon", CTX(_("QMCMD^quad soon")))
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^free item, icon")), "say_team %s; g_waypointsprite_team_here_p", "free item %x^7 (l:%y^7)", CTX(_("QMCMD^free item %x^7 (l:%y^7)")))
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^took item, icon")), "say_team %s; g_waypointsprite_team_here", "took item (l:%l^7)", CTX(_("QMCMD^took item (l:%l^7)")))
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^negative")), "say_team %s", "negative", CTX(_("QMCMD^negative")))
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^positive")), "say_team %s", "positive", CTX(_("QMCMD^positive")))
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^need help, icon")), "say_team %s; g_waypointsprite_team_helpme; cmd voice needhelp", "need help (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)", CTX(_("QMCMD^need help (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)")))
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^enemy seen, icon")), "say_team %s; g_waypointsprite_team_danger_p; cmd voice incoming", "enemy seen (l:%y^7)", CTX(_("QMCMD^enemy seen (l:%y^7)")))
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^flag seen, icon")), "say_team %s; g_waypointsprite_team_here_p; cmd voice seenflag", "flag seen (l:%y^7)", CTX(_("QMCMD^flag seen (l:%y^7)")))
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^defending, icon")), "say_team %s; g_waypointsprite_team_here", "defending (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)", CTX(_("QMCMD^defending (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)")))
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^roaming, icon")), "say_team %s; g_waypointsprite_team_here", "roaming (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)", CTX(_("QMCMD^roaming (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)")))
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^attacking, icon")), "say_team %s; g_waypointsprite_team_here", "attacking (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)", CTX(_("QMCMD^attacking (l:%l^7) (h:%h^7 a:%a^7 w:%w^7)")))
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^killed flag, icon")), "say_team %s; g_waypointsprite_team_here_p", "killed flagcarrier (l:%y^7)", CTX(_("QMCMD^killed flagcarrier (l:%y^7)")))
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^dropped flag, icon")), "say_team %s; g_waypointsprite_team_here_d", "dropped flag (l:%d^7)", CTX(_("QMCMD^dropped flag (l:%d^7)")))
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^drop gun, icon")), "say_team %s; g_waypointsprite_team_here; wait; dropweapon", "dropped gun %w^7 (l:%l^7)", CTX(_("QMCMD^dropped gun %w^7 (l:%l^7)")))
+               QUICKMENU_ENTRY_TC(CTX(_("QMCMD^drop flag/key, icon")), "say_team %s; g_waypointsprite_team_here; wait; +use", "dropped flag/key %w^7 (l:%l^7)", CTX(_("QMCMD^dropped flag/key %w^7 (l:%l^7)")))
+       QUICKMENU_SMENU(CTX(_("QMCMD^Team chat")), "Team chat")
+       }
+
+       QUICKMENU_SMENU_PL(CTX(_("QMCMD^Send private message to")), "Send private message to", "commandmode tell \"%s\" ^7", 0, 1)
+
+       QUICKMENU_SMENU(CTX(_("QMCMD^Settings")), "Settings")
+               QUICKMENU_SMENU(CTX(_("QMCMD^View/HUD settings")), "View/HUD settings")
+                       QUICKMENU_ENTRY(CTX(_("QMCMD^1st/3rd person view")), "toggle chase_active")
+                       QUICKMENU_ENTRY(CTX(_("QMCMD^Player models like mine on/off")), "toggle cl_forceplayermodels")
+                       QUICKMENU_ENTRY(CTX(_("QMCMD^Names above players on/off")), "toggle hud_shownames")
+                       QUICKMENU_ENTRY(CTX(_("QMCMD^Crosshair per weapon on/off")), "toggle crosshair_per_weapon")
+                       QUICKMENU_ENTRY(CTX(_("QMCMD^FPS on/off")), "toggle hud_panel_engineinfo")
+                       QUICKMENU_ENTRY(CTX(_("QMCMD^Net graph on/off")), "toggle shownetgraph")
+               QUICKMENU_SMENU(CTX(_("QMCMD^View/HUD settings")), "View/HUD settings")
+
+               QUICKMENU_SMENU(CTX(_("QMCMD^Sound settings")), "Sound settings")
+                       QUICKMENU_ENTRY(CTX(_("QMCMD^Hit sound on/off")), "toggle cl_hitsound")
+                       QUICKMENU_ENTRY(CTX(_("QMCMD^Chat sound on/off")), "toggle cl_chatsound")
+               QUICKMENU_SMENU(CTX(_("QMCMD^Sound settings")), "Sound settings")
+
+               if(spectatee_status > 0)
+               {
+               QUICKMENU_SMENU(CTX(_("QMCMD^Spectator camera")), "Spectator camera")
+                       QUICKMENU_ENTRY(CTX(_("QMCMD^1st person")), "chase_active 0; -use")
+                       QUICKMENU_ENTRY(CTX(_("QMCMD^3rd person around player")), "chase_active 1; +use")
+                       QUICKMENU_ENTRY(CTX(_("QMCMD^3rd person behind")), "chase_active 1; -use")
+               QUICKMENU_SMENU(CTX(_("QMCMD^Spectator camera")), "Spectator camera")
+               }
+
+               if(spectatee_status == -1)
+               {
+               QUICKMENU_SMENU(CTX(_("QMCMD^Observer camera")), "Observer camera")
+                       QUICKMENU_ENTRY(CTX(_("QMCMD^Increase speed")), "weapnext")
+                       QUICKMENU_ENTRY(CTX(_("QMCMD^Decrease speed")), "weapprev")
+                       QUICKMENU_ENTRY(CTX(_("QMCMD^Wall collision off")), "+use")
+                       QUICKMENU_ENTRY(CTX(_("QMCMD^Wall collision on")), "-use")
+               QUICKMENU_SMENU(CTX(_("QMCMD^Observer camera")), "Observer camera")
+               }
+
+               QUICKMENU_ENTRY(CTX(_("QMCMD^toggle fullscreen")), "toggle vid_fullscreen; vid_restart")
+               if(prvm_language != "en")
+               QUICKMENU_ENTRY(CTX(_("QMCMD^Translate chat messages on/off")), "toggle hud_panel_quickmenu_translatecommands")
+       QUICKMENU_SMENU(CTX(_("QMCMD^Settings")), "Settings")
+
+       QUICKMENU_SMENU(CTX(_("QMCMD^Call a vote")), "Call a vote")
+               QUICKMENU_ENTRY(CTX(_("QMCMD^Restart the map")), "vcall restart")
+               QUICKMENU_ENTRY(CTX(_("QMCMD^End match")), "vcall endmatch")
+               if(getstatf(STAT_TIMELIMIT) > 0)
+               {
+               QUICKMENU_ENTRY(CTX(_("QMCMD^Reduce match time")), "vcall reducematchtime")
+               QUICKMENU_ENTRY(CTX(_("QMCMD^Extend match time")), "vcall extendmatchtime")
+               }
+               if(teamplay)
+               QUICKMENU_ENTRY(CTX(_("QMCMD^Shuffle teams")), "vcall shuffleteams")
+       QUICKMENU_SMENU(CTX(_("QMCMD^Call a vote")), "Call a vote")
+
+       if(target_submenu != "" && !target_submenu_found)
+       {
+               printf("Couldn't find submenu \"%s\"\n", target_submenu);
+               if(prvm_language != "en")
+                       printf("^3Warning: submenu must be in English\n", target_submenu);
+               QuickMenu_Buffer_Size = 0;
+       }
+}
+#undef QUICKMENU_SMENU
+#undef QUICKMENU_ENTRY
+#undef QUICKMENU_ENTRY_TC
+
+
 
 /*
 ==================
@@ -4608,6 +5357,8 @@ void HUD_Main (void)
                (panel = HUD_PANEL(RADAR)).panel_draw();
        if(autocvar__con_chat_maximized)
                (panel = HUD_PANEL(CHAT)).panel_draw();
+       if(hud_panel_quickmenu)
+               (panel = HUD_PANEL(QUICKMENU)).panel_draw();
 
        HUD_Configure_PostDraw();
 
index 16a7645fd991819a55fd1b8de4349d318ee15f30..4e0588fa1b1bd343382f43fafdbf92f81c0369f0 100644 (file)
@@ -14,6 +14,7 @@ string hud_panelorder_prev;
 
 float hud_draw_maximized;
 float hud_panel_radar_maximized;
+float hud_panel_quickmenu;
 float chat_panel_modified;
 float radar_panel_modified;
 
@@ -103,6 +104,7 @@ float current_player;
 
 float GetPlayerColorForce(int i);
 
+float mv_active;
 
 #define HUD_PANELS(HUD_PANEL)                                                                                                                                                                          \
        HUD_PANEL(WEAPONS      , HUD_Weapons      , weapons)                                                                                                                    \
@@ -122,7 +124,9 @@ float GetPlayerColorForce(int i);
        HUD_PANEL(INFOMESSAGES , HUD_InfoMessages , infomessages)                                                                                                               \
        HUD_PANEL(PHYSICS      , HUD_Physics      , physics)                                                                                                                    \
        HUD_PANEL(CENTERPRINT  , HUD_CenterPrint  , centerprint)                                                                                                                \
-       HUD_PANEL(BUFFS        , HUD_Buffs        , buffs)
+       HUD_PANEL(BUFFS        , HUD_Buffs        , buffs) \
+       HUD_PANEL(QUICKMENU    , HUD_QuickMenu    , quickmenu) \
+       // always add new panels to the end of list
 
 #define HUD_PANEL(NAME, draw_func, name)                                                                                                                                                       \
        int HUD_PANEL_##NAME;                                                                                                                                                                                   \
index 898f3eb56f00f9cf6bb1195ba6d31e7a41035e74..2f755717f98a6f9747fcbcd0667b2b04cb87908c 100644 (file)
@@ -204,6 +204,9 @@ void HUD_Panel_ExportCfg(string cfgname)
                                        HUD_Write_PanelCvar_q("_fade_subsequent_minfontsize");
                                        HUD_Write_PanelCvar_q("_fade_minfontsize");
                                        break;
+                               case HUD_PANEL_QUICKMENU:
+                                       HUD_Write_PanelCvar_q("_align");
+                                       break;
                        }
                        HUD_Write("\n");
                }
index 13f9545faab60a7c944d4d45b192dc6e16ca8a46..545786a2bc3d10bef19da391480f5323fbb3bf55 100644 (file)
@@ -54,7 +54,7 @@ void WaypointSprite_Load();
 void ConsoleCommand_macro_init();
 void CSQC_Init(void)
 {
-       prvm_language = cvar_string("prvm_language");
+       prvm_language = strzone(cvar_string("prvm_language"));
 
 #ifdef WATERMARK
        dprintf("^4CSQC Build information: ^1%s\n", WATERMARK);
@@ -335,6 +335,9 @@ float CSQC_InputEvent(float bInputType, float nPrimary, float nSecondary)
        if (HUD_Panel_InputEvent(bInputType, nPrimary, nSecondary))
                return true;
 
+       if (HUD_QuickMenu_InputEvent(bInputType, nPrimary, nSecondary))
+               return true;
+
        if (MapVote_InputEvent(bInputType, nPrimary, nSecondary))
                return true;
 
index 8a4133e50ab798a42708012525c11be11da895f9..2c3c58eef096f4a9fbdc7b23c7fa848351e0cb10 100644 (file)
@@ -3,7 +3,6 @@
 
 int mv_num_maps;
 
-float mv_active;
 string mv_maps[MAPVOTE_COUNT];
 string mv_pics[MAPVOTE_COUNT];
 string mv_pk3[MAPVOTE_COUNT];
index c6d871807f2e7c190af068a4ff192b760d3de57b..e36dc96fa2e724b84f567c6720dcfd6a7b86202a 100644 (file)
@@ -953,6 +953,8 @@ vector HUD_Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_siz
 float HUD_WouldDrawScoreboard() {
        if (autocvar__hud_configure)
                return 0;
+       else if (HUD_QuickMenu_IsOpened())
+               return 0;
        else if (scoreboard_showscores)
                return 1;
        else if (intermission == 1)
index ee8ef320ae4643740f8bb275f848b9436914462f..c1bd50d1d0d5846aa0c079e75ee6069e762606e1 100644 (file)
@@ -1139,7 +1139,7 @@ void CSQC_UpdateView(float w, float h)
        }
 
        // do lockview after event chase camera so that it still applies whenever necessary.
-       if(autocvar_cl_lockview || (!autocvar_hud_cursormode && (autocvar__hud_configure && spectatee_status <= 0 || intermission > 1)))
+       if(autocvar_cl_lockview || (!autocvar_hud_cursormode && (autocvar__hud_configure && spectatee_status <= 0 || intermission > 1 || HUD_QuickMenu_IsOpened())))
        {
                setproperty(VF_ORIGIN, freeze_org);
                setproperty(VF_ANGLES, freeze_ang);
@@ -1774,8 +1774,10 @@ void CSQC_UpdateView(float w, float h)
 
        if(autocvar__hud_configure)
                HUD_Panel_Mouse();
+       else if(HUD_QuickMenu_IsOpened())
+               HUD_QuickMenu_Mouse();
 
-    if(hud && !intermission)
+       if(hud && !intermission)
     {
         if(hud == HUD_SPIDERBOT)
             CSQC_SPIDER_HUD();
index 9b4bb4dab301037d5a46ea809ec69a4a342f2de5..9ca552eebf4a1dd42ebbbf730e3e596c4a555ad2 100644 (file)
 #include "xonotic/dialog_hudpanel_physics.qc"
 #include "xonotic/dialog_hudpanel_centerprint.qc"
 #include "xonotic/dialog_hudpanel_buffs.qc"
+#include "xonotic/dialog_hudpanel_quickmenu.qc"
 #include "xonotic/slider_picmip.qc"
 #include "xonotic/slider_particles.qc"
 #include "xonotic/slider_sbfadetime.qc"
diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_quickmenu.qc b/qcsrc/menu/xonotic/dialog_hudpanel_quickmenu.qc
new file mode 100644 (file)
index 0000000..16c3337
--- /dev/null
@@ -0,0 +1,29 @@
+#ifdef INTERFACE
+CLASS(XonoticHUDQuickMenuDialog) EXTENDS(XonoticRootDialog)
+       METHOD(XonoticHUDQuickMenuDialog, fill, void(entity))
+       ATTRIB(XonoticHUDQuickMenuDialog, title, string, _("Quick Menu Panel"))
+       ATTRIB(XonoticHUDQuickMenuDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
+       ATTRIB(XonoticHUDQuickMenuDialog, intendedWidth, float, 0.4)
+       ATTRIB(XonoticHUDQuickMenuDialog, rows, float, 15)
+       ATTRIB(XonoticHUDQuickMenuDialog, columns, float, 4)
+       ATTRIB(XonoticHUDQuickMenuDialog, name, string, "HUDquickmenu")
+ENDCLASS(XonoticHUDQuickMenuDialog)
+#endif
+
+#ifdef IMPLEMENTATION
+void XonoticHUDQuickMenuDialog_fill(entity me)
+{
+       entity e;
+       string panelname = "quickmenu";
+
+       DIALOG_HUDPANEL_COMMON_NOTOGGLE();
+
+       me.TR(me);
+               me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Text alignment:")));
+       me.TR(me);
+               me.TDempty(me, 0.2);
+                       me.TD(me, 1, 3.8/3, e = makeXonoticRadioButton(3, "hud_panel_quickmenu_align", "0", _("Left")));
+                       me.TD(me, 1, 3.8/3, e = makeXonoticRadioButton(3, "hud_panel_quickmenu_align", "0.5", _("Center")));
+                       me.TD(me, 1, 3.8/3, e = makeXonoticRadioButton(3, "hud_panel_quickmenu_align", "1", _("Right")));
+}
+#endif
index 45a0f93dcc571fee3b676a596c8348f37bfadd76..280ab1d322c7ed80af3870ae9bde3402ccc029b5 100644 (file)
@@ -134,6 +134,9 @@ void MainWindow_configureMainWindow(entity me)
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
+       i = spawnXonoticHUDQuickMenuDialog();
+       i.configureDialog(i);
+       me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
        // dialogs used by settings
        me.userbindEditDialog = i = spawnXonoticUserbindEditDialog();