seta hud_panel_centerprint_fade_subsequent_passtwo_minalpha "" "minimum factor that the second pass can fade to"
seta hud_panel_centerprint_fade_subsequent_minfontsize "" "minimum factor for the font size from the subsequent fading effects"
seta hud_panel_centerprint_fade_minfontsize "" "minimum factor for the font size from the fading in/out effects"
-seta hud_panel_buffs "" "enable/disable this panel"
-seta hud_panel_buffs_pos "" "position of this panel"
-seta hud_panel_buffs_size "" "size of this panel"
-seta hud_panel_buffs_bg "" "if set to something else than \"\" = override default background"
-seta hud_panel_buffs_bg_color "" "if set to something else than \"\" = override default panel background color"
-seta hud_panel_buffs_bg_color_team "" "override panel color with team color in team based games"
-seta hud_panel_buffs_bg_alpha "" "if set to something else than \"\" = override default panel background alpha"
-seta hud_panel_buffs_bg_border "" "if set to something else than \"\" = override default size of border around the background"
-seta hud_panel_buffs_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
-
+
+ seta hud_panel_mapvote "" "enable/disable this panel"
+ seta hud_panel_mapvote_pos "" "position of this panel"
+ seta hud_panel_mapvote_size "" "size of this panel"
+ seta hud_panel_mapvote_bg "" "if set to something else than \"\" = override default background"
+ seta hud_panel_mapvote_bg_color "" "if set to something else than \"\" = override default panel background color"
+ seta hud_panel_mapvote_bg_color_team "" "override panel color with team color in team based games"
+ seta hud_panel_mapvote_bg_alpha "" "if set to something else than \"\" = override default panel background alpha"
+ seta hud_panel_mapvote_bg_border "" "if set to something else than \"\" = override default size of border around the background"
+ seta hud_panel_mapvote_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
seta hud_panel_centerprint_fade_subsequent_minfontsize "0.75"
seta hud_panel_centerprint_fade_minfontsize "0"
-seta hud_panel_buffs 1
-seta hud_panel_buffs_pos "0.325000 0.820000"
-seta hud_panel_buffs_size "0.350000 0.050000"
-seta hud_panel_buffs_bg "0"
-seta hud_panel_buffs_bg_color ""
-seta hud_panel_buffs_bg_color_team ""
-seta hud_panel_buffs_bg_alpha ""
-seta hud_panel_buffs_bg_border ""
-seta hud_panel_buffs_bg_padding ""
-
+ seta hud_panel_mapvote 1
+ seta hud_panel_mapvote_pos "0 0"
+ seta hud_panel_mapvote_size "1 1"
+ seta hud_panel_mapvote_bg "border_default"
+ seta hud_panel_mapvote_bg_color ""
+ seta hud_panel_mapvote_bg_color_team ""
+ seta hud_panel_mapvote_bg_alpha ""
+ seta hud_panel_mapvote_bg_border ""
+ seta hud_panel_mapvote_bg_padding ""
+
menu_sync
seta hud_panel_centerprint_fade_subsequent_minfontsize "0.75"
seta hud_panel_centerprint_fade_minfontsize "0"
-seta hud_panel_buffs 1
-seta hud_panel_buffs_pos "0.450000 0.855000"
-seta hud_panel_buffs_size "0.050000 0.070000"
-seta hud_panel_buffs_bg "0"
-seta hud_panel_buffs_bg_color ""
-seta hud_panel_buffs_bg_color_team ""
-seta hud_panel_buffs_bg_alpha ""
-seta hud_panel_buffs_bg_border ""
-seta hud_panel_buffs_bg_padding ""
-
+ seta hud_panel_mapvote 1
+ seta hud_panel_mapvote_pos "0 0"
+ seta hud_panel_mapvote_size "1 1"
+ seta hud_panel_mapvote_bg "0"
+ seta hud_panel_mapvote_bg_color ""
+ seta hud_panel_mapvote_bg_color_team ""
+ seta hud_panel_mapvote_bg_alpha ""
+ seta hud_panel_mapvote_bg_border ""
+ seta hud_panel_mapvote_bg_padding ""
+
menu_sync
seta hud_panel_centerprint_fade_subsequent_minfontsize "0.75"
seta hud_panel_centerprint_fade_minfontsize "0"
-seta hud_panel_buffs 1
-seta hud_panel_buffs_pos "0.450000 0.855000"
-seta hud_panel_buffs_size "0.050000 0.070000"
-seta hud_panel_buffs_bg "0"
-seta hud_panel_buffs_bg_color ""
-seta hud_panel_buffs_bg_color_team ""
-seta hud_panel_buffs_bg_alpha ""
-seta hud_panel_buffs_bg_border ""
-seta hud_panel_buffs_bg_padding ""
-
+ seta hud_panel_mapvote 1
+ seta hud_panel_mapvote_pos "0 0"
+ seta hud_panel_mapvote_size "1 1"
+ seta hud_panel_mapvote_bg "0"
+ seta hud_panel_mapvote_bg_color ""
+ seta hud_panel_mapvote_bg_color_team ""
+ seta hud_panel_mapvote_bg_alpha ""
+ seta hud_panel_mapvote_bg_border ""
+ seta hud_panel_mapvote_bg_padding ""
+
menu_sync
seta hud_panel_centerprint_fade_subsequent_minfontsize "0.75"
seta hud_panel_centerprint_fade_minfontsize "0"
-seta hud_panel_buffs 1
-seta hud_panel_buffs_pos "0.450000 0.855000"
-seta hud_panel_buffs_size "0.050000 0.070000"
-seta hud_panel_buffs_bg "0"
-seta hud_panel_buffs_bg_color ""
-seta hud_panel_buffs_bg_color_team ""
-seta hud_panel_buffs_bg_alpha ""
-seta hud_panel_buffs_bg_border ""
-seta hud_panel_buffs_bg_padding ""
-
+ seta hud_panel_mapvote 1
+ seta hud_panel_mapvote_pos "0 0"
+ seta hud_panel_mapvote_size "1 1"
+ seta hud_panel_mapvote_bg "0"
+ seta hud_panel_mapvote_bg_color ""
+ seta hud_panel_mapvote_bg_color_team ""
+ seta hud_panel_mapvote_bg_alpha ""
+ seta hud_panel_mapvote_bg_border ""
+ seta hud_panel_mapvote_bg_padding ""
+
menu_sync
seta hud_panel_centerprint_fade_subsequent_minfontsize "0.75"
seta hud_panel_centerprint_fade_minfontsize "0"
-seta hud_panel_buffs 1
-seta hud_panel_buffs_pos "0.450000 0.855000"
-seta hud_panel_buffs_size "0.050000 0.070000"
-seta hud_panel_buffs_bg "0"
-seta hud_panel_buffs_bg_color ""
-seta hud_panel_buffs_bg_color_team ""
-seta hud_panel_buffs_bg_alpha ""
-seta hud_panel_buffs_bg_border ""
-seta hud_panel_buffs_bg_padding ""
-
+ seta hud_panel_mapvote 1
+ seta hud_panel_mapvote_pos "0 0"
+ seta hud_panel_mapvote_size "1 1"
+ seta hud_panel_mapvote_bg "0"
+ seta hud_panel_mapvote_bg_color ""
+ seta hud_panel_mapvote_bg_color_team ""
+ seta hud_panel_mapvote_bg_alpha ""
+ seta hud_panel_mapvote_bg_border ""
+ seta hud_panel_mapvote_bg_padding ""
+
menu_sync
seta hud_panel_centerprint_fade_subsequent_minfontsize "0.75"
seta hud_panel_centerprint_fade_minfontsize "0"
-seta hud_panel_buffs 1
-seta hud_panel_buffs_pos "0.450000 0.855000"
-seta hud_panel_buffs_size "0.050000 0.070000"
-seta hud_panel_buffs_bg "0"
-seta hud_panel_buffs_bg_color ""
-seta hud_panel_buffs_bg_color_team ""
-seta hud_panel_buffs_bg_alpha ""
-seta hud_panel_buffs_bg_border ""
-seta hud_panel_buffs_bg_padding ""
-
+ seta hud_panel_mapvote 1
+ seta hud_panel_mapvote_pos "0 0"
+ seta hud_panel_mapvote_size "1 1"
+ seta hud_panel_mapvote_bg "0"
+ seta hud_panel_mapvote_bg_color ""
+ seta hud_panel_mapvote_bg_color_team ""
+ seta hud_panel_mapvote_bg_alpha ""
+ seta hud_panel_mapvote_bg_border ""
+ seta hud_panel_mapvote_bg_padding ""
+
menu_sync
// Powerups (#2)
//
+
+// Powerup item fields (reusing existing fields)
+.string message; // Human readable name
+.string netname; // Icon name
+.vector colormod; // Color
+.float count; // Time left
+.float lifetime; // Maximum time
+
+entity powerupItems;
+int powerupItemsCount;
+
+void resetPowerupItems()
+{
+ entity item;
+ for(item = powerupItems; item; item = item.chain)
+ item.count = 0;
+
+ powerupItemsCount = 0;
+}
+
+void addPowerupItem(string name, string icon, vector color, float currentTime, float lifeTime)
+{
+ if(!powerupItems)
+ powerupItems = spawn();
+
+ entity item;
+ for(item = powerupItems; item.count; item = item.chain)
+ if(!item.chain)
+ item.chain = spawn();
+
+ item.message = name;
+ item.netname = icon;
+ item.colormod = color;
+ item.count = currentTime;
+ item.lifetime = lifeTime;
+
+ ++powerupItemsCount;
+}
+
+int getPowerupItemAlign(int align, int column, int row, int columns, int rows, bool isVertical)
+{
+ if(align < 2)
+ return align;
+
+ bool isTop = isVertical && rows > 1 && row == 0;
+ bool isBottom = isVertical && rows > 1 && row == rows-1;
+ bool isLeft = !isVertical && columns > 1 && column == 0;
+ bool isRight = !isVertical && columns > 1 && column == columns-1;
+
+ if(isTop || isLeft) return (align == 2) ? 1 : 0;
+ if(isBottom || isRight) return (align == 2) ? 0 : 1;
+
+ return 2;
+}
+
void HUD_Powerups(void)
{
- float strength_time, shield_time, superweapons_time;
+ if(intermission == 2) return;
++
+ int allItems = getstati(STAT_ITEMS, 0, 24);
+ int allBuffs = getstati(STAT_BUFFS, 0, 24);
+ int strengthTime, shieldTime, superTime;
+
+ // Initialize items
if(!autocvar__hud_configure)
{
if(!autocvar_hud_panel_powerups) return;
}
}
-// Buffs (#18)
-//
-void HUD_Buffs(void)
-{
- if(intermission == 2) return;
- int buffs = getstati(STAT_BUFFS, 0, 24);
- if(!autocvar__hud_configure)
- {
- if(!autocvar_hud_panel_buffs) return;
- if(spectatee_status == -1) return;
- if(getstati(STAT_HEALTH) <= 0) return;
- if(!buffs) return;
- }
- else
- {
- buffs = Buff_Type_first.items; // force first buff
- }
-
- int b = 0; // counter to tell other functions that we have buffs
- entity e;
- string s = "";
- for(e = Buff_Type_first; e; e = e.enemy) if(buffs & e.items)
- {
- ++b;
- string o = strcat(rgb_to_hexcolor(Buff_Color(e.items)), Buff_PrettyName(e.items));
- if(s == "")
- s = o;
- else
- s = strcat(s, " ", o);
- }
-
- HUD_Panel_UpdateCvars();
-
- draw_beginBoldFont();
-
- vector pos, mySize;
- pos = panel_pos;
- mySize = panel_size;
-
- HUD_Panel_DrawBg(bound(0, b, 1));
- if(panel_bg_padding)
- {
- pos += '1 1 0' * panel_bg_padding;
- mySize -= '2 2 0' * panel_bg_padding;
- }
-
- //float panel_ar = mySize_x/mySize_y;
- //bool is_vertical = (panel_ar < 1);
- //float buff_iconalign = autocvar_hud_panel_buffs_iconalign;
- vector buff_offset = '0 0 0';
-
- for(e = Buff_Type_first; e; e = e.enemy) if(buffs & e.items)
- {
- //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);
- }
-
- draw_endBoldFont();
-}
-
--
/*
==================
Main HUD system
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(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) \
+ // always add new panels to the end of list
#define HUD_PANEL(NAME, draw_func, name) \
int HUD_PANEL_##NAME; \