]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud.qc
Merge branch 'master' into Mario/buff_updates
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud.qc
index 45f2391a48d70186dc77ac483d2e25e35e2c21ed..f30edcbdcbb8ecf877be46390c89e2320b8f7063 100644 (file)
@@ -4549,8 +4549,7 @@ void HUD_Buffs(void)
        }
 
        HUD_Panel_UpdateCvars();
-
-       draw_beginBoldFont();
+       
 
        vector pos, mySize;
        pos = panel_pos;
@@ -4568,8 +4567,16 @@ void HUD_Buffs(void)
        //float buff_iconalign = autocvar_hud_panel_buffs_iconalign;
        vector buff_offset = '0 0 0';
 
+       draw_beginBoldFont();
+       float buff_time, buff_maxtime;
+       buff_time = bound(0, getstatf(STAT_BUFF_TIME) - time, 99);
+       buff_maxtime = 60; // TODO: stat?
        for(e = Buff_Type_first; e; e = e.enemy) if(buffs & e.items)
        {
+               if(buff_time && autocvar_hud_panel_buffs_progressbar)
+                       HUD_Panel_DrawProgressBar(pos + buff_offset, mySize, autocvar_hud_panel_buffs_progressbar_name, buff_time/buff_maxtime, 0, 0, 
+                                                                         Buff_Color(e.items) * -1 + '1 1 1', (autocvar_hud_progressbar_alpha * panel_fg_alpha) * 0.4, DRAWFLAG_NORMAL);
+
                //DrawNumIcon(pos + buff_offset, mySize, shield, "shield", is_vertical, buff_iconalign, '1 1 1', 1);
                drawcolorcodedstring_aspect(pos + buff_offset, s, mySize, panel_fg_alpha * 0.5, DRAWFLAG_NORMAL);
        }