]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud.qh
Merge branch 'master' into terencehill/itemstime
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud.qh
index 32178142a4acea4b6faa0fc06049e23fbb85a052..90a17b80be91b500fc2a0f8006098fdd618a956e 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef HUD_H
 #define HUD_H
 
-#include "../common/weapons/weapons.qh"
+#include "../common/weapons/all.qh"
 
 const int HUD_PANEL_MAX = 24;
 entity hud_panel[HUD_PANEL_MAX];
@@ -155,7 +155,9 @@ int prev_p_health, prev_p_armor;
        HUD_PANEL(INFOMESSAGES , HUD_InfoMessages , infomessages)                                                                                                               \
        HUD_PANEL(PHYSICS      , HUD_Physics      , physics)                                                                                                                    \
        HUD_PANEL(CENTERPRINT  , HUD_CenterPrint  , centerprint)                                                                                                                \
-       HUD_PANEL(BUFFS        , HUD_Buffs        , buffs)
+       HUD_PANEL(BUFFS        , HUD_Buffs        , buffs) \
+       HUD_PANEL(ITEMSTIME    , HUD_ItemsTime    , itemstime) \
+       // always add new panels to the end of list
 
 #define HUD_PANEL(NAME, draw_func, name)                                                                                                                                                       \
        int HUD_PANEL_##NAME;                                                                                                                                                                                   \
@@ -227,9 +229,9 @@ HUD_PANELS(HUD_PANEL)
                        panel_bg_color = autocvar_hud_panel_bg_color;                                                           \
                } else {                                                                                                    \
                        if (panel_bg_color_str == "shirt") {                                                                    \
-                               panel_bg_color = colormapPaletteColor(floor(stof(getplayerkeyvalue(current_player - 1, "colors")) / 16), 0);\
+                               panel_bg_color = colormapPaletteColor(floor(stof(getplayerkeyvalue(current_player, "colors")) / 16), 0); \
                        } else if (panel_bg_color_str == "pants") {                                                             \
-                               panel_bg_color = colormapPaletteColor(stof(getplayerkeyvalue(current_player - 1, "colors")) % 16, 1);\
+                               panel_bg_color = colormapPaletteColor(stof(getplayerkeyvalue(current_player, "colors")) % 16, 1); \
                        } else {                                                                                                \
                                panel_bg_color = stov(panel_bg_color_str);                                                          \
                        }                                                                                                       \