return;
float len;
+ vector barpos, barsize;
+ vector picpos;
+ vector numpos;
if(cvar("hud_healtharmor") == 2) // combined health and armor display
{
float x;
x = floor(v_x + 1);
+ if(cvar(strcat("hud_", HUD_Panel_GetName(id), "_mirror"))) {
+ barpos = pos + eX * mySize_x - eX * mySize_x * min(1, x/400);
+ barsize = eX * mySize_x * min(1, x/400) + eY * mySize_y;
+ picpos = pos;
+ numpos = picpos + eX * 1.5 * mySize_y;
+ } else {
+ barpos = pos;
+ barsize = eX * mySize_x * min(1, x/400) + eY * mySize_y;
+ picpos = pos + eX * 3 * mySize_y;
+ numpos = pos;
+ }
+
if(v_z) // NOT fully armored
{
- drawpic_skin(pos + eX * 3 * mySize_y, "health", '1 1 0' * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(barpos, 0, barsize, HUD_Panel_GetProgressBarColor("health"), cvar("hud_progressbar_alpha") * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ drawpic_skin(picpos, "health", '1 1 0' * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
if(armor)
- drawpic_skin(pos + eX * 4 * mySize_y, "armor", '0.5 0.5 0' * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id) * armor / health, DRAWFLAG_NORMAL);
+ drawpic_skin(picpos + eX * mySize_y, "armor", '0.5 0.5 0' * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id) * armor / health, DRAWFLAG_NORMAL);
}
else
{
- drawpic_skin(pos + eX * 4 * mySize_y, "health", '0.5 0.5 0' * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id) * health / armor, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(barpos, 0, barsize, HUD_Panel_GetProgressBarColor("armor"), cvar("hud_progressbar_alpha") * HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ drawpic_skin(picpos + eX * mySize_y, "health", '0.5 0.5 0' * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id) * health / armor, DRAWFLAG_NORMAL);
if(armor)
- drawpic_skin(pos + eX * 3 * mySize_y, "armor", '1 1 0' * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+ drawpic_skin(picpos, "armor", '1 1 0' * mySize_y, '1 1 1', HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
}
- HUD_DrawXNum_Colored(pos, x, 3, mySize_y, HUD_Panel_GetFgAlpha(id)); // draw the combined health and armor
+ HUD_DrawXNum_Colored(numpos, x, 3, mySize_y, HUD_Panel_GetFgAlpha(id)); // draw the combined health and armor
}
else
{
- vector barpos, barsize;
- vector picpos;
- vector numpos;
-
string leftname, rightname;
float leftcnt, rightcnt;
float leftactive, rightactive;
{
entity e;
me.TR(me);
- me.TR(me);
- me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "hud_healtharmor", "On/Off"));
- me.TR(me);
- me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Team Color:"));
- me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_healtharmor_bg_color_team"));
- me.TR(me);
- me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background Alpha:"));
- me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_healtharmor_bg_alpha"));
- me.TR(me);
- me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_healtharmor_flip", "Flip"));
- me.TR(me);
- me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_healtharmor_mirror", "Mirror"));
+ me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Status:"));
+ me.TD(me, 1, 2, e = makeXonoticTextSlider("hud_healtharmor"));
+ e.addValue(e, "Disabled", "0");
+ e.addValue(e, "Enabled", "1");
+ e.addValue(e, "Combined h/a", "2");
+ e.configureXonoticTextSliderValues(e);
me.TR(me);
+
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Team Color:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_healtharmor_bg_color_team"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background Alpha:"));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_healtharmor_bg_alpha"));
+ me.TR(me);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_healtharmor_flip", "Flip"));
+ me.TR(me);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_healtharmor_mirror", "Mirror"));
//me.gotoRC(me, me.rows - 1, 0);
//me.TD(me, 1, me.columns, e = makeXonoticCommandButton("Exit Setup", '0 0 0', "_hud_configure 0", 1));
}
{
entity e;
me.TR(me);
- me.TD(me, 1, 4, makeXonoticTextLabel(0, "Panel Settings:"));
+ me.TD(me, 1, 4, makeXonoticTextLabel(0, "Panel Defaults:"));
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_bg", "Panel Background"));
me.TR(me);