From: MirceaKitsune Date: Sat, 2 Feb 2013 14:54:59 +0000 (+0200) Subject: Move two more items to the new HUD system X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2cdb4fc5e3f6896946e69f359b0aece840c849ce;p=voretournament%2Fvoretournament.git Move two more items to the new HUD system --- diff --git a/data/gfx/hud/sb_digestion.tga b/data/gfx/hud/sb_digestion.tga deleted file mode 100644 index 69ddf383..00000000 Binary files a/data/gfx/hud/sb_digestion.tga and /dev/null differ diff --git a/data/gfx/hud/sb_digestion_active.tga b/data/gfx/hud/sb_digestion_active.tga new file mode 100644 index 00000000..62930630 Binary files /dev/null and b/data/gfx/hud/sb_digestion_active.tga differ diff --git a/data/gfx/hud/sb_digestion_impossible.tga b/data/gfx/hud/sb_digestion_impossible.tga new file mode 100644 index 00000000..51930866 Binary files /dev/null and b/data/gfx/hud/sb_digestion_impossible.tga differ diff --git a/data/gfx/hud/sb_digestion_possible.tga b/data/gfx/hud/sb_digestion_possible.tga new file mode 100644 index 00000000..2db90fe5 Binary files /dev/null and b/data/gfx/hud/sb_digestion_possible.tga differ diff --git a/data/hudVT.cfg b/data/hudVT.cfg index a965ad82..15d0a2f5 100644 --- a/data/hudVT.cfg +++ b/data/hudVT.cfg @@ -20,8 +20,16 @@ set hud_item_ammo_noload_text_position "0.025 -0.91 0" set hud_item_ammo_noload_text_scale 16 set hud_item_ammo_load_text_position "0.015 -0.935 0" set hud_item_ammo_load_text_scale 12 -set hud_item_clip_load_text_position "0.03 -0.89 0" -set hud_item_clip_load_text_scale 16 +set hud_item_ammo_load_clip_text_position "0.03 -0.89 0" +set hud_item_ammo_load_clip_text_scale 16 + +set hud_item_digestion_icon_position "-0.89 -0.53 0" +set hud_item_digestion_icon_scale "0.02 0.03 0" + +set hud_item_stomach_load_single_text_position "-0.89 -0.47 0" +set hud_item_stomach_load_single_text_scale 20 +set hud_item_stomach_load_double_text_position "-0.89 -0.47 0" +set hud_item_stomach_load_double_text_scale 16 set hud_item_predator_position "-0.64 -0.525 0" set hud_item_predator_scale "0.17 0.0175 0" diff --git a/data/qcsrc/client/hud.qc b/data/qcsrc/client/hud.qc index c7050149..25aa1a85 100644 --- a/data/qcsrc/client/hud.qc +++ b/data/qcsrc/client/hud.qc @@ -94,7 +94,7 @@ vector Sbar_ConvertToScreen_TextPosition(string text, vector position, float let vector pos, sz; sz_x = sz_y = lettersize; pos_x = (vid_conwidth / 2) * bound(0, 1 + position_x, 2); - pos_x -= stringwidth(text, FALSE, sz) * 0.5; + pos_x -= stringwidth(text, TRUE, sz) * 0.5; pos_y = (vid_conheight / 2) * bound(0, 1 - position_y, 2); pos_y -= sz_y / 2; return pos; @@ -123,7 +123,7 @@ void Sbar_DrawString(string text, vector position, float lettersize) pos = Sbar_ConvertToScreen_TextPosition(text, position, lettersize); sz_x = sz_y = lettersize; - drawstring(pos, text, sz, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); + drawcolorcodedstring(pos, text, sz, sbar_alpha_fg, DRAWFLAG_NORMAL); } void Sbar_DrawXNum (vector position, float num, float digits, float showminusplus, float lettersize, vector rgb, float alpha, float dflags) @@ -2170,9 +2170,9 @@ void Sbar_Status() { weapon_clipload = getstati(STAT_WEAPON_CLIPLOAD); if(weapon_clipload < 0) // we're reloading - Sbar_DrawString("- -", stov(cvar_string("hud_item_clip_load_text_position")), cvar("hud_item_clip_load_text_scale")); + Sbar_DrawString("- -", stov(cvar_string("hud_item_ammo_load_clip_text_position")), cvar("hud_item_ammo_load_clip_text_scale")); else - 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); + Sbar_DrawXNum(stov(cvar_string("hud_item_ammo_load_clip_text_position")), weapon_clipload, 2, 0, cvar("hud_item_ammo_load_clip_text_scale"), '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); 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); } else @@ -3278,24 +3278,23 @@ void Sbar_Draw (void) if(stomach_load) { status_text = strcat(ftos(stomach_load), "^8/", status_color, ftos(stomach_maxload)); - status_pos = bottomleft - '-43 168 0'; - status_size = 16; + status_pos = stov(cvar_string("hud_item_stomach_load_double_text_position")); + status_size = cvar("hud_item_stomach_load_double_text_scale"); } else { status_text = strcat(status_color, ftos(stomach_maxload)); - status_pos = bottomleft - '-43 170 0'; - status_size = 20; + status_pos = stov(cvar_string("hud_item_stomach_load_single_text_position")); + status_size = cvar("hud_item_stomach_load_single_text_scale"); } - status_pos -= '1 0 0' * stringwidth(status_text, TRUE, '1 0 0' * status_size) * 0.5; - drawcolorcodedstring(status_pos, status_text, '1 1 0' * status_size, sbar_alpha_fg, DRAWFLAG_NORMAL); + Sbar_DrawString(status_text, status_pos, status_size); if(getstati(STAT_VORE_DIGESTING)) // we are currently digesting - drawpic(bottomleft - '-35 149 0', "gfx/hud/sb_digestion", '16 16 0', '0 1 0', sbar_alpha_fg, DRAWFLAG_NORMAL); + Sbar_DrawPic("gfx/hud/sb_digestion_active", stov(cvar_string("hud_item_digestion_icon_position")), stov(cvar_string("hud_item_digestion_icon_scale")), FALSE); else if(stomach_load) // we can digest at this time - drawpic(bottomleft - '-35 149 0', "gfx/hud/sb_digestion", '16 16 0', '0.25 0.25 0', sbar_alpha_fg, DRAWFLAG_NORMAL); + Sbar_DrawPic("gfx/hud/sb_digestion_possible", stov(cvar_string("hud_item_digestion_icon_position")), stov(cvar_string("hud_item_digestion_icon_scale")), FALSE); else // we cannot digest at this time - drawpic(bottomleft - '-35 149 0', "gfx/hud/sb_digestion", '16 16 0', '0.25 0 0', sbar_alpha_fg, DRAWFLAG_NORMAL); + Sbar_DrawPic("gfx/hud/sb_digestion_impossible", stov(cvar_string("hud_item_digestion_icon_position")), stov(cvar_string("hud_item_digestion_icon_scale")), FALSE); // draw the stomach board player list entity pl, pred;