#define QuickMenu_Buffer_Set(tag, string) bufstr_set(QuickMenu_Buffer, QuickMenu_Buffer_Size, strcat(tag, string))
#define QuickMenu_Buffer_Get() bufstr_get(QuickMenu_Buffer, QuickMenu_Buffer_Index)
+#define QUICKMENU_ENTRY(title,command) { \
+ if(QuickMenu_Buffer_Size + 1 < QUICKMENU_BUFFER_MAXENTRIES) \
+ { \
+ QuickMenu_Buffer_Set(QM_TAG_TITLE, title); \
+ ++QuickMenu_Buffer_Size; \
+ QuickMenu_Buffer_Set(QM_TAG_COMMAND, command); \
+ } \
+ ++QuickMenu_Buffer_Size; \
+}
+
+// special entries are shown with a different color
+#define QUICKMENU_ENTRY_SPECIAL(title, command) QUICKMENU_ENTRY(title, strcat("\n", command))
+
+
void QuickMenu_TimeOut_Set()
{
QuickMenu_TimeOut = ((autocvar_hud_panel_quickmenu_time > 0) ? time + autocvar_hud_panel_quickmenu_time : 0);
mode = "file";
}
+ if(mode == "default")
+ {
+ if (autocvar_hud_panel_quickmenu_server_is_default && autocvar__hud_panel_quickmenu_file_from_server != "")
+ {
+ mode = "file";
+ file = autocvar__hud_panel_quickmenu_file_from_server;
+ }
+ }
+
if(mode == "file")
{
if(file == "" || file == "0")
++QuickMenu_Buffer_Size;
}
fclose(fh);
+
+ // forcedly add this entry
+ if (autocvar_hud_panel_quickmenu_server_is_default && autocvar__hud_panel_quickmenu_file_from_server != "")
+ {
+ string prev_value = cvar_string("hud_panel_quickmenu_server_is_default");
+ QUICKMENU_ENTRY_SPECIAL(_("Standard quick menu"), sprintf("hud_panel_quickmenu_server_is_default 0; quickmenu; wait; quickmenu; wait; hud_panel_quickmenu_server_is_default \"%s\"", prev_value))
+ }
}
else
{
color = "^4";
else
{
- color = "^3";
+ if (substring(QuickMenu_Page_Command[i], 0, 1) == "\n")
+ color = "^6"; // special command
+ else
+ color = "^3";
if(QuickMenu_Page_Command_Type[i] == 1) // toggle command
{
int end = strstrofs(QuickMenu_Page_Command[i], ";", 0);
} \
}
-#define QUICKMENU_ENTRY(title,command) { \
- if(QuickMenu_Buffer_Size + 1 < QUICKMENU_BUFFER_MAXENTRIES) \
- { \
- QuickMenu_Buffer_Set(QM_TAG_TITLE, title); \
- ++QuickMenu_Buffer_Size; \
- QuickMenu_Buffer_Set(QM_TAG_COMMAND, 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) \
if (autocvar__hud_panel_quickmenu_file_from_server != "")
{
- string entry_name = _("Server's custom quickmenu");
+ string entry_name = _("Server quick menu");
if (autocvar__hud_panel_quickmenu_file_from_server == "wpeditor.txt")
- entry_name = _("Waypoint editor quickmenu");
- QUICKMENU_ENTRY(entry_name, "quickmenu; wait; quickmenu \"\" \"\" $_hud_panel_quickmenu_file_from_server")
+ entry_name = _("Waypoint editor menu");
+ QUICKMENU_ENTRY_SPECIAL(entry_name, "quickmenu; wait; quickmenu \"\" \"\" $_hud_panel_quickmenu_file_from_server")
+ if (autocvar__hud_panel_quickmenu_file_from_server == "wpeditor.txt")
+ entry_name = _("Waypoint editor menu as default");
+ else
+ entry_name = _("Server quick menu as default");
+ QUICKMENU_ENTRY(entry_name, "toggle hud_panel_quickmenu_server_is_default")
}
if(spectatee_status != 0)