]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/quickmenu.qc
Load csqc cursor attributes from the current menu skin file rather than using constan...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / quickmenu.qc
index 5f896beea56bcafca0b9d35deca04654c4ad71b3..63416f2b017cf31cb35a1f58f37c9dc023c186cb 100644 (file)
@@ -1,8 +1,7 @@
-#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;
@@ -75,12 +74,12 @@ bool QuickMenu_Open(string mode, string submenu)
        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";
@@ -152,7 +151,7 @@ bool QuickMenu_Open(string mode, string submenu)
        }
        else
        {
-               printf("Unrecognized mode %s\n", mode);
+               LOG_WARNINGF("Unrecognized mode %s\n", mode);
                return false;
        }
 
@@ -286,7 +285,7 @@ bool QuickMenu_Page_Load(string target_submenu, int new_page)
                        // 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
@@ -532,8 +531,7 @@ void QuickMenu_Mouse()
                }
        }
 
-       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;
 }
@@ -574,7 +572,7 @@ void HUD_Quickmenu_DrawEntry(vector pos, string desc, string option, vector font
                drawcolorcodedstring(pos, entry, fontsize, panel_fg_alpha, DRAWFLAG_ADDITIVE);
 }
 
-void HUD_QuickMenu(void)
+void HUD_QuickMenu()
 {
        if(!autocvar__hud_configure)
        {
@@ -759,7 +757,7 @@ void HUD_Quickmenu_PlayerListEntries(string cmd, float teamplayers, float withou
                        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;
@@ -848,7 +846,7 @@ void QuickMenu_Default(string target_submenu)
        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")
@@ -859,9 +857,9 @@ void QuickMenu_Default(string target_submenu)
 
        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;
        }
 }