float ts_primary, ts_secondary;\r
\r
vector color;\r
-float SCOREBOARD_OFFSET = 50;\r
\r
void CSQC_kh_hudreset();\r
void CSQC_kh_hud();\r
sbar_field[sbar_num_fields] = SP_SEPARATOR;\r
have_separator = 1;\r
} else {\r
+ if(gametype == GAME_RPG)\r
+ return;\r
+\r
for(j = 0; j < MAX_SCORE; ++j)\r
if(str == strtolower(scores_label[j]))\r
goto found; // sorry, but otherwise fteqcc -O3 miscompiles this and warns about "unreachable code"\r
:notfound\r
- if(str == "frags" && !(gametype == GAME_RPG))\r
- {\r
+ if(str == "frags")\r
j = SP_FRAGS;\r
- }\r
else\r
{\r
if not(nocomplain)\r
for(fieldcounter = 1; fieldcounter <= field_number; ++fieldcounter)\r
{\r
field = -fieldcounter;\r
- if(field == SP_SEPARATOR)\r
- break;\r
-\r
str = Sbar_GetStomachField(pl, field);\r
\r
// row highlighting\r
if(field == ST_HIGHLIGHT)\r
{\r
- if(getstati(STAT_STOMACH_EATEN))\r
- drawfill(pos - '0 0 0', '193 11 0', stov(cvar_string("sbar_stomachboard_color2")), cvar("sbar_stomachboard_highlight_alpha"), DRAWFLAG_NORMAL);\r
+ if(getstati(STAT_VORE_EATEN))\r
+ drawfill(pos - '0 0 0', '193 11 0', stov(cvar_string("sbar_stomachboard_color2")), cvar("sbar_stomachboard_highlight_alpha") * sbar_alpha_fg, DRAWFLAG_NORMAL);\r
else\r
- drawfill(pos - '0 0 0', '193 11 0', stov(cvar_string("sbar_stomachboard_color1")), cvar("sbar_stomachboard_highlight_alpha"), DRAWFLAG_NORMAL);\r
+ drawfill(pos - '0 0 0', '193 11 0', stov(cvar_string("sbar_stomachboard_color1")), cvar("sbar_stomachboard_highlight_alpha") * sbar_alpha_fg, DRAWFLAG_NORMAL);\r
}\r
\r
if(field == ST_NAME) {\r
drawpic(pos, "gfx/sb_playercolor_pants", '22 11 0', colormapPaletteColor(mod(f, 16), 1), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
\r
pos_x += 24;\r
- drawcolorcodedstring(pos, str, '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ drawcolorcodedstring(pos, textShortenToWidth(str, 138, '11 11 0', stringwidth_colors), '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
}\r
\r
if(field == ST_HEALTH)\r
for(fieldcounter2 = 1; fieldcounter2 <= field_number; ++fieldcounter2)\r
{\r
field = -fieldcounter2;\r
- if(field == SP_SEPARATOR)\r
- break;\r
-\r
str = Sbar_GetStomachFieldPred(pl, field);\r
\r
if(field == STP_NAME) {\r
drawpic(pos, "gfx/sb_playercolor_pants", '22 11 0', colormapPaletteColor(mod(f, 16), 1), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
\r
pos_x += 24;\r
- drawcolorcodedstring(pos, str, '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ drawcolorcodedstring(pos, textShortenToWidth(str, 122, '11 11 0', stringwidth_colors), '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
}\r
}\r
}\r
sbwidth = Sbar_GetWidth(6.5 * sbar_fontsize_y);\r
\r
xmin = 0.5 * (vid_conwidth - sbwidth);\r
- ymin = SCOREBOARD_OFFSET;\r
+ ymin = cvar("sbar_scoreboard_offset");\r
\r
xmax = vid_conwidth - xmin;\r
ymax = vid_conheight - 0.2*vid_conheight;\r
\r
drawfont = sbar_bigfont;\r
pos_x = 0;\r
- pos_y = SCOREBOARD_OFFSET;\r
+ pos_y = cvar("sbar_scoreboard_offset");\r
pos_z = 0;\r
drawstringcenter(pos, "Weapon Accuracy", 2 * sbar_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
\r
return;\r
}\r
\r
- float top_border_hitscan = SCOREBOARD_OFFSET + 55; // position where the hitscan row starts: pixels down the screen\r
+ float top_border_hitscan = cvar("sbar_scoreboard_offset") + 55; // position where the hitscan row starts: pixels down the screen\r
Sbar_DrawAccuracyStats_Description_Hitscan('1 0 0' * col_margin + '0 1 0' * top_border_hitscan);\r
\r
- float top_border_splash = SCOREBOARD_OFFSET + 175; // position where the splash row starts: pixels down the screen\r
+ float top_border_splash = cvar("sbar_scoreboard_offset") + 175; // position where the splash row starts: pixels down the screen\r
Sbar_DrawAccuracyStats_Description_Splash('1 0 0' * col_margin + '0 1 0' * top_border_splash);\r
\r
for(i = WEP_FIRST; i <= WEP_LAST; ++i)\r
{\r
switch(i)\r
{\r
- case 1: return STAT_FUEL;\r
+ case 0: return STAT_FUEL;\r
default: return -1;\r
}\r
}\r
{\r
switch(i)\r
{\r
- case 1: return IT_FUEL;\r
+ case 0: return IT_FUEL;\r
default: return -1;\r
}\r
}\r
{\r
switch(i)\r
{\r
- case 1: return "gfx/hud/sb_fuel";\r
+ case 0: return "gfx/hud/sb_fuel";\r
default: return "";\r
}\r
}\r
vector StomachStatus_ColorFade(vector target_color)\r
{\r
local float step;\r
- step = cvar("sbar_stomachboard_status_fade");\r
+ step = cvar("sbar_stomachboard_status_fade") * frametime;\r
\r
if(stomachstatus_colorfade_current_x >= target_color_x + step)\r
stomachstatus_colorfade_current_x -= step;\r
}\r
}\r
\r
- if(getstati(STAT_STOMACH_EATEN))\r
+ if(getstati(STAT_VORE_EATEN))\r
{\r
- drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', StomachStatus_ColorFade(stov(cvar_string("sbar_stomachboard_color2"))), cvar("sbar_stomachboard_status_alpha"), DRAWFLAG_NORMAL);\r
+ drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', StomachStatus_ColorFade(stov(cvar_string("sbar_stomachboard_color2"))), cvar("sbar_stomachboard_status_alpha") * sbar_alpha_fg, DRAWFLAG_NORMAL);\r
drawstring(bottomleft - '-80 172 0', "predator:", '10 10 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
}\r
else\r
{\r
- drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', StomachStatus_ColorFade(stov(cvar_string("sbar_stomachboard_color1"))), cvar("sbar_stomachboard_status_alpha"), DRAWFLAG_NORMAL);\r
+ drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', StomachStatus_ColorFade(stov(cvar_string("sbar_stomachboard_color1"))), cvar("sbar_stomachboard_status_alpha") * sbar_alpha_fg, DRAWFLAG_NORMAL);\r
drawstring(bottomleft - '-80 172 0', "self:", '10 10 0', ' 1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
}\r
\r
float stomach_load;\r
- stomach_load = getstati(STAT_STOMACH_LOAD); // shows the predator's stomach load when we are eaten, and ours otherwise\r
+ stomach_load = getstati(STAT_VORE_LOAD); // shows the predator's stomach load when we are eaten, and ours otherwise\r
\r
Sbar_DrawXNum(bottomleft - '-18 170 0', bound(0, stomach_load, 9), 1, 0, 22, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
drawstring(bottomleft - '-40 170 0', "/", '22 22 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
Sbar_DrawXNum(bottomleft - '-50 170 0', bound(0, g_balance_vore_swallow_limit, 9), 1, 0, 22, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
\r
- if(getstati(STAT_STOMACH_DIGESTING))\r
+ if(getstati(STAT_VORE_DIGESTING))\r
drawstring(bottomleft - '-76 142 0', "stomach digesting", '12 12 0', '1 0.5 0.5', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
else if(stomach_load == g_balance_vore_swallow_limit)\r
drawstring(bottomleft - '-76 142 0', "stomach full", '12 12 0', '0.5 1 0.5', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
if(pl.team == COLOR_SPECTATOR)\r
continue;\r
\r
- if(getstati(STAT_STOMACH_EATEN))\r
- f = pl.pleater == getstati(STAT_STOMACH_EATEN);\r
+ if(getstati(STAT_VORE_EATEN))\r
+ f = pl.pleater == getstati(STAT_VORE_EATEN);\r
else\r
{\r
if(spectatee_status)\r
pos_y += 1.25 * sbar_fontsize_y;\r
}\r
\r
- if(getstati(STAT_STOMACH_EATEN))\r
- if(pl.sv_entnum == getstati(STAT_STOMACH_EATEN) - 1)\r
+ if(getstati(STAT_VORE_EATEN))\r
+ if(pl.sv_entnum == getstati(STAT_VORE_EATEN) - 1)\r
Sbar_PrintStomachboardItemPred(bottomleft - '-76 156 0', pl);\r
}\r
\r
if(x < 10) health_pos_x -= 11; // always center\r
Sbar_DrawXNum_Colored(health_pos, x, 22, sbar_alpha_fg);\r
\r
- // fuel ammo\r
- a = getstati(GetAmmoStat(1)); // how much fuel do we have?\r
+ // ammo\r
+ pos_x = bottom_x + 140;\r
+ pos_y = bottom_y - 20;\r
\r
- if (a > 0) { // if we have fuel, draw the amount\r
- float invincibility_time, dt;\r
- invincibility_time = getstatf(STAT_INVINCIBLE_FINISHED);\r
- dt = invincibility_time - time;\r
- pos_x = bottom_x + 140;\r
- pos_y = bottom_y - 20;\r
- drawpic(pos - '98 18 0', GetAmmoPicture(1), '20 20 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ // if we are using the jetpack, show fuel ammo. Otherwise show the ammo of our weapon\r
+ if(stat_items & IT_JETPACK && button_jetpack)\r
+ {\r
+ a = getstati(GetAmmoStat(0)); // how much fuel do we have?\r
+ drawpic(pos - '98 18 0', GetAmmoPicture(0), '20 20 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
Sbar_DrawXNum(pos - '144 16 0', a, 3, 0, 16, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
}\r
+ else\r
+ {\r
+ float i;\r
+ for (i = 0; i < 1; ++i)\r
+ {\r
+ if (stat_items & GetAmmoItemCode(i))\r
+ {\r
+ a = getstati(GetAmmoStat(i)); // how much ammo do we have of type i?\r
+ drawpic(pos - '98 18 0', GetAmmoPicture(i), '20 20 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ Sbar_DrawXNum(pos - '144 16 0', a, 3, 0, 16, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ }\r
+ }\r
+ }\r
\r
// weapon icon\r
entity e;\r
e = get_weaponinfo(activeweapon);\r
- //if (e && e.netname != "")\r
- dprint(strcat("XX_", e.netname, "_YY\n"));\r
+ if (e && e.netname != "" && e.netname != "N/A")\r
+ drawpic(bottom - '96 96 0', strcat("gfx/hud/bg_status_activeweapon_", e.netname), '192 96 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
\r
// draw scores and timer\r
Sbar_Score();\r