]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud.qh
Small cleanup
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud.qh
index acff23a281506392846aa0930d6abd43116f8666..54cf6f906d3c0038b2fe7458aa46f685c0645374 100644 (file)
@@ -12,6 +12,19 @@ int HUD_PANEL_LAST;
 int panel_order[HUD_PANEL_MAX];
 string hud_panelorder_prev;
 
+void HUD_Reset (void);
+void HUD_Main (void);
+
+int vote_yescount;
+int vote_nocount;
+int vote_needed;
+int vote_highlighted; // currently selected vote
+
+int vote_active; // is there an active vote?
+int vote_prev; // previous state of vote_active to check for a change
+float vote_alpha;
+float vote_change; // "time" when vote_active changed
+
 float hud_draw_maximized;
 float hud_panel_radar_maximized;
 float chat_panel_modified;
@@ -69,7 +82,7 @@ vector panel_size_backup;
 vector panel_size_copied;
 
 entity panel;
-entityclass(HUDPanel)
+entityclass(HUDPanel);
 class(HUDPanel) .string panel_name;
 class(HUDPanel) .int panel_id;
 class(HUDPanel) .vector current_panel_pos;
@@ -104,6 +117,25 @@ float current_player;
 
 float GetPlayerColorForce(int i);
 
+float stringwidth_colors(string s, vector theSize);
+int GetPlayerColor(int i);
+string GetPlayerName(int i);
+float stringwidth_nocolors(string s, vector theSize);
+void HUD_Panel_DrawProgressBar(vector theOrigin, vector theSize, string pic, float length_ratio, bool vertical, float baralign, vector theColor, float theAlpha, int drawflag);
+
+
+// prev_* vars contain the health/armor at the previous FRAME
+// set to -1 when player is dead or was not playing
+int prev_health, prev_armor;
+float health_damagetime, armor_damagetime;
+int health_beforedamage, armor_beforedamage;
+// old_p_* vars keep track of previous values when smoothing value changes of the progressbar
+int old_p_health, old_p_armor;
+float old_p_healthtime, old_p_armortime;
+// prev_p_* vars contain the health/armor progressbar value at the previous FRAME
+// set to -1 to forcedly stop effects when we switch spectated player (e.g. from playerX: 70h to playerY: 50h)
+int prev_p_health, prev_p_armor;
+
 
 #define HUD_PANELS(HUD_PANEL)                                                                                                                                                                          \
        HUD_PANEL(WEAPONS      , HUD_Weapons      , weapons)                                                                                                                    \
@@ -123,7 +155,9 @@ float GetPlayerColorForce(int i);
        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;                                                                                                                                                                                   \