]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud/panel/weapons.qc
Add cvars to enable / disable the dynamic hud effects for each panel
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud / panel / weapons.qc
index 6e9f13dac10cada4c1b604fdf43821eab94a91a6..7e5f8107e5379efad3a692cd5e6e88eff0fa1cf4 100644 (file)
@@ -1,8 +1,10 @@
+#include "weapons.qh"
 // Weapon icons (#0)
 
 entity weaponorder[Weapons_MAX];
 void weaponorder_swap(int i, int j, entity pass)
 {
+    TC(int, i); TC(int, j);
        entity h = weaponorder[i];
        weaponorder[i] = weaponorder[j];
        weaponorder[j] = h;
@@ -11,6 +13,7 @@ void weaponorder_swap(int i, int j, entity pass)
 string weaponorder_cmp_str;
 int weaponorder_cmp(int i, int j, entity pass)
 {
+    TC(int, i); TC(int, j);
        int ai = strstrofs(weaponorder_cmp_str, sprintf(" %d ", weaponorder[i].m_id), 0);
        int aj = strstrofs(weaponorder_cmp_str, sprintf(" %d ", weaponorder[j].m_id), 0);
        return aj - ai; // the string is in REVERSE order (higher prio at the right is what we want, but higher prio first is the string)
@@ -18,7 +21,6 @@ int weaponorder_cmp(int i, int j, entity pass)
 
 void HUD_Weapons()
 {
-       SELFPARAM();
        // declarations
        WepSet weapons_stat = WepSet_GetFromStat();
        int i;
@@ -280,6 +282,10 @@ void HUD_Weapons()
        }
 
        // draw the background, then change the virtual size of it to better fit other items inside
+       if (autocvar_hud_panel_weapons_dynamichud)
+               HUD_Scale_Enable();
+       else
+               HUD_Scale_Disable();
        HUD_Panel_DrawBg(1);
 
        if(center.x == -1)