]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud/panel/powerups.qc
Merge branch 'terencehill/spectate_player' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud / panel / powerups.qc
index 076ce918f14723dcde2e755308a3f4379fb885e0..49b7a97018c0071d4170e06fe43e8bd274d7d905 100644 (file)
@@ -1,5 +1,8 @@
 #include "powerups.qh"
 
+#include <client/autocvars.qh>
+#include <client/defs.qh>
+#include <client/miscfunctions.qh>
 #include <common/items/_mod.qh>
 
 // Powerups (#2)
@@ -44,7 +47,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;
 
@@ -100,7 +103,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);
@@ -167,7 +170,7 @@ void HUD_Powerups()
 
        // Draw items from linked list
        vector itemPos = pos;
-       vector itemSize = eX * (size.x / columns) + eY * (size.y / rows);
+       vector itemSize = vec2(size.x / columns, size.y / rows);
        vector textColor = '1 1 1';
 
        int fullSeconds = 0;
@@ -178,7 +181,7 @@ void HUD_Powerups()
        draw_beginBoldFont();
        for(entity item = powerupItems; item.count; item = item.chain)
        {
-               itemPos = eX * (pos.x + column * itemSize.x) + eY * (pos.y + row * itemSize.y);
+               itemPos = vec2(pos.x + column * itemSize.x, pos.y + row * itemSize.y);
 
                // Draw progressbar
                if(autocvar_hud_panel_powerups_progressbar)