]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Update main cvars of Powerups and Vote panels only when these panels gets really...
authorterencehill <piuntn@gmail.com>
Mon, 1 Nov 2010 21:52:16 +0000 (22:52 +0100)
committerterencehill <piuntn@gmail.com>
Mon, 1 Nov 2010 21:52:16 +0000 (22:52 +0100)
qcsrc/client/hud.qc

index 116266532e12e7dc630351c730f3662a72294e4c..802907e34b8689fd7884c7314b7d862a1bf06d75 100644 (file)
@@ -2034,21 +2034,17 @@ void HUD_Powerups(void) {
        if(!autocvar_hud_panel_powerups && !autocvar__hud_configure)
                return;
 
-       active_panel = HUD_PANEL_POWERUPS;
-       HUD_Panel_UpdateCvars(powerups);
-       float stat_items;
-       stat_items = getstati(STAT_ITEMS);
-
        if(!autocvar__hud_configure)
        {
-               if not(stat_items & IT_STRENGTH)
-                       if not(stat_items & IT_INVINCIBLE)
-                               return;
+               if not(getstati(STAT_ITEMS) & (IT_STRENGTH | IT_INVINCIBLE))
+                       return;
 
                if (getstati(STAT_HEALTH) <= 0)
                        return;
        }
 
+       active_panel = HUD_PANEL_POWERUPS;
+       HUD_Panel_UpdateCvars(powerups);
        vector pos, mySize;
        pos = panel_pos;
        mySize = panel_size;
@@ -3760,12 +3756,6 @@ void HUD_VoteWindow(void)
        if(!autocvar_hud_panel_vote && !autocvar__hud_configure)
                return;
 
-       active_panel = HUD_PANEL_VOTE;
-       HUD_Panel_UpdateCvars(vote);
-       vector pos, mySize;
-       pos = panel_pos;
-       mySize = panel_size;
-
        if(!autocvar__hud_configure)
        {
                panel_fg_alpha = autocvar_hud_panel_fg_alpha;
@@ -3799,6 +3789,12 @@ void HUD_VoteWindow(void)
        if(!vote_alpha)
                return;
 
+       active_panel = HUD_PANEL_VOTE;
+       HUD_Panel_UpdateCvars(vote);
+       vector pos, mySize;
+       pos = panel_pos;
+       mySize = panel_size;
+
        a = vote_alpha * bound(cvar("hud_panel_vote_alreadyvoted_alpha"), 1 - vote_highlighted, 1);
        HUD_Panel_DrawBg(a);
        a = panel_fg_alpha * a;