drawfont = hud_font;
}
-void DrawNumIcon(vector myPos, vector mySize, float x, string icon, float vertical, float iconalign, float left, vector color, float alpha)
+void DrawNumIcon(vector myPos, vector mySize, float x, string icon, float vertical, float icon_right_align, vector color, float alpha)
{
vector newPos;
float newSize_x, newSize_y;
myPos_y += square_y - square_x; //add padding
square_y = mySize_x;
}
- if( (left && (iconalign == 0 || iconalign == 4)) || (!left && (iconalign == 0 || iconalign == 3)) ) // left aligned icon
- {
- picpos = myPos;
- numpos = myPos + eY * square_y;
- }
- else // right aligned icon
+
+ if(icon_right_align) // right aligned icon
{
numpos = myPos;
picpos = myPos + eY * square_y;
}
+ else // left aligned icon
+ {
+ picpos = myPos;
+ numpos = myPos + eY * square_y;
+ }
drawpic_aspect_skin(picpos, icon, square, '1 1 1', panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
drawfont = hud_bigfont;
newPos_x = myPos_x;
}
- if(left)
+ if(icon_right_align) // right align
{
- if(iconalign == 1 || iconalign == 3) // right align
- {
- numpos = newPos;
- picpos = newPos + eX * 2 * newSize_y;
- }
- else // left align
- {
- numpos = newPos + eX * newSize_y;
- picpos = newPos;
- }
+ numpos = newPos;
+ picpos = newPos + eX * 2 * newSize_y;
}
- else
+ else // left align
{
- if(iconalign == 0 || iconalign == 3) // left align
- {
- numpos = newPos + eX * newSize_y;
- picpos = newPos;
- }
- else // right align
- {
- numpos = newPos;
- picpos = newPos + eX * 2 * newSize_y;
- }
+ numpos = newPos + eX * newSize_y;
+ picpos = newPos;
}
drawfont = hud_bigfont;
drawpic_aspect_skin(picpos, icon, '1 1 0' * newSize_y, '1 1 1', panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
}
-void DrawNumIcon_expanding(vector myPos, vector mySize, float x, string icon, float vertical, float iconalign, float left, vector color, float fadelerp)
+void DrawNumIcon_expanding(vector myPos, vector mySize, float x, string icon, float vertical, float icon_right_align, vector color, float fadelerp)
{
float sz;
sz = expandingbox_sizefactor_from_fadelerp(fadelerp);
- DrawNumIcon(myPos + expandingbox_resize_centered_box_offset(sz, mySize, 1), mySize * sz, x, icon, vertical, iconalign, left, color, (1 - fadelerp));
+ DrawNumIcon(myPos + expandingbox_resize_centered_box_offset(sz, mySize, 1), mySize * sz, x, icon, vertical, icon_right_align, color, (1 - fadelerp));
}
// Powerups (#2)
HUD_Panel_DrawProgressBar(pos, eX * 0.5 * mySize_x + eY * mySize_y, min(1, leftcnt/30), 0, (baralign == 1 || baralign == 3), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
}
if(leftcnt > 1)
- DrawNumIcon(pos, eX * 0.5 * mySize_x + eY * mySize_y, leftcnt, leftname, 0, iconalign, 1, '1 1 1', 1);
+ DrawNumIcon(pos, eX * 0.5 * mySize_x + eY * mySize_y, leftcnt, leftname, 0, (iconalign == 1 || iconalign == 3), '1 1 1', 1);
if(leftcnt <= 5)
- DrawNumIcon_expanding(pos, eX * 0.5 * mySize_x + eY * mySize_y, leftcnt, leftname, 0, iconalign, 1, '1 1 1', bound(0, (leftcnt - leftexact) / 0.5, 1));
+ DrawNumIcon_expanding(pos, eX * 0.5 * mySize_x + eY * mySize_y, leftcnt, leftname, 0, (iconalign == 1 || iconalign == 3), '1 1 1', bound(0, (leftcnt - leftexact) / 0.5, 1));
}
if(rightcnt)
HUD_Panel_DrawProgressBar(pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, min(1, rightcnt/30), 0, (baralign == 1 || baralign == 4), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
}
if(rightcnt > 1)
- DrawNumIcon(pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt, rightname, 0, iconalign, 0, '1 1 1', 1);
+ DrawNumIcon(pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt, rightname, 0, (iconalign == 1 || iconalign == 4), '1 1 1', 1);
if(rightcnt <= 5)
- DrawNumIcon_expanding(pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt, rightname, 0, iconalign, 0, '1 1 1', bound(0, (rightcnt - rightexact) / 0.5, 1));
+ DrawNumIcon_expanding(pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt, rightname, 0, (iconalign == 1 || iconalign == 4), '1 1 1', bound(0, (rightcnt - rightexact) / 0.5, 1));
}
}
else if (mySize_x/mySize_y > 1.5)
HUD_Panel_DrawProgressBar(pos, eX * mySize_x + eY * 0.5 * mySize_y, min(1, leftcnt/30), 0, (baralign == 1 || baralign == 3), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
}
if(leftcnt > 1)
- DrawNumIcon(pos, eX * mySize_x + eY * 0.5 * mySize_y, leftcnt, leftname, 0, iconalign, 1, '1 1 1', 1);
+ DrawNumIcon(pos, eX * mySize_x + eY * 0.5 * mySize_y, leftcnt, leftname, 0, (iconalign == 1 || iconalign == 3), '1 1 1', 1);
if(leftcnt <= 5)
- DrawNumIcon_expanding(pos, eX * mySize_x + eY * 0.5 * mySize_y, leftcnt, leftname, 0, iconalign, 1, '1 1 1', bound(0, (leftcnt - leftexact) / 0.5, 1));
+ DrawNumIcon_expanding(pos, eX * mySize_x + eY * 0.5 * mySize_y, leftcnt, leftname, 0, (iconalign == 1 || iconalign == 3), '1 1 1', bound(0, (leftcnt - leftexact) / 0.5, 1));
}
if(rightcnt)
HUD_Panel_DrawProgressBar(pos + eY * 0.5 * mySize_y, eX * mySize_x + eY * 0.5 * mySize_y, min(1, rightcnt/30), 0, (baralign == 1 || baralign == 4), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
}
if(rightcnt > 1)
- DrawNumIcon(pos + eY * 0.5 * mySize_y, eX * mySize_x + eY * 0.5 * mySize_y, rightcnt, rightname, 0, iconalign, 0, '1 1 1', 1);
+ DrawNumIcon(pos + eY * 0.5 * mySize_y, eX * mySize_x + eY * 0.5 * mySize_y, rightcnt, rightname, 0, (iconalign == 1 || iconalign == 4), '1 1 1', 1);
if(rightcnt <= 5)
- DrawNumIcon_expanding(pos + eY * 0.5 * mySize_y, eX * mySize_x + eY * 0.5 * mySize_y, rightcnt, rightname, 0, iconalign, 0, '1 1 1', bound(0, (rightcnt - rightexact) / 0.5, 1));
+ DrawNumIcon_expanding(pos + eY * 0.5 * mySize_y, eX * mySize_x + eY * 0.5 * mySize_y, rightcnt, rightname, 0, (iconalign == 1 || iconalign == 4), '1 1 1', bound(0, (rightcnt - rightexact) / 0.5, 1));
}
}
else
HUD_Panel_DrawProgressBar(pos, eX * 0.5 * mySize_x + eY * mySize_y, min(1, leftcnt/30), 1, (baralign == 1 || baralign == 3), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
}
if(leftcnt > 1)
- DrawNumIcon(pos, eX * mySize_x * 0.5 + eY * mySize_y, leftcnt, leftname, 1, iconalign, 1, '1 1 1', 1);
+ DrawNumIcon(pos, eX * mySize_x * 0.5 + eY * mySize_y, leftcnt, leftname, 1, (iconalign == 1 || iconalign == 3), '1 1 1', 1);
if(leftcnt <= 5)
- DrawNumIcon_expanding(pos, eX * mySize_x * 0.5 + eY * mySize_y, leftcnt, leftname, 1, iconalign, 1, '1 1 1', bound(0, (leftcnt - leftexact) / 0.5, 1));
+ DrawNumIcon_expanding(pos, eX * mySize_x * 0.5 + eY * mySize_y, leftcnt, leftname, 1, (iconalign == 1 || iconalign == 3), '1 1 1', bound(0, (leftcnt - leftexact) / 0.5, 1));
}
if(rightcnt)
HUD_Panel_DrawProgressBar(pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, min(1, rightcnt/30), 1, (baralign == 1 || baralign == 4), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
}
if(rightcnt > 1)
- DrawNumIcon(pos + eX * mySize_x * 0.5, eX * mySize_x * 0.5 + eY * mySize_y, rightcnt, rightname, 1, iconalign, 0, '1 1 1', 1);
+ DrawNumIcon(pos + eX * mySize_x * 0.5, eX * mySize_x * 0.5 + eY * mySize_y, rightcnt, rightname, 1, (iconalign == 1 || iconalign == 4), '1 1 1', 1);
if(rightcnt <= 5)
- DrawNumIcon_expanding(pos + eX * mySize_x * 0.5, eX * mySize_x * 0.5 + eY * mySize_y, rightcnt, rightname, 1, iconalign, 0, '1 1 1', bound(0, (rightcnt - rightexact) / 0.5, 1));
+ DrawNumIcon_expanding(pos + eX * mySize_x * 0.5, eX * mySize_x * 0.5 + eY * mySize_y, rightcnt, rightname, 1, (iconalign == 1 || iconalign == 4), '1 1 1', bound(0, (rightcnt - rightexact) / 0.5, 1));
}
}
drawfont = hud_font;
if(health)
drawpic_aspect_skin(pos + eX * mySize_x - eX * 0.5 * mySize_y, "health", '0.5 0.5 0' * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
}
- DrawNumIcon(pos, mySize, x, biggercount, 0, iconalign, 1, HUD_Get_Num_Color(x, 2 * 200), 1);
+ DrawNumIcon(pos, mySize, x, biggercount, 0, iconalign, HUD_Get_Num_Color(x, 2 * 200), 1);
if(fuel)
{
HUD_Panel_GetProgressBarColorForString(leftname);
HUD_Panel_DrawProgressBar(pos, eX * 0.5 * mySize_x + eY * mySize_y, min(1, leftcnt/200), 0, (baralign == 1 || baralign == 3), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
- DrawNumIcon(pos, eX * 0.5 * mySize_x + eY * mySize_y, leftcnt, leftname, 0, iconalign, 1, HUD_Get_Num_Color(leftcnt, 200), 1);
+ DrawNumIcon(pos, eX * 0.5 * mySize_x + eY * mySize_y, leftcnt, leftname, 0, (iconalign == 1 || iconalign == 3), HUD_Get_Num_Color(leftcnt, 200), 1);
}
if(rightactive)
HUD_Panel_GetProgressBarColorForString(rightname);
HUD_Panel_DrawProgressBar(pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, min(1, rightcnt/200), 0, (baralign == 1 || baralign == 4), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
- DrawNumIcon(pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt, rightname, 0, iconalign, 0, HUD_Get_Num_Color(rightcnt, 200), 1);
+ DrawNumIcon(pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt, rightname, 0, (iconalign == 1 || iconalign == 4), HUD_Get_Num_Color(rightcnt, 200), 1);
}
if(fuel)
HUD_Panel_GetProgressBarColorForString(leftname);
HUD_Panel_DrawProgressBar(pos, eX * mySize_x + eY * 0.5 * mySize_y, min(1, leftcnt/200), 0, (baralign == 1 || baralign == 3), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
- DrawNumIcon(pos, eX * mySize_x + eY * 0.5 * mySize_y, leftcnt, leftname, 0, iconalign, 1, HUD_Get_Num_Color(leftcnt, 200), 1);
+ DrawNumIcon(pos, eX * mySize_x + eY * 0.5 * mySize_y, leftcnt, leftname, 0, (iconalign == 1 || iconalign == 3), HUD_Get_Num_Color(leftcnt, 200), 1);
}
if(rightactive)
HUD_Panel_GetProgressBarColorForString(rightname);
HUD_Panel_DrawProgressBar(pos + eY * 0.5 * mySize_y, eX * mySize_x + eY * 0.5 * mySize_y, min(1, rightcnt/200), 0, (baralign == 1 || baralign == 4), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
- DrawNumIcon(pos + eY * 0.5 * mySize_y, eX * mySize_x + eY * 0.5 * mySize_y, rightcnt, rightname, 0, iconalign, 0, HUD_Get_Num_Color(rightcnt, 200), 1);
+ DrawNumIcon(pos + eY * 0.5 * mySize_y, eX * mySize_x + eY * 0.5 * mySize_y, rightcnt, rightname, 0, (iconalign == 1 || iconalign == 4), HUD_Get_Num_Color(rightcnt, 200), 1);
}
if(fuel)
HUD_Panel_GetProgressBarColorForString(leftname);
HUD_Panel_DrawProgressBar(pos, eX * 0.5 * mySize_x + eY * mySize_y, min(1, leftcnt/200), 1, (baralign == 1 || baralign == 3), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
- DrawNumIcon(pos, eX * 0.5 * mySize_x + eY * mySize_y, leftcnt, leftname, 1, iconalign, 1, HUD_Get_Num_Color(leftcnt, 200), 1);
+ DrawNumIcon(pos, eX * 0.5 * mySize_x + eY * mySize_y, leftcnt, leftname, 1, (iconalign == 1 || iconalign == 3), HUD_Get_Num_Color(leftcnt, 200), 1);
}
if(rightactive)
HUD_Panel_GetProgressBarColorForString(rightname);
HUD_Panel_DrawProgressBar(pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, min(1, rightcnt/200), 1, (baralign == 1 || baralign == 4), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
- DrawNumIcon(pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt, rightname, 1, iconalign, 0, HUD_Get_Num_Color(rightcnt, 200), 1);
+ DrawNumIcon(pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt, rightname, 1, (iconalign == 1 || iconalign == 4), HUD_Get_Num_Color(rightcnt, 200), 1);
}
if(fuel)