]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud.qh
Merge branch 'master' into terencehill/menu_listbox_changes
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud.qh
index 3b61cb4539643c06b1e66dcc89b9fccbee6546f0..72e3326429eb7662feca88680ec696d5287494d4 100644 (file)
@@ -113,6 +113,11 @@ string panel_bg_padding_str;
 
 class(HUDPanel) .void() panel_draw;
 
+// chat panel can be reduced / moved while the mapvote is active
+// let know the mapvote panel about chat pos and size
+float chat_posy;
+float chat_sizey;
+
 float current_player;
 
 float GetPlayerColorForce(int i);
@@ -137,25 +142,27 @@ float old_p_healthtime, old_p_armortime;
 int prev_p_health, prev_p_armor;
 
 
-#define HUD_PANELS(HUD_PANEL)                                                                                                                                                                          \
-       HUD_PANEL(WEAPONS      , HUD_Weapons      , weapons)                                                                                                                    \
-       HUD_PANEL(AMMO         , HUD_Ammo         , ammo)                                                                                                                               \
-       HUD_PANEL(POWERUPS     , HUD_Powerups     , powerups)                                                                                                                   \
-       HUD_PANEL(HEALTHARMOR  , HUD_HealthArmor  , healtharmor)                                                                                                                \
-       HUD_PANEL(NOTIFY       , HUD_Notify       , notify)                                                                                                                     \
-       HUD_PANEL(TIMER        , HUD_Timer        , timer)                                                                                                                              \
-       HUD_PANEL(RADAR        , HUD_Radar        , radar)                                                                                                                              \
-       HUD_PANEL(SCORE        , HUD_Score        , score)                                                                                                                              \
-       HUD_PANEL(RACETIMER    , HUD_RaceTimer    , racetimer)                                                                                                                  \
-       HUD_PANEL(VOTE         , HUD_Vote         , vote)                                                                                                                               \
-       HUD_PANEL(MODICONS     , HUD_ModIcons     , modicons)                                                                                                                   \
-       HUD_PANEL(PRESSEDKEYS  , HUD_PressedKeys  , pressedkeys)                                                                                                                \
-       HUD_PANEL(CHAT         , HUD_Chat         , chat)                                                                                                                               \
-       HUD_PANEL(ENGINEINFO   , HUD_EngineInfo   , engineinfo)                                                                                                                 \
-       HUD_PANEL(INFOMESSAGES , HUD_InfoMessages , infomessages)                                                                                                               \
-       HUD_PANEL(PHYSICS      , HUD_Physics      , physics)                                                                                                                    \
-       HUD_PANEL(CENTERPRINT  , HUD_CenterPrint  , centerprint)                                                                                                                \
-       HUD_PANEL(BUFFS        , HUD_Buffs        , buffs)
+#define HUD_PANELS(HUD_PANEL) \
+       HUD_PANEL(WEAPONS      , HUD_Weapons      , weapons) \
+       HUD_PANEL(AMMO         , HUD_Ammo         , ammo) \
+       HUD_PANEL(POWERUPS     , HUD_Powerups     , powerups) \
+       HUD_PANEL(HEALTHARMOR  , HUD_HealthArmor  , healtharmor) \
+       HUD_PANEL(NOTIFY       , HUD_Notify       , notify) \
+       HUD_PANEL(TIMER        , HUD_Timer        , timer) \
+       HUD_PANEL(RADAR        , HUD_Radar        , radar) \
+       HUD_PANEL(SCORE        , HUD_Score        , score) \
+       HUD_PANEL(RACETIMER    , HUD_RaceTimer    , racetimer) \
+       HUD_PANEL(VOTE         , HUD_Vote         , vote) \
+       HUD_PANEL(MODICONS     , HUD_ModIcons     , modicons) \
+       HUD_PANEL(PRESSEDKEYS  , HUD_PressedKeys  , pressedkeys) \
+       HUD_PANEL(CHAT         , HUD_Chat         , chat) \
+       HUD_PANEL(ENGINEINFO   , HUD_EngineInfo   , engineinfo) \
+       HUD_PANEL(INFOMESSAGES , HUD_InfoMessages , infomessages) \
+       HUD_PANEL(PHYSICS      , HUD_Physics      , physics) \
+       HUD_PANEL(CENTERPRINT  , HUD_CenterPrint  , centerprint) \
+       HUD_PANEL(MAPVOTE      , MapVote_Draw     , mapvote) \
+       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 +234,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);                                                          \
                        }                                                                                                       \