From: terencehill Date: Thu, 9 Dec 2010 18:02:57 +0000 (+0100) Subject: Merge branch 'master' into terencehill/newpanelhud X-Git-Tag: xonotic-v0.5.0~372 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=5dc4bd363b8216f79266979e39a3cbb60a9ffe94 Merge branch 'master' into terencehill/newpanelhud Conflicts: qcsrc/client/autocvars.qh qcsrc/client/hud.qc qcsrc/client/scoreboard.qc --- 5dc4bd363b8216f79266979e39a3cbb60a9ffe94 diff --cc qcsrc/client/hud.qc index ff28378412,5536cec21e..318fd39771 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@@ -970,10 -932,10 +970,10 @@@ void HUD_Panel_Arrow_Action(float nPrim if (highlightedPanel_prev == -1 || mouseClicked) return; - hud_configure_checkcollisions = (!(hudShiftState & S_CTRL) && cvar("hud_configure_checkcollisions")); + hud_configure_checkcollisions = (!(hudShiftState & S_CTRL) && autocvar_hud_configure_checkcollisions); float step; - if(autocvar_hud_configure_grid) + if(cvar("hud_configure_grid")) { if (nPrimary == K_UPARROW || nPrimary == K_DOWNARROW) { @@@ -1466,13 -1442,13 +1466,13 @@@ void HUD_Panel_Mouse( cursorsize = '32 32 0'; if(highlightcheck == 0) - drawpic(mousepos, strcat("gfx/menu/", cvar_string("menu_skin"), "/cursor.tga"), cursorsize, '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL); - drawpic(mousepos, strcat("gfx/menu/", autocvar_menu_skin, "/cursor.tga"), '32 32 0', '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL); ++ drawpic(mousepos, strcat("gfx/menu/", autocvar_menu_skin, "/cursor.tga"), cursorsize, '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL); else if(highlightcheck == 1) - drawpic(mousepos - cursorsize * 0.5, strcat("gfx/menu/", cvar_string("menu_skin"), "/cursor_move.tga"), cursorsize, '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL); - drawpic(mousepos - cursorsize * 0.5, strcat("gfx/menu/", autocvar_menu_skin, "/cursor_move.tga"), '32 32 0', '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL); ++ drawpic(mousepos - cursorsize * 0.5, strcat("gfx/menu/", autocvar_menu_skin, "/cursor_move.tga"), cursorsize, '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL); else if(highlightcheck == 2) - drawpic(mousepos - cursorsize * 0.5, strcat("gfx/menu/", cvar_string("menu_skin"), "/cursor_resize.tga"), cursorsize, '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL); - drawpic(mousepos - cursorsize * 0.5, strcat("gfx/menu/", autocvar_menu_skin, "/cursor_resize.tga"), '32 32 0', '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL); ++ drawpic(mousepos - cursorsize * 0.5, strcat("gfx/menu/", autocvar_menu_skin, "/cursor_resize.tga"), cursorsize, '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL); else - drawpic(mousepos - cursorsize * 0.5, strcat("gfx/menu/", cvar_string("menu_skin"), "/cursor_resize2.tga"), cursorsize, '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL); - drawpic(mousepos - cursorsize * 0.5, strcat("gfx/menu/", autocvar_menu_skin, "/cursor_resize2.tga"), '32 32 0', '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL); ++ drawpic(mousepos - cursorsize * 0.5, strcat("gfx/menu/", autocvar_menu_skin, "/cursor_resize2.tga"), cursorsize, '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL); prevMouseClicked = mouseClicked; } @@@ -1544,15 -1520,12 +1544,15 @@@ void HUD_Weapons(void float f, screen_ar; float center_x, center_y; - if(!autocvar_hud_panel_weapons && !autocvar__hud_configure) - return; + if(!autocvar__hud_configure) + { + if(!autocvar_hud_panel_weapons) return; + if(spectatee_status == -1) return; + } - float timeout = cvar("hud_panel_weapons_timeout"); + float timeout = autocvar_hud_panel_weapons_timeout; float timeout_effect_length, timein_effect_length; - if (cvar("hud_panel_weapons_timeout_effect") == 0) + if (autocvar_hud_panel_weapons_timeout_effect == 0) { timeout_effect_length = 0; timein_effect_length = 0; @@@ -1942,10 -1915,10 +1942,10 @@@ void DrawAmmoItem(vector myPos, vector if (currently_selected) drawpic_aspect_skin(myPos, "ammo_current_bg", mySize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); - if(a > 0 && cvar("hud_panel_ammo_progressbar")) - HUD_Panel_DrawProgressBar(myPos + eX * cvar("hud_panel_ammo_progressbar_xoffset") * mySize_x, mySize - eX * cvar("hud_panel_ammo_progressbar_xoffset") * mySize_x, cvar_string("hud_panel_ammo_progressbar_name"), 0, 0, a/cvar("hud_panel_ammo_maxammo"), color, autocvar_hud_progressbar_alpha * panel_fg_alpha * alpha, DRAWFLAG_NORMAL); + if(a > 0 && autocvar_hud_panel_ammo_progressbar) - HUD_Panel_DrawProgressBar(myPos + eX * autocvar_hud_panel_ammo_progressbar_xoffset * mySize_x, mySize - eX * autocvar_hud_panel_ammo_progressbar_xoffset * mySize_x, autocvar_hud_panel_ammo_progressbar_name, 0, 0, min(1, a/autocvar_hud_panel_ammo_maxammo), color, autocvar_hud_progressbar_alpha * panel_fg_alpha * alpha, DRAWFLAG_NORMAL); ++ HUD_Panel_DrawProgressBar(myPos + eX * autocvar_hud_panel_ammo_progressbar_xoffset * mySize_x, mySize - eX * autocvar_hud_panel_ammo_progressbar_xoffset * mySize_x, autocvar_hud_panel_ammo_progressbar_name, 0, 0, a/autocvar_hud_panel_ammo_maxammo, color, autocvar_hud_progressbar_alpha * panel_fg_alpha * alpha, DRAWFLAG_NORMAL); - if(cvar("hud_panel_ammo_text")) + if(autocvar_hud_panel_ammo_text) { if(a > 0) drawstring_aspect(numpos, ftos(a), eX * (2/3) * mySize_x + eY * mySize_y, color, panel_fg_alpha * alpha, DRAWFLAG_NORMAL); @@@ -2175,9 -2127,10 +2175,9 @@@ void HUD_Powerups(void) string leftprogressname, rightprogressname; float leftcnt, rightcnt; float leftexact, rightexact; - if (cvar("hud_panel_powerups_flip")) { - float flip = autocvar_hud_panel_powerups_flip; - if (flip) { ++ if (autocvar_hud_panel_powerups_flip) { leftname = "strength"; - leftprogressname = cvar_string("hud_panel_powerups_progressbar_strength"); + leftprogressname = autocvar_hud_panel_powerups_progressbar_strength; leftcnt = ceil(strength_time); leftexact = strength_time; @@@ -2198,12 -2151,11 +2198,12 @@@ } drawfont = hud_bigfont; - float baralign = cvar("hud_panel_powerups_baralign"); - float iconalign = cvar("hud_panel_powerups_iconalign"); - float progressbar = cvar("hud_panel_powerups_progressbar"); + float baralign = autocvar_hud_panel_powerups_baralign; - float barflip; + float iconalign = autocvar_hud_panel_powerups_iconalign; + float progressbar = autocvar_hud_panel_powerups_progressbar; - if (mySize_x/mySize_y > 4) + float panel_ar = mySize_x/mySize_y; + float is_vertical = (panel_ar < 1); + if (panel_ar >= 4 || (panel_ar >= 1/4 && panel_ar < 1)) { barsize = eX * 0.5 * mySize_x + eY * mySize_y; if(leftcnt) @@@ -2211,15 -2163,73 +2211,15 @@@ if(progressbar) { HUD_Panel_GetProgressBarColorForString(leftname); - HUD_Panel_DrawProgressBar(barpos, barsize, leftprogressname, 0, barflip, min(1, leftcnt/30), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL); + HUD_Panel_DrawProgressBar(pos, barsize, leftprogressname, leftcnt/30, is_vertical, (baralign == 1 || baralign == 2), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL); } - if(cvar("hud_panel_powerups_text")) + if(autocvar_hud_panel_powerups_text) { - if(leftcnt > 1) - DrawNumIcon(iconalign, pos, eX * 0.5 * mySize_x + eY * mySize_y, leftcnt, leftname, 1, '1 1 1', 1); - if(leftcnt <= 5) - DrawNumIcon_expanding(iconalign, pos, eX * 0.5 * mySize_x + eY * mySize_y, leftcnt, leftname, 1, '1 1 1', bound(0, (leftcnt - leftexact) / 0.5, 1)); - } - } - - if(rightcnt) - { - if(baralign == 0 || baralign == 3) { // left align - barpos = pos; - barflip = 0; - } else { // right align - barpos = pos + eX * 0.5 * mySize_x; - barflip = 1; + if(leftcnt > 1) + DrawNumIcon(pos, barsize, leftcnt, leftname, is_vertical, (iconalign == 1 || iconalign == 2), '1 1 1', 1); + if(leftcnt <= 5) + DrawNumIcon_expanding(pos, barsize, leftcnt, leftname, is_vertical, (iconalign == 1 || iconalign == 2), '1 1 1', bound(0, (leftcnt - leftexact) / 0.5, 1)); } - - if(progressbar) - { - HUD_Panel_GetProgressBarColorForString(rightname); - HUD_Panel_DrawProgressBar(barpos, barsize, rightprogressname, 0, barflip, min(1, rightcnt/30), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL); - } - if(autocvar_hud_panel_powerups_text) - { - if(rightcnt > 1) - DrawNumIcon(iconalign, pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt, rightname, 0, '1 1 1', 1); - if(rightcnt <= 5) - DrawNumIcon_expanding(iconalign, pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt, rightname, 0, '1 1 1', bound(0, (rightcnt - rightexact) / 0.5, 1)); - } - } - } - else if (mySize_x/mySize_y > 1.5) - { - barsize = eX * mySize_x + eY * 0.5 * mySize_y; - if(leftcnt) - { - barpos = pos; - if(baralign == 1 || baralign == 3) { // right/down align - barflip = 1; - } else { // left/up align - barflip = 0; - } - - if(progressbar) - { - HUD_Panel_GetProgressBarColorForString(leftname); - HUD_Panel_DrawProgressBar(barpos, barsize, leftprogressname, 0, barflip, min(1, leftcnt/30), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL); - } - if(autocvar_hud_panel_powerups_text) - { - if(leftcnt > 1) - DrawNumIcon(iconalign, pos, eX * mySize_x + eY * 0.5 * mySize_y, leftcnt, leftname, 1, '1 1 1', 1); - if(leftcnt <= 5) - DrawNumIcon_expanding(iconalign, pos, eX * mySize_x + eY * 0.5 * mySize_y, leftcnt, leftname, 1, '1 1 1', bound(0, (leftcnt - leftexact) / 0.5, 1)); - } } if(rightcnt) @@@ -2228,15 -2244,15 +2228,15 @@@ if(progressbar) { HUD_Panel_GetProgressBarColorForString(rightname); - HUD_Panel_DrawProgressBar(barpos, barsize, rightprogressname, 0, barflip, min(1, rightcnt/30), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL); + HUD_Panel_DrawProgressBar(pos, barsize, rightprogressname, rightcnt/30, is_vertical, (baralign == 1 || baralign == 3), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL); } - if(cvar("hud_panel_powerups_text")) + if(autocvar_hud_panel_powerups_text) { - if(rightcnt > 1) - DrawNumIcon(iconalign, pos + eY * 0.5 * mySize_y, eX * mySize_x + eY * 0.5 * mySize_y, rightcnt, rightname, 0, '1 1 1', 1); - if(rightcnt <= 5) - DrawNumIcon_expanding(iconalign, pos + eY * 0.5 * mySize_y, eX * mySize_x + eY * 0.5 * mySize_y, rightcnt, rightname, 0, '1 1 1', bound(0, (rightcnt - rightexact) / 0.5, 1)); - } + if(rightcnt > 1) + DrawNumIcon(pos, barsize, rightcnt, rightname, is_vertical, (iconalign == 1 || iconalign == 3), '1 1 1', 1); + if(rightcnt <= 5) + DrawNumIcon_expanding(pos, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt, rightname, is_vertical, (iconalign == 1 || iconalign == 3), '1 1 1', bound(0, (rightcnt - rightexact) / 0.5, 1)); + } } } else @@@ -2247,15 -2263,31 +2247,15 @@@ if(progressbar) { HUD_Panel_GetProgressBarColorForString(leftname); - HUD_Panel_DrawProgressBar(barpos, barsize, leftprogressname, 1, barflip, min(1, leftcnt/30), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL); + HUD_Panel_DrawProgressBar(pos, barsize, leftprogressname, leftcnt/30, is_vertical, (baralign == 1 || baralign == 2), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL); } - if(cvar("hud_panel_powerups_text")) + if(autocvar_hud_panel_powerups_text) { - if(leftcnt <= 5) - drawpic_aspect_skin_expanding(picpos, leftname, '0.4 0.4 0' * mySize_x, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, bound(0, (leftcnt - leftexact) / 0.5, 1)); - if(leftcnt > 1) - drawpic_aspect_skin(picpos, leftname, '0.4 0.4 0' * mySize_x, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); - drawstring_aspect(numpos, ftos(leftcnt), eX * 0.5 * mySize_x + eY * 0.25 * mySize_x, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); - } + if(leftcnt > 1) + DrawNumIcon(pos, barsize, leftcnt, leftname, is_vertical, (iconalign == 1 || iconalign == 2), '1 1 1', 1); + if(leftcnt <= 5) + DrawNumIcon_expanding(pos, barsize, leftcnt, leftname, is_vertical, (iconalign == 1 || iconalign == 2), '1 1 1', bound(0, (leftcnt - leftexact) / 0.5, 1)); + } } if(rightcnt) @@@ -2264,15 -2310,16 +2264,15 @@@ if(progressbar) { HUD_Panel_GetProgressBarColorForString(rightname); - HUD_Panel_DrawProgressBar(barpos, barsize, rightprogressname, 1, barflip, min(1, rightcnt/30), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL); + HUD_Panel_DrawProgressBar(pos, barsize, rightprogressname, rightcnt/30, is_vertical, (baralign == 1 || baralign == 3), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL); } - if(cvar("hud_panel_powerups_text")) + if(autocvar_hud_panel_powerups_text) { - if(rightcnt <= 5) - drawpic_aspect_skin_expanding(picpos, rightname, '0.4 0.4 0' * mySize_x, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, bound(0, (rightcnt - rightexact) / 0.5, 1)); - if(rightcnt > 1) - drawpic_aspect_skin(picpos, rightname, '0.4 0.4 0' * mySize_x, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); - drawstring_aspect(numpos, ftos(rightcnt), eX * 0.5 * mySize_x + eY * 0.25 * mySize_x, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); - } + if(rightcnt > 1) + DrawNumIcon(pos, barsize, rightcnt, rightname, is_vertical, (iconalign == 1 || iconalign == 3), '1 1 1', 1); + if(rightcnt <= 5) + DrawNumIcon_expanding(pos, barsize, rightcnt, rightname, is_vertical, (iconalign == 1 || iconalign == 3), '1 1 1', bound(0, (rightcnt - rightexact) / 0.5, 1)); + } } } drawfont = hud_font; @@@ -2316,16 -2360,17 +2316,16 @@@ void HUD_HealthArmor(void if(health <= 0) return; - vector barpos, barsize; - vector picpos; - vector numpos; + vector barsize; + vector picpos, numpos; drawfont = hud_bigfont; - float baralign = cvar("hud_panel_healtharmor_baralign"); - float iconalign = cvar("hud_panel_healtharmor_iconalign"); - float progressbar = cvar("hud_panel_healtharmor_progressbar"); + float baralign = autocvar_hud_panel_healtharmor_baralign; + float iconalign = autocvar_hud_panel_healtharmor_iconalign; + float progressbar = autocvar_hud_panel_healtharmor_progressbar; - float maxhealth = cvar("hud_panel_healtharmor_maxhealth"); - float maxarmor = cvar("hud_panel_healtharmor_maxarmor"); + float maxhealth = autocvar_hud_panel_healtharmor_maxhealth; + float maxarmor = autocvar_hud_panel_healtharmor_maxarmor; if(autocvar_hud_panel_healtharmor == 2) // combined health and armor display { vector v; @@@ -2342,10 -2391,10 +2342,10 @@@ if(progressbar) { HUD_Panel_GetProgressBarColor(health); - HUD_Panel_DrawProgressBar(pos, mySize, cvar_string("hud_panel_healtharmor_progressbar_health"), x/maxtotal, 0, (baralign == 1 || baralign == 2), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); - HUD_Panel_DrawProgressBar(barpos, barsize, autocvar_hud_panel_healtharmor_progressbar_health, 0, mod(baralign, 2), x/maxtotal, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); ++ HUD_Panel_DrawProgressBar(pos, mySize, autocvar_hud_panel_healtharmor_progressbar_health, x/maxtotal, 0, (baralign == 1 || baralign == 2), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); } if(armor) - if(cvar("hud_panel_healtharmor_text")) + if(autocvar_hud_panel_healtharmor_text) drawpic_aspect_skin(pos + eX * mySize_x - eX * 0.5 * mySize_y, "armor", '0.5 0.5 0' * mySize_y, '1 1 1', panel_fg_alpha * armor / health, DRAWFLAG_NORMAL); } else @@@ -2354,19 -2403,22 +2354,19 @@@ if(progressbar) { HUD_Panel_GetProgressBarColor(armor); - HUD_Panel_DrawProgressBar(pos, mySize, cvar_string("hud_panel_healtharmor_progressbar_armor"), x/maxtotal, 0, (baralign == 1 || baralign == 2), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); - HUD_Panel_DrawProgressBar(barpos, barsize, autocvar_hud_panel_healtharmor_progressbar_armor, 0, mod(baralign, 2), x/maxtotal, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); ++ HUD_Panel_DrawProgressBar(pos, mySize, autocvar_hud_panel_healtharmor_progressbar_armor, x/maxtotal, 0, (baralign == 1 || baralign == 2), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); } if(health) - if(cvar("hud_panel_healtharmor_text")) + if(autocvar_hud_panel_healtharmor_text) 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); } - if(cvar("hud_panel_healtharmor_text")) + if(autocvar_hud_panel_healtharmor_text) - DrawNumIcon(iconalign, pos, mySize, x, biggercount, 1, HUD_Get_Num_Color(x, maxtotal), 1); + DrawNumIcon(pos, mySize, x, biggercount, 0, iconalign, HUD_Get_Num_Color(x, maxtotal), 1); - // fuel if(fuel) { - barpos = pos; - barsize = eX * mySize_x + eY * 0.2 * mySize_y; HUD_Panel_GetProgressBarColor(fuel); - HUD_Panel_DrawProgressBar(barpos, barsize, "progressbar", 0, mod(baralign, 2), min(1, fuel/100), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * 0.8, DRAWFLAG_NORMAL); + HUD_Panel_DrawProgressBar(pos, eX * mySize_x + eY * 0.2 * mySize_y, "progressbar", fuel/100, 0, (baralign == 1 || baralign == 3), progressbar_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL); } } else @@@ -2377,9 -2429,11 +2377,9 @@@ float leftmax, rightmax; float leftactive, rightactive; float leftalpha, rightalpha; - if (cvar("hud_panel_healtharmor_flip")) { // layout with armor left/top of health - float flip = autocvar_hud_panel_healtharmor_flip; - float barflip; - if (flip) { // old style layout with armor left/top of health ++ if (autocvar_hud_panel_healtharmor_flip) { // old style layout with armor left/top of health leftname = "armor"; - leftprogressname = cvar_string("hud_panel_healtharmor_progressbar_armor"); + leftprogressname = autocvar_hud_panel_healtharmor_progressbar_armor; leftcnt = armor; if(leftcnt) leftactive = 1; @@@ -2419,10 -2471,17 +2419,10 @@@ if(progressbar) { HUD_Panel_GetProgressBarColorForString(leftname); - HUD_Panel_DrawProgressBar(pos, barsize, leftprogressname, leftcnt/200, is_vertical, (baralign == 1 || baralign == 2), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); - HUD_Panel_DrawProgressBar(barpos, barsize, leftprogressname, 0, barflip, min(1, leftcnt/leftmax), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); ++ HUD_Panel_DrawProgressBar(pos, barsize, leftprogressname, leftcnt/leftmax, is_vertical, (baralign == 1 || baralign == 2), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); } - if(cvar("hud_panel_healtharmor_text")) - DrawNumIcon(pos, barsize, leftcnt, leftname, is_vertical, (iconalign == 1 || iconalign == 2), HUD_Get_Num_Color(leftcnt, 200), 1); - if(autocvar_hud_panel_healtharmor_text) - DrawNumIcon(iconalign, pos, eX * 0.5 * mySize_x + eY * mySize_y, leftcnt, leftname, 1, HUD_Get_Num_Color(leftcnt, leftmax), 1); ++ if(autocvar_hud_panel_healtharmor_text) ++ DrawNumIcon(pos, barsize, leftcnt, leftname, is_vertical, (iconalign == 1 || iconalign == 2), HUD_Get_Num_Color(leftcnt, leftmax), 1); } if(rightactive) @@@ -2430,10 -2489,17 +2430,10 @@@ if(progressbar) { HUD_Panel_GetProgressBarColorForString(rightname); - HUD_Panel_DrawProgressBar(pos + eX * 0.5 * mySize_x, barsize, rightprogressname, rightcnt/200, is_vertical, (baralign == 1 || baralign == 3), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); - HUD_Panel_DrawProgressBar(barpos, barsize, rightprogressname, 0, barflip, min(1, rightcnt/rightmax), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); ++ HUD_Panel_DrawProgressBar(pos + eX * 0.5 * mySize_x, barsize, rightprogressname, rightcnt/rightmax, is_vertical, (baralign == 1 || baralign == 3), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); } - if(cvar("hud_panel_healtharmor_text")) - DrawNumIcon(pos + eX * 0.5 * mySize_x, barsize, rightcnt, rightname, is_vertical, (iconalign == 1 || iconalign == 3), HUD_Get_Num_Color(rightcnt, 200), 1); - if(autocvar_hud_panel_healtharmor_text) - DrawNumIcon(iconalign, pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt, rightname, 0, HUD_Get_Num_Color(rightcnt, rightmax), 1); ++ if(autocvar_hud_panel_healtharmor_text) ++ DrawNumIcon(pos + eX * 0.5 * mySize_x, barsize, rightcnt, rightname, is_vertical, (iconalign == 1 || iconalign == 3), HUD_Get_Num_Color(rightcnt, rightmax), 1); } if(fuel) @@@ -2448,16 -2559,34 +2448,16 @@@ } else { -- barsize = eX * 0.5 * mySize_x + eY * mySize_y; ++ barsize = eX * mySize_x + eY * 0.5 * mySize_y; if(leftactive) { - barpos = pos; - if(baralign == 1 || baralign == 3) { // right align - barflip = 1; - } else { // left align - barflip = 0; - } - - if(iconalign == 1 || iconalign == 3) { // down align - picpos = pos + eX * 0.05 * mySize_x + eY * (mySize_y - 0.65 * mySize_x); - numpos = pos + eY * mySize_y - eY * 0.25 * mySize_x; - } else { // up align - picpos = pos + eX * 0.05 * mySize_x; - numpos = pos + eY * 0.4 * mySize_x; - } - if(progressbar) { HUD_Panel_GetProgressBarColorForString(leftname); - HUD_Panel_DrawProgressBar(pos, barsize, leftprogressname, leftcnt/200, is_vertical, (baralign == 1 || baralign == 2), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); - HUD_Panel_DrawProgressBar(barpos, barsize, leftprogressname, 1, barflip, min(1, leftcnt/leftmax), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); ++ HUD_Panel_DrawProgressBar(pos, barsize, leftprogressname, leftcnt/leftmax, is_vertical, (baralign == 1 || baralign == 2), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); } - if(cvar("hud_panel_healtharmor_text")) - DrawNumIcon(pos, barsize, leftcnt, leftname, is_vertical, (iconalign == 1 || iconalign == 2), HUD_Get_Num_Color(leftcnt, 200), 1); - if(autocvar_hud_panel_healtharmor_text) - { - drawpic_aspect_skin(picpos, leftname, '0.4 0.4 0' * mySize_x, '1 1 1', leftalpha * panel_fg_alpha, DRAWFLAG_NORMAL); - drawstring_aspect(numpos, ftos(leftcnt), eX * 0.5 * mySize_x + eY * 0.25 * mySize_x, HUD_Get_Num_Color(leftcnt, leftmax), panel_fg_alpha, DRAWFLAG_NORMAL); - } ++ if(autocvar_hud_panel_healtharmor_text) ++ DrawNumIcon(pos, barsize, leftcnt, leftname, is_vertical, (iconalign == 1 || iconalign == 2), HUD_Get_Num_Color(leftcnt, leftmax), 1); } if(rightactive) @@@ -2465,10 -2594,28 +2465,10 @@@ if(progressbar) { HUD_Panel_GetProgressBarColorForString(rightname); - HUD_Panel_DrawProgressBar(pos + eY * 0.5 * mySize_y, barsize, rightprogressname, rightcnt/200, is_vertical, (baralign == 1 || baralign == 3), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); - HUD_Panel_DrawProgressBar(barpos, barsize, rightprogressname, 1, barflip, min(1, rightcnt/rightmax), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); ++ HUD_Panel_DrawProgressBar(pos + eY * 0.5 * mySize_y, barsize, rightprogressname, rightcnt/rightmax, is_vertical, (baralign == 1 || baralign == 3), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); } - if(cvar("hud_panel_healtharmor_text")) - DrawNumIcon(pos + eY * 0.5 * mySize_y, barsize, rightcnt, rightname, is_vertical, (iconalign == 1 || iconalign == 3), HUD_Get_Num_Color(rightcnt, 200), 1); - if(autocvar_hud_panel_healtharmor_text) - { - drawpic_aspect_skin(picpos, rightname, '0.4 0.4 0' * mySize_x, '1 1 1', rightalpha * panel_fg_alpha, DRAWFLAG_NORMAL); - drawstring_aspect(numpos, ftos(rightcnt), eX * 0.5 * mySize_x + eY * 0.25 * mySize_x, HUD_Get_Num_Color(rightcnt, rightmax), panel_fg_alpha, DRAWFLAG_NORMAL); - } ++ if(autocvar_hud_panel_healtharmor_text) ++ DrawNumIcon(pos + eY * 0.5 * mySize_y, barsize, rightcnt, rightname, is_vertical, (iconalign == 1 || iconalign == 3), HUD_Get_Num_Color(rightcnt, rightmax), 1); } if(fuel) @@@ -5069,10 -5087,12 +5069,10 @@@ float acc_avg void HUD_ShowAcceleration(void) { float acceleration, sz, scale, alpha, f; - vector pos, top, rgb; - top_x = vid_conwidth/2; - top_y = 0; + vector pos, mySize, rgb; f = time - acc_prevtime; - if(cvar("cl_showacceleration_z")) + if(autocvar_cl_showacceleration_z) acceleration = (vlen(pmove_vel) - vlen(acc_prevspeed)) * (1 / f); else acceleration = (vlen(pmove_vel - '0 0 1' * pmove_vel_z) - vlen(acc_prevspeed - '0 0 1' * acc_prevspeed_z)) * (1 / f); @@@ -5085,11 -5105,13 +5085,11 @@@ if (acceleration == 0) return; - sz = cvar("cl_showacceleration_size"); - scale = cvar("cl_showacceleration_scale"); - alpha = cvar("cl_showacceleration_alpha"); - if (cvar("cl_showacceleration_color_custom")) - rgb = stov(cvar_string("cl_showacceleration_color")); - pos = top - sz/2 * eY + (autocvar_cl_showacceleration_position * vid_conheight) * eY; - + sz = autocvar_cl_showacceleration_size; + scale = autocvar_cl_showacceleration_scale; + alpha = autocvar_cl_showacceleration_alpha; + if (autocvar_cl_showacceleration_color_custom) + rgb = stov(autocvar_cl_showacceleration_color); else { if (acceleration < 0) rgb = '1 .5 .5' - '0 .5 .5' * bound(0, -acceleration * 0.2, 1); @@@ -5097,19 -5119,10 +5097,19 @@@ rgb = '.5 1 .5' - '.5 0 .5' * bound(0, +acceleration * 0.2, 1); } + mySize_x = vid_conwidth/2; + mySize_y = sz; - pos_y = cvar("cl_showacceleration_position") * vid_conheight - sz/2; ++ pos_y = autocvar_cl_showacceleration_position * vid_conheight - sz/2; if (acceleration > 0) - HUD_Panel_DrawProgressBar(pos, eX * (vid_conwidth - pos_x) + eY * sz, "statusbar", 0, 0, acceleration * scale, rgb, alpha * autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); + { + pos_x = mySize_x; + HUD_Panel_DrawProgressBar(pos, mySize, "statusbar", acceleration * scale, 0, 0, rgb, alpha * autocvar_hud_panel_fg_alpha * hud_fade_alpha, DRAWFLAG_NORMAL); + } else - HUD_Panel_DrawProgressBar(eY * pos_y, eX * pos_x + eY * sz, "statusbar", 0, 1, -acceleration * scale, rgb, alpha * autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); + { + //pos_x = 0; + HUD_Panel_DrawProgressBar(pos, mySize, "statusbar", -acceleration * scale, 0, 1, rgb, alpha * autocvar_hud_panel_fg_alpha * hud_fade_alpha, DRAWFLAG_NORMAL); + } } void HUD_Reset (void) diff --cc qcsrc/client/scoreboard.qc index 8738c5d81b,502c4481bc..0896689749 --- a/qcsrc/client/scoreboard.qc +++ b/qcsrc/client/scoreboard.qc @@@ -883,7 -883,7 +883,7 @@@ float HUD_WouldDrawScoreboard() return 1; else if (intermission == 1) return 1; - else if (spectatee_status != -1 && getstati(STAT_HEALTH) <= 0 && cvar("cl_deathscoreboard")) - else if (getstati(STAT_HEALTH) <= 0 && autocvar_cl_deathscoreboard) ++ else if (spectatee_status != -1 && getstati(STAT_HEALTH) <= 0 && autocvar_cl_deathscoreboard) return 1; else if (scoreboard_showscores_force) return 1;