return rgb;\r
}\r
\r
-void Sbar_DrawXNum (vector pos, float num, float digits, float showminusplus, float lettersize, vector rgb, float alpha, float dflags)\r
+void Sbar_DrawPic(string pic, vector position, vector dimensions, float background)\r
+{\r
+ vector pos, sz;\r
+ sz_x = vid_conwidth * dimensions_x;\r
+ sz_y = vid_conheight * dimensions_y;\r
+ pos_x = (vid_conwidth / 2) * bound(0, 1 + position_x, 2);\r
+ pos_x -= sz_x / 2;\r
+ pos_y = (vid_conheight / 2) * bound(0, 1 - position_y, 2);\r
+ pos_y -= sz_y / 2;\r
+\r
+ if(background)\r
+ {\r
+ if(teamplay)\r
+ drawpic(pos, pic, sz, GetTeamRGB(myteam) * sbar_color_bg_team, sbar_alpha_bg, DRAWFLAG_NORMAL); // hud color = myteam color\r
+ else\r
+ drawpic(pos, pic, sz, stov(cvar_string("sbar_color_bg")), sbar_alpha_bg, DRAWFLAG_NORMAL);\r
+ }\r
+ else\r
+ drawpic(pos, pic, sz, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+}\r
+\r
+void Sbar_DrawString(string text, vector position, float lettersize)\r
+{\r
+ vector pos, sz;\r
+ sz_x = sz_y = lettersize;\r
+ pos_x = (vid_conwidth / 2) * bound(0, 1 + position_x, 2);\r
+ pos_x -= stringwidth(text, FALSE, sz) * 0.5;\r
+ pos_y = (vid_conheight / 2) * bound(0, 1 - position_y, 2);\r
+ pos_y -= sz_y / 2;\r
+\r
+ drawstring(pos, text, sz, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+}\r
+\r
+void Sbar_DrawXNum (vector position, float num, float digits, float showminusplus, float lettersize, vector rgb, float alpha, float dflags)\r
{\r
float l;\r
string str, tmp, l_length, final_num;\r
float minus, plus;\r
- vector vsize;\r
-\r
- vsize_x = vsize_y = lettersize;\r
- vsize_z = 0;\r
\r
// showminusplus 1: always prefix with minus sign (useful in race distribution display)\r
// showminusplus 2: always prefix with plus sign (useful in race distribution display)\r
final_num = "-";\r
else if(plus)\r
final_num = "+";\r
-\r
final_num = strcat(final_num, str);\r
- drawstring(pos, final_num, vsize, rgb, alpha, dflags);\r
+\r
+ vector pos, sz;\r
+ sz_x = sz_y = lettersize;\r
+ pos_x = (vid_conwidth / 2) * bound(0, 1 + position_x, 2);\r
+ pos_x -= stringwidth(final_num, FALSE, sz) * 0.5;\r
+ pos_y = (vid_conheight / 2) * bound(0, 1 - position_y, 2);\r
+ pos_y -= sz_y / 2;\r
+\r
+ drawstring(pos, final_num, sz, rgb, alpha, dflags);\r
}\r
\r
vector Sbar_NumColor (float x)\r
}\r
\r
float fieldcounter;\r
-void Sbar_PrintStomachboardItem(vector pos, entity pl)\r
+void Sbar_PrintStomachboardItem(entity pl, vector position, vector dimensions)\r
{\r
// lists all players in the stomach\r
\r
vector hl_color;\r
field_number = 3; // the number of components each row has\r
\r
+ // center defined position on the x axis\r
+ position_x -= dimensions_x / 2;\r
+\r
+ // limit the font size to the maximum of the HUD\r
+ vector font_sz;\r
+ font_sz_x = bound(0, sbar_fontsize_x, dimensions_y);\r
+ font_sz_y = bound(0, sbar_fontsize_y, dimensions_y);\r
+\r
for(fieldcounter = 1; fieldcounter <= field_number; ++fieldcounter)\r
{\r
+ vector pos, sz;\r
field = -fieldcounter;\r
str = Sbar_GetStomachField(pl, field);\r
\r
// row highlighting\r
if(field == ST_HIGHLIGHT)\r
{\r
+ pos = position;\r
+ sz = dimensions;\r
+\r
if(getstati(STAT_VORE_EATEN))\r
{\r
if(teamplay && (GetPlayerColor(getstati(STAT_VORE_EATEN) - 1) == GetPlayerColor(player_localentnum - 1) || GetPlayerColor(getstati(STAT_VORE_EATEN) - 1) == GetPlayerColor(spectatee_status - 1))) // same team\r
}\r
else\r
hl_color = stov(cvar_string("sbar_stomachboard_color1"));\r
- drawfill(pos - '0 0 0', '193 11 0', hl_color, cvar("sbar_stomachboard_highlight_alpha") * sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ drawfill(pos, sz, hl_color, cvar("sbar_stomachboard_highlight_alpha") * sbar_alpha_fg, DRAWFLAG_NORMAL);\r
}\r
\r
if(field == ST_NAME) {\r
+ pos_x = position_x + dimensions_x * cvar("hud_item_preylist_colors_location");\r
+ sz_x = dimensions_x * cvar("hud_item_preylist_colors_length");\r
+\r
f = stof(getplayerkey(pl.sv_entnum, "colors"));\r
- drawpic(pos, "gfx/sb_playercolor_base", '22 11 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
- drawpic(pos, "gfx/sb_playercolor_shirt", '22 11 0', colormapPaletteColor(floor(f / 16), 0), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
- drawpic(pos, "gfx/sb_playercolor_pants", '22 11 0', colormapPaletteColor(mod(f, 16), 1), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ drawpic(pos, "gfx/sb_playercolor_base", sz, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ drawpic(pos, "gfx/sb_playercolor_shirt", sz, colormapPaletteColor(floor(f / 16), 0), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ drawpic(pos, "gfx/sb_playercolor_pants", sz, colormapPaletteColor(mod(f, 16), 1), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
\r
- pos_x += 24;\r
- drawcolorcodedstring(pos, textShortenToWidth(str, 138, '11 11 0', stringwidth_colors), '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ pos_x = position_x + dimensions_x * cvar("hud_item_preylist_name_location");\r
+ sz_x = dimensions_x * cvar("hud_item_preylist_name_length");\r
+ drawcolorcodedstring(pos, textShortenToWidth(str, sz_x, font_sz, stringwidth_colors), font_sz, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
}\r
\r
if(field == ST_HEALTH) {\r
- pos_x += 138;\r
- if(pl.sv_entnum == player_localentnum - 1 || (spectatee_status && pl.sv_entnum == spectatee_status - 1))\r
- drawcolorcodedstring(pos, "self", '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
- else\r
- {\r
- drawpic(pos, "gfx/hud/sb_health", '11 11 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ pos_x = position_x + dimensions_x * cvar("hud_item_preylist_health_icon_location");\r
+ sz_x = dimensions_x * cvar("hud_item_preylist_health_icon_length");\r
\r
- pos_x += 9;\r
- drawcolorcodedstring(pos, str, '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
- }\r
+ if(pl.sv_entnum == player_localentnum - 1 || (spectatee_status && pl.sv_entnum == spectatee_status - 1))\r
+ drawcolorcodedstring(pos, textShortenToWidth("self", sz_x, font_sz, stringwidth_colors), font_sz, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ else\r
+ {\r
+ drawpic(pos, "gfx/hud/sb_health", sz, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+\r
+ pos_x = position_x + dimensions_x * cvar("hud_item_preylist_health_text_location");\r
+ sz_x = dimensions_x * cvar("hud_item_preylist_health_text_length");\r
+ drawcolorcodedstring(pos, textShortenToWidth(str, sz_x, font_sz, stringwidth_colors), font_sz, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ }\r
}\r
}\r
}\r
\r
float fieldcounter2;\r
-void Sbar_PrintStomachboardItemPred(vector pos, entity pl)\r
+void Sbar_PrintStomachboardItemPred(entity pl, vector position, vector dimensions)\r
{\r
// shows the name of our predator\r
\r
\r
if(field == STP_NAME) {\r
f = stof(getplayerkey(pl.sv_entnum, "colors"));\r
- drawpic(pos, "gfx/sb_playercolor_base", '22 11 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
- drawpic(pos, "gfx/sb_playercolor_shirt", '22 11 0', colormapPaletteColor(floor(f / 16), 0), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
- drawpic(pos, "gfx/sb_playercolor_pants", '22 11 0', colormapPaletteColor(mod(f, 16), 1), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ drawpic(position, "gfx/sb_playercolor_base", '22 11 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ drawpic(position, "gfx/sb_playercolor_shirt", '22 11 0', colormapPaletteColor(floor(f / 16), 0), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ drawpic(position, "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, textShortenToWidth(str, 122, '11 11 0', stringwidth_colors), '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ //pos_x += 24;\r
+ drawcolorcodedstring(position, textShortenToWidth(str, 122, '11 11 0', stringwidth_colors), '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
}\r
}\r
}\r
pos_y += 1.2 * sbar_fontsize_y;\r
drawcolorcodedstring(pos + '0.5 0 0' * (sbwidth - stringwidth(str, TRUE, sbar_fontsize)), str, sbar_fontsize, sbar_scoreboard_alpha_fg, DRAWFLAG_NORMAL);\r
\r
+ // print information about respawn status\r
+ float respawn_time = getstatf(STAT_RESPAWN_TIME);\r
+ if(respawn_time)\r
+ {\r
+ if(respawn_time < 0)\r
+ {\r
+ // a negative number means we are awaiting respawn, time value is still the same\r
+ respawn_time *= -1; // remove mark now that we checked it\r
+ if(time >= respawn_time) // don't show a negative value while the server is respawning the player (lag)\r
+ str = strcat("^1Respawning...");\r
+ else\r
+ str = strcat("^1Respawning in ^3", ftos_decimals(respawn_time - time, 2), "^1 seconds...");\r
+ }\r
+ else if(time < respawn_time)\r
+ str = strcat("You are dead, wait ^3", ftos_decimals(respawn_time - time, 2), "^7 seconds before respawning");\r
+ else if(time >= respawn_time)\r
+ str = strcat("You are dead, press ^2", getcommandkey("primary fire", "+fire"), "^7 to respawn");\r
+\r
+ pos_y += 1.2 * sbar_fontsize_y;\r
+ drawcolorcodedstring(pos + '0.5 0 0' * (sbwidth - stringwidth(str, TRUE, sbar_fontsize)), str, sbar_fontsize, sbar_scoreboard_alpha_fg, DRAWFLAG_NORMAL);\r
+ }\r
+\r
scoreboard_bottom = pos_y + 2 * sbar_fontsize_y;\r
}\r
\r
{\r
// draws the portrait, using the values set in Ent_ReadPortrait\r
\r
- vector left;\r
+ // make the portrait slide in and out of the left edge\r
+ float fade_time;\r
+ float fade1_start, fade1_end, fade2_start, fade2_end;\r
+ float fade_in, fade_out;\r
+\r
+ fade_time = cvar("sbar_portrait_time") * bound(0, cvar("sbar_portrait_fade"), 0.5);\r
+\r
+ fade1_start = portrait_time + cvar("sbar_portrait_time") - fade_time;\r
+ fade1_end = portrait_time + cvar("sbar_portrait_time");\r
+ fade2_start = portrait_time;\r
+ fade2_end = portrait_time + fade_time;\r
+\r
+ fade_in = bound(0, (time / fade1_end - 1) / (fade1_start / fade1_end - 1), 1);\r
+ fade_out = 1 - bound(0, (time / fade2_end - 1) / (fade2_start / fade2_end - 1), 1);\r
+\r
+ vector left, fade_pos;\r
left_x = 0;\r
left_y = vid_conheight / 2;\r
+ fade_pos_x = -130 * fade_in * fade_out;\r
\r
if(!cvar("sbar_portrait"))\r
return;\r
\r
if(portrait_time + cvar("sbar_portrait_time") >= time)\r
{\r
- drawpic(left + '10 -80 0', portrait_image, '120 160 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
- drawcolorcodedstring(left + '10 80 0', portrait_name, '12 12 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ if(portrait_image && portrait_name) // prevent using bad strings\r
+ {\r
+ drawpic(left - '120 80 0' - fade_pos, portrait_image, '120 160 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ drawcolorcodedstring(left - '120 -80 0' - fade_pos, textShortenToWidth(portrait_name, 120, '12 12 0', stringwidth_colors), '12 12 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ }\r
}\r
- else if(portrait_time)\r
+ else\r
{\r
- strunzone(portrait_name);\r
- strunzone(portrait_image);\r
- portrait_time = 0;\r
+ // free unused strings from memory\r
+ if(portrait_image)\r
+ {\r
+ strunzone(portrait_image);\r
+ portrait_image = string_null;\r
+ }\r
+ if(portrait_name)\r
+ {\r
+ strunzone(portrait_name);\r
+ portrait_name = string_null;\r
+ }\r
}\r
}\r
\r
\r
void Sbar_Status()\r
{\r
- vector bottom;\r
- bottom_x = vid_conwidth/2;\r
- bottom_y = vid_conheight;\r
- bottom_z = 0;\r
-\r
float armor, health, x, a;\r
armor = getstati(STAT_ARMOR);\r
health = getstati(STAT_HEALTH);\r
float stat_items;\r
stat_items = getstati(STAT_ITEMS);\r
\r
- vector health_pos, armor_pos, pos;\r
- health_pos = bottom - '43 58 0';\r
- armor_pos = bottom - '43 68 0';\r
-\r
- if (cvar("viewsize") <= 100) {\r
- if (teamplay)\r
- drawpic(bottom - '96 96 0', "gfx/hud/bg_status", '192 96 0', GetTeamRGB(myteam) * sbar_color_bg_team, sbar_alpha_bg, DRAWFLAG_NORMAL); // hud color = myteam color\r
- else {\r
- // allow for custom HUD colors in non-teamgames\r
- color = stov(cvar_string("sbar_color_bg"));\r
-\r
- drawpic(bottom - '96 96 0', "gfx/hud/bg_status", '192 96 0', color, sbar_alpha_bg, DRAWFLAG_NORMAL);\r
- }\r
- }\r
+ if (cvar("viewsize") <= 100 && sbar_hudselector)\r
+ Sbar_DrawPic("gfx/hud/bg_status", stov(cvar_string("hud_panel_status_background_position")), stov(cvar_string("hud_panel_status_background_scale")), TRUE);\r
\r
// armor\r
x = armor;\r
if (x > 0)\r
{\r
- drawpic(armor_pos + '-8 -13.5 0', "gfx/hud/sb_armor", '16 16 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
- armor_pos -= '1 0 0' * stringwidth(ftos(x), FALSE, '12 12 0') * 0.5;\r
- Sbar_DrawXNum(armor_pos, x, 3, 0, 12, Sbar_NumColor(x), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ Sbar_DrawPic("gfx/hud/sb_armor", stov(cvar_string("hud_item_armor_icon_position")), stov(cvar_string("hud_item_armor_icon_scale")), FALSE);\r
+ Sbar_DrawXNum(stov(cvar_string("hud_item_armor_text_position")), x, 3, 0, cvar("hud_item_armor_text_scale"), Sbar_NumColor(x), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
}\r
\r
// health\r
x = health;\r
- drawpic(health_pos + '-11 16 0', "gfx/hud/sb_health", '32 32 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
- health_pos -= '1 0 0' * stringwidth(ftos(x), FALSE, '22 22 0') * 0.5;\r
- Sbar_DrawXNum(health_pos, x, 3, 0, 22, Sbar_NumColor(x), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ Sbar_DrawPic("gfx/hud/sb_health", stov(cvar_string("hud_item_health_icon_position")), stov(cvar_string("hud_item_health_icon_scale")), FALSE);\r
+ Sbar_DrawXNum(stov(cvar_string("hud_item_health_text_position")), x, 3, 0, cvar("hud_item_health_text_scale"), Sbar_NumColor(x), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
\r
- // ammo\r
- pos_x = bottom_x + 140;\r
- pos_y = bottom_y - 20;\r
+ // if we are dead, we can skip the HUD from here\r
+ if(health <= 0)\r
+ return;\r
\r
+ // ammo\r
float weapon_clipload, weapon_clipsize;\r
- vector ammo_pos_offset;\r
\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
- ammo_pos_offset = '1 0 0' * stringwidth(ftos(a), FALSE, '16 16 0') * 0.5;\r
- Sbar_DrawXNum(pos - '118 16 0' - ammo_pos_offset, a, 3, 0, 16, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ Sbar_DrawPic(GetAmmoPicture(0), stov(cvar_string("hud_item_ammo_icon_position")), stov(cvar_string("hud_item_ammo_noload_icon_scale")), FALSE);\r
+ Sbar_DrawXNum(stov(cvar_string("hud_item_ammo_noload_text_position")), a, 3, 0, cvar("hud_item_ammo_noload_text_scale"), '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
}\r
else\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_DrawPic(GetAmmoPicture(i), stov(cvar_string("hud_item_ammo_icon_position")), stov(cvar_string("hud_item_ammo_icon_scale")), FALSE);\r
weapon_clipsize = getstati(STAT_WEAPON_CLIPSIZE);\r
\r
// if the weapon we're holding is reloadable, show both its ammo and load\r
{\r
weapon_clipload = getstati(STAT_WEAPON_CLIPLOAD);\r
if(weapon_clipload < 0) // we're reloading\r
- {\r
- ammo_pos_offset = '1 0 0' * stringwidth("- -", FALSE, '16 16 0') * 0.5;\r
- drawstring(pos - '118 23 0' - ammo_pos_offset, "- -", '16 16 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
- }\r
+ Sbar_DrawString("- -", stov(cvar_string("hud_item_clip_load_text_position")), cvar("hud_item_clip_load_text_scale"));\r
else\r
- {\r
- ammo_pos_offset = '1 0 0' * stringwidth(ftos(weapon_clipload), FALSE, '16 16 0') * 0.5;\r
- Sbar_DrawXNum(pos - '118 23 0' - ammo_pos_offset, weapon_clipload, 2, 0, 16, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
- }\r
- ammo_pos_offset = '1 0 0' * stringwidth(ftos(a), FALSE, '12 12 0') * 0.5;\r
- Sbar_DrawXNum(pos - '118 7 0' - ammo_pos_offset, a, 3, 0, 12, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ Sbar_DrawXNum(stov(cvar_string("hud_item_clip_load_text_position")), weapon_clipload, 2, 0, cvar("hud_item_clip_load_text_scale"), '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ Sbar_DrawXNum(stov(cvar_string("hud_item_ammo_load_text_position")), a, 3, 0, cvar("hud_item_ammo_load_text_scale"), '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
}\r
else\r
{\r
- ammo_pos_offset = '1 0 0' * stringwidth(ftos(a), FALSE, '16 16 0') * 0.5;\r
- Sbar_DrawXNum(pos - '118 16 0' - ammo_pos_offset, a, 3, 0, 16, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ Sbar_DrawXNum(stov(cvar_string("hud_item_ammo_noload_text_position")), a, 3, 0, cvar("hud_item_ammo_noload_text_scale"), '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
}\r
}\r
}\r
entity e;\r
e = get_weaponinfo(activeweapon);\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
+ Sbar_DrawPic(strcat("gfx/hud/bg_status_activeweapon_", e.netname), stov(cvar_string("hud_item_weapon_position")), stov(cvar_string("hud_item_weapon_scale")), FALSE);\r
}\r
\r
void Sbar_Timer()\r
bgpos_z = 0;\r
}\r
\r
- if (cvar("viewsize") <= 100) { // draw timer background when viewsize <= 100\r
+ if (cvar("viewsize") <= 100 && sbar_hudselector) { // draw timer background when viewsize <= 100\r
if (teamplay)\r
drawpic(bgpos, "gfx/hud/bg_timer", '120 30 0' * scale, GetTeamRGB(myteam) * sbar_color_bg_team, sbar_alpha_bg, DRAWFLAG_NORMAL); // timer bg color = myteam color\r
else {\r
Sbar_DrawScoreboard();\r
Sbar_Score();\r
Sbar_Timer();\r
+ Sbar_Portrait();\r
if(getstati(STAT_VORE_EATEN))\r
Sbar_Status();\r
\r
drawpic(warn_pos - '128 0 0', "gfx/hud/sb_power_fail", '256 256 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
drawpic(warn_pos - '16 0 0' + '0 150 0', "gfx/hud/sb_power_fail_icon", '32 32 0', '1 1 1', sbar_alpha_fg * (0.5 + sin(time * 5) / 2), DRAWFLAG_NORMAL);\r
power_boot = time + g_power_reboot;\r
+ Sbar_Portrait(); // draw the portrait still\r
return; // skip drawing the HUD\r
}\r
else if(time <= power_boot)\r
// subsystems are rebooting\r
drawpic(warn_pos - '128 0 0', "gfx/hud/sb_power_reboot", '256 256 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
drawpic(warn_pos - '16 0 0' + '0 150 0', "gfx/hud/sb_power_reboot_icon", '32 32 0', '1 1 1', sbar_alpha_fg * (0.5 + sin(time * 5) / 2), DRAWFLAG_NORMAL);\r
+ Sbar_Portrait(); // draw the portrait still\r
return; // skip drawing the HUD\r
}\r
}\r
if(g_vore) // only when the vore system is active\r
{\r
// draw the stomach board\r
- if (cvar("viewsize") <= 100) {\r
+ if (cvar("viewsize") <= 100 && sbar_hudselector) {\r
if (teamplay)\r
drawpic(bottomleft- '0 256 0', "gfx/hud/bg_stomach", '256 256 0', GetTeamRGB(myteam) * sbar_color_bg_team, sbar_alpha_bg, DRAWFLAG_NORMAL); // hud color = myteam color\r
else {\r
status_pos = bottomleft - '-43 168 0';\r
status_size = 16;\r
}\r
- else if(g_healthsize_center >= 0) // no point in showing it otherwise\r
+ else\r
{\r
status_text = strcat(status_color, ftos(stomach_maxload));\r
status_pos = bottomleft - '-43 170 0';\r
entity pl, pred;\r
float f, l;\r
\r
- pos = bottomleft;\r
+ hud_total_prey = 0;\r
+ pos = stov(cvar_string("hud_item_preylist_position"));\r
+ vector sz = stov(cvar_string("hud_item_preylist_scale"));\r
for(pl = players.sort_next; pl; pl = pl.sort_next)\r
{\r
if(pl.team == COLOR_SPECTATOR)\r
f = pl.plpredator == player_localentnum;\r
}\r
\r
- if(f && l <= 8) // limit the stomach board to 9 entries due to the HUD design\r
+ if(f)\r
{\r
- Sbar_PrintStomachboardItem(pos - '-16 124 0', pl);\r
- pos_y += 1.1 * sbar_fontsize_y;\r
- l += 1;\r
+ if(l < cvar("hud_item_preylist_entries")) // limit the stomach board to the given number of entries\r
+ {\r
+ Sbar_PrintStomachboardItem(pl, pos, sz);\r
+\r
+ // advance y position for each entry\r
+ pos_y += sz_y * cvar("hud_item_preylist_spacing");\r
+ l += 1;\r
+ }\r
+ ++hud_total_prey;\r
}\r
\r
// set the predator's name\r
}\r
\r
// draw the predator's name\r
- Sbar_PrintStomachboardItemPred(bottomleft - '-76 150 0', pred);\r
+// Sbar_PrintStomachboardItemPred(bottomleft - '-76 150 0', pred);\r
}\r
\r
// draw status, scores, timer, ring and portrait\r
pl_skin = ReadByte();\r
pl_name = ReadString();\r
\r
- // updating an existent portrait\r
- if(portrait_time)\r
- {\r
+ // update existing portraits\r
+ if(portrait_name)\r
strunzone(portrait_name);\r
+ if(portrait_image)\r
strunzone(portrait_image);\r
- }\r
\r
portrait_time = time;\r
portrait_name = strzone(pl_name);\r