X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fclient%2Fhud%2Fpanel%2Fpowerups.qc;h=49b7a97018c0071d4170e06fe43e8bd274d7d905;hp=7528c2ba2b1a6f89353b6e4cf83116f5ee4a6473;hb=991de5e6922cd3c283de56c3249624f0f1bfe767;hpb=9185b58da6fe5f2b095d7066577e1e024b4d2798 diff --git a/qcsrc/client/hud/panel/powerups.qc b/qcsrc/client/hud/panel/powerups.qc index 7528c2ba2..49b7a9701 100644 --- a/qcsrc/client/hud/panel/powerups.qc +++ b/qcsrc/client/hud/panel/powerups.qc @@ -1,6 +1,9 @@ #include "powerups.qh" -#include +#include +#include +#include +#include // Powerups (#2) @@ -44,7 +47,7 @@ void addPowerupItem(string name, string icon, vector color, float currentTime, f int getPowerupItemAlign(int align, int column, int row, int columns, int rows, bool isVertical) { - TC(int, align); TC(int, column); TC(int, row); TC(int, columns); TC(int, rows); TC(bool, isVertical); + TC(int, align); TC(int, column); TC(int, row); TC(int, columns); TC(int, rows); TC(bool, isVertical); if(align < 2) return align; @@ -63,7 +66,7 @@ void HUD_Powerups() { int allItems = STAT(ITEMS); int allBuffs = STAT(BUFFS); - int strengthTime, shieldTime, superTime; + float strengthTime, shieldTime, superTime; // Initialize items if(!autocvar__hud_configure) @@ -72,7 +75,7 @@ void HUD_Powerups() return; if(STAT(HEALTH) <= 0 && autocvar_hud_panel_powerups_hide_ondeath) return; - if(!(allItems & (ITEM_Strength.m_itemid | ITEM_Shield.m_itemid | IT_SUPERWEAPON)) && !allBuffs) return; + //if(!(allItems & (ITEM_Strength.m_itemid | ITEM_Shield.m_itemid | IT_SUPERWEAPON)) && !allBuffs) return; strengthTime = bound(0, STAT(STRENGTH_FINISHED) - time, 99); shieldTime = bound(0, STAT(INVINCIBLE_FINISHED) - time, 99); @@ -100,7 +103,7 @@ void HUD_Powerups() addPowerupItem("Strength", "strength", autocvar_hud_progressbar_strength_color, strengthTime, 30); if(shieldTime) addPowerupItem("Shield", "shield", autocvar_hud_progressbar_shield_color, shieldTime, 30); - if(superTime) + if(superTime && !(allItems & IT_UNLIMITED_SUPERWEAPONS)) addPowerupItem("Superweapons", "superweapons", autocvar_hud_progressbar_superweapons_color, superTime, 30); MUTATOR_CALLHOOK(HUD_Powerups_add); @@ -109,12 +112,13 @@ void HUD_Powerups() return; // Draw panel background - HUD_Panel_UpdateCvars(); + HUD_Panel_LoadCvars(); + if (autocvar_hud_panel_powerups_dynamichud) HUD_Scale_Enable(); else HUD_Scale_Disable(); - HUD_Panel_DrawBg(1); + HUD_Panel_DrawBg(); // Set drawing area vector pos = panel_pos; @@ -166,7 +170,7 @@ void HUD_Powerups() // Draw items from linked list vector itemPos = pos; - vector itemSize = eX * (size.x / columns) + eY * (size.y / rows); + vector itemSize = vec2(size.x / columns, size.y / rows); vector textColor = '1 1 1'; int fullSeconds = 0; @@ -177,7 +181,7 @@ void HUD_Powerups() draw_beginBoldFont(); for(entity item = powerupItems; item.count; item = item.chain) { - itemPos = eX * (pos.x + column * itemSize.x) + eY * (pos.y + row * itemSize.y); + itemPos = vec2(pos.x + column * itemSize.x, pos.y + row * itemSize.y); // Draw progressbar if(autocvar_hud_panel_powerups_progressbar)