]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud/panel/powerups.qc
Purge autocvars.qh from the client-side codebase, cvars are defined in the headers...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud / panel / powerups.qc
index dd574cf9b039c4b69d6654792a36525e7c54ba57..9a4ab1df3ff62904f109abfa5fe276fc6bb21187 100644 (file)
@@ -1,12 +1,20 @@
 #include "powerups.qh"
 
-#include <client/autocvars.qh>
-#include <client/defs.qh>
-#include <client/miscfunctions.qh>
+#include <client/draw.qh>
 #include <common/items/_mod.qh>
+#include <common/util.qh>
 
 // Powerups (#2)
 
+void HUD_Powerups_Export(int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+       HUD_Write_Cvar("hud_panel_powerups_iconalign");
+       HUD_Write_Cvar("hud_panel_powerups_baralign");
+       HUD_Write_Cvar("hud_panel_powerups_progressbar");
+       HUD_Write_Cvar("hud_panel_powerups_text");
+}
+
 // Powerup item fields (reusing existing fields)
 .string message;  // Human readable name
 .string netname;  // Icon name
@@ -47,7 +55,7 @@ void addPowerupItem(string name, string icon, vector color, float currentTime, f
 
 int getPowerupItemAlign(int align, int column, int row, int columns, int rows, bool isVertical)
 {
-    TC(int, align); TC(int, column); TC(int, row); TC(int, columns); TC(int, rows); TC(bool, isVertical);
+       TC(int, align); TC(int, column); TC(int, row); TC(int, columns); TC(int, rows); TC(bool, isVertical);
        if(align < 2)
                return align;
 
@@ -103,7 +111,7 @@ void HUD_Powerups()
                addPowerupItem("Strength", "strength", autocvar_hud_progressbar_strength_color, strengthTime, 30);
        if(shieldTime)
                addPowerupItem("Shield", "shield", autocvar_hud_progressbar_shield_color, shieldTime, 30);
-       if(superTime)
+       if(superTime && !(allItems & IT_UNLIMITED_SUPERWEAPONS))
                addPowerupItem("Superweapons", "superweapons", autocvar_hud_progressbar_superweapons_color, superTime, 30);
 
        MUTATOR_CALLHOOK(HUD_Powerups_add);