-#include "_all.qh"
+#include "quickmenu.qh"
-#include "hud_config.qh"
-
-#include "../dpdefs/keycodes.qh"
+#include "hud/all.qh"
+#include "mapvoting.qh"
// QUICKMENU_MAXLINES must be <= 10
const int QUICKMENU_MAXLINES = 10;
if(mode == "file")
{
if(autocvar_hud_panel_quickmenu_file == "" || autocvar_hud_panel_quickmenu_file == "0")
- printf("No file name is set in hud_panel_quickmenu_file, loading default quickmenu\n");
+ LOG_INFO("No file name is set in hud_panel_quickmenu_file, loading default quickmenu\n");
else
{
fh = fopen(autocvar_hud_panel_quickmenu_file, FILE_READ);
if(fh < 0)
- printf("Couldn't open file \"%s\", loading default quickmenu\n", autocvar_hud_panel_quickmenu_file);
+ LOG_INFOF("Couldn't open file \"%s\", loading default quickmenu\n", autocvar_hud_panel_quickmenu_file);
}
if(fh < 0)
mode = "default";
{
if(argv(1) == "")
continue;
- QuickMenu_Buffer_Set(QM_TAG_TITLE, argv(0));
+ QuickMenu_Buffer_Set(QM_TAG_TITLE, argv(0));
++QuickMenu_Buffer_Size;
QuickMenu_Buffer_Set(QM_TAG_COMMAND, argv(1));
}
}
else
{
- printf("Unrecognized mode %s\n", mode);
+ LOG_WARNINGF("Unrecognized mode %s\n", mode);
return false;
}
setcursormode(1);
hudShiftState = 0;
- QuickMenu_TimeOut = time + autocvar_hud_panel_quickmenu_time;
+ QuickMenu_TimeOut = ((autocvar_hud_panel_quickmenu_time > 0) ? time + autocvar_hud_panel_quickmenu_time : 0);
return true;
}
// printf("^1 skipping %s\n", s);
}
if(QuickMenu_Buffer_Index == QuickMenu_Buffer_Size)
- printf("Couldn't find submenu \"%s\"\n", z_submenu);
+ LOG_WARNINGF("Couldn't find submenu \"%s\"\n", z_submenu);
}
// only the last page can contain up to QUICKMENU_MAXLINES entries
QuickMenu_Close();
return false;
}
- QuickMenu_TimeOut = time + autocvar_hud_panel_quickmenu_time;
+ QuickMenu_TimeOut = ((autocvar_hud_panel_quickmenu_time > 0) ? time + autocvar_hud_panel_quickmenu_time : 0);
return true;
}
if (QuickMenu_Page_Command[num] != "")
{
localcmd(strcat("\n", QuickMenu_Page_Command[num], "\n"));
- QuickMenu_TimeOut = time + autocvar_hud_panel_quickmenu_time;
+ QuickMenu_TimeOut = ((autocvar_hud_panel_quickmenu_time > 0) ? time + autocvar_hud_panel_quickmenu_time : 0);
return true;
}
if (QuickMenu_Page_Description[num] != "")
}
}
- vector cursorsize = '32 32 0';
- drawpic(mousepos, strcat("gfx/menu/", autocvar_menu_skin, "/cursor.tga"), cursorsize, '1 1 1', 0.8, DRAWFLAG_NORMAL);
+ draw_cursor_normal(mousepos, '1 1 1', 0.8);
prevMouseClicked = mouseClicked;
}
drawcolorcodedstring(pos, entry, fontsize, panel_fg_alpha, DRAWFLAG_ADDITIVE);
}
-void HUD_QuickMenu(void)
+void HUD_QuickMenu()
{
if(!autocvar__hud_configure)
{
//if(!autocvar_hud_panel_quickmenu) return;
if(!hud_panel_quickmenu) return;
+ if(QuickMenu_TimeOut)
if(time > QuickMenu_TimeOut)
{
QuickMenu_Close();
continue;
if(without_me && pl.sv_entnum == player_localnum)
continue;
- QUICKMENU_ENTRY(GetPlayerName(pl.sv_entnum), sprintf(cmd, GetPlayerName(pl.sv_entnum)))
+ QUICKMENU_ENTRY(entcs_GetName(pl.sv_entnum), sprintf(cmd, entcs_GetName(pl.sv_entnum)))
}
return;
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_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(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)
+ if(STAT(TIMELIMIT) > 0)
{
QUICKMENU_ENTRY(CTX(_("QMCMD^Reduce match time")), "vcall reducematchtime")
QUICKMENU_ENTRY(CTX(_("QMCMD^Extend match time")), "vcall extendmatchtime")
if(target_submenu != "" && !target_submenu_found)
{
- printf("Couldn't find submenu \"%s\"\n", target_submenu);
+ LOG_WARNINGF("Couldn't find submenu \"%s\"\n", target_submenu);
if(prvm_language != "en")
- printf("^3Warning: submenu must be in English\n", target_submenu);
+ LOG_WARNINGF("^3Warning: submenu must be in English\n", target_submenu);
QuickMenu_Buffer_Size = 0;
}
}