X-Git-Url: http://de.git.xonotic.org/?p=voretournament%2Fvoretournament.git;a=blobdiff_plain;f=data%2Fqcsrc%2Fclient%2Fsbar.qc;h=304f4e5b6858aff736de8698c4ec3baf1d944373;hp=8eafa1e6bba7d0526a2317afd198c340df0c2351;hb=f91e80bd8fc5ff722a1cfee7a8050a16fac7ab46;hpb=9ab5f09ecdb881edfe134ce4ce9a19a156f21bde diff --git a/data/qcsrc/client/sbar.qc b/data/qcsrc/client/sbar.qc index 8eafa1e6..304f4e5b 100644 --- a/data/qcsrc/client/sbar.qc +++ b/data/qcsrc/client/sbar.qc @@ -155,8 +155,8 @@ void Sbar_DrawXNum (vector pos, float num, float digits, float showminusplus, fl { tmp = substring(str, i, 1); if (stroke == 1) - drawpic(pos, strcat("gfx/hud/num_", tmp, "_stroke"), vsize, rgb, alpha, dflags); - drawpic(pos, strcat("gfx/hud/num_", tmp), vsize, num_color, alpha, dflags); + drawstring(pos, tmp, vsize, rgb, alpha, dflags); + drawstring(pos, tmp, vsize, num_color, alpha, dflags); pos_x += lettersize; } } @@ -2928,7 +2928,7 @@ void Sbar_Draw (void) else Sbar_DrawScoreboard(); float armor, health; - armor = getstati(STAT_ARMOR); // armor is not used in Vore Tournament by default, but still exists for mods that might want it + armor = getstati(STAT_ARMOR); health = getstati(STAT_HEALTH); stat_items = getstati(STAT_ITEMS); @@ -3025,8 +3025,19 @@ void Sbar_Draw (void) } } - vector health_pos; + vector health_pos, armor_pos; health_pos = bottom - '77 58 0'; + armor_pos = bottom - '62 68 0'; + + // armor + x = armor; + if (x > 0) + { + drawpic(armor_pos + '10.5 -13.5 0', "gfx/hud/sb_armor", '16 16 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); + if(x < 100) armor_pos_x -= 4.5; // always center + if(x < 10) armor_pos_x -= 7; // always center + Sbar_DrawXNum_Colored(armor_pos, x, 12, sbar_alpha_fg); + } // health x = health; @@ -3039,6 +3050,8 @@ void Sbar_Draw (void) pos_x = bottom_x + 140; pos_y = bottom_y - 20; + float weapon_clipload, weapon_clipsize; + // if we are using the jetpack, show fuel ammo. Otherwise show the ammo of our weapon if(stat_items & IT_JETPACK && button_jetpack) { @@ -3055,7 +3068,20 @@ void Sbar_Draw (void) { a = getstati(GetAmmoStat(i)); // how much ammo do we have of type i? drawpic(pos - '98 18 0', GetAmmoPicture(i), '20 20 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); - Sbar_DrawXNum(pos - '144 16 0', a, 3, 0, 16, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); + weapon_clipsize = getstati(STAT_WEAPON_CLIPSIZE); + + // if the weapon we're holding is reloadable, show both its ammo and load + if(weapon_clipsize) + { + weapon_clipload = getstati(STAT_WEAPON_CLIPLOAD); + if(weapon_clipload < 0) // we're reloading + drawstring(pos - '124 23 0', "- -", '16 16 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); + else + Sbar_DrawXNum(pos - '132 23 0', weapon_clipload, 2, 0, 16, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); + Sbar_DrawXNum(pos - '137 7 0', a, 3, 0, 12, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); + } + else + Sbar_DrawXNum(pos - '144 16 0', a, 3, 0, 16, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); } } }