X-Git-Url: http://de.git.xonotic.org/?p=voretournament%2Fvoretournament.git;a=blobdiff_plain;f=data%2Fqcsrc%2Fclient%2Fsbar.qc;h=3c3acfb59ab73e0e84c788e648de7d9bc84bbb16;hp=c293d80a55d18c926365bdf65a164b676276f9fa;hb=f77de10c0c2e9cc194893ee0d1d0b3feac7b6994;hpb=690eea263bd261ef2358f2347f640f78c2a9e8ce diff --git a/data/qcsrc/client/sbar.qc b/data/qcsrc/client/sbar.qc index c293d80a..3c3acfb5 100644 --- a/data/qcsrc/client/sbar.qc +++ b/data/qcsrc/client/sbar.qc @@ -111,25 +111,24 @@ void Sbar_DrawXNum (vector pos, float num, float digits, float showminusplus, fl if(l > digits) { - str = substring(str, l-digits, 999); + str = substring(str, l - digits, 999); l = strlen(str); - } else if(l < digits) - pos_x += (digits-l) * lettersize; + } if (highlighted == 1) { vector hl_size; - hl_size_x = vsize_x * l + vsize_x * 0.2; + hl_size_x = vsize_x * l; hl_size_y = vsize_y * 1.1; hl_size_z = 0; if(minus) hl_size_x = hl_size_x + vsize_x; vector hl_pos; - hl_pos_x = pos_x - lettersize/10; - hl_pos_y = pos_y - lettersize/20; + hl_pos_x = pos_x - lettersize / 10; + hl_pos_y = pos_y - lettersize / 20; hl_pos_z = 0; - drawpic(hl_pos, strcat("gfx/hud/sb_highlight_", l_length), hl_size, '1 1 1', alpha, dflags); + //drawpic(hl_pos, strcat("gfx/hud/sb_highlight_", l_length), hl_size, '1 1 1', alpha, dflags); } if (stroke == 1) @@ -140,25 +139,20 @@ void Sbar_DrawXNum (vector pos, float num, float digits, float showminusplus, fl if(minus) { if (stroke == 1) - drawpic(pos, "gfx/hud/num_minus_stroke", vsize, rgb, alpha, dflags); - drawpic(pos, "gfx/hud/num_minus", vsize, num_color, alpha, dflags); + drawstring(pos, "-", vsize, rgb, alpha, dflags); + drawstring(pos, "-", vsize, num_color, alpha, dflags); pos_x += lettersize; } else if(plus) { if (stroke == 1) - drawpic(pos, "gfx/hud/num_plus_stroke", vsize, rgb, alpha, dflags); - drawpic(pos, "gfx/hud/num_plus", vsize, num_color, alpha, dflags); + drawstring(pos, "+", vsize, rgb, alpha, dflags); + drawstring(pos, "+", vsize, num_color, alpha, dflags); pos_x += lettersize; } - for(i = 0; i < l; ++i) - { - 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); - pos_x += lettersize; - } + if (stroke == 1) + drawstring(pos, str, vsize, rgb, alpha, dflags); + drawstring(pos, str, vsize, num_color, alpha, dflags); } void Sbar_DrawXNum_Colored (vector pos, float x, float lettersize, float alpha) @@ -1699,8 +1693,8 @@ void Sbar_Score() if(gametype == GAME_RPG) return; - score_pos = top + '-240 8 0'; - secondary_score_pos = score_pos + '210 -6 0'; + score_pos = top + '-80 8 0'; + secondary_score_pos = score_pos + '80 -6 0'; if((scores_flags[ps_primary] & SFL_TIME) && !teamplay) { // race/cts record display on HUD pl = players.sort_next; @@ -1740,20 +1734,20 @@ void Sbar_Score() distribution_color = '1 0 0'; minusplus = 2; // minusplus 1: always prefix with plus sign } - Sbar_DrawXNum(score_pos + '335 16 0' - '16 0 0' * TIME_DECIMALS, distmsec, -TIME_DECIMALS, 0, 16, distribution_color, 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); - Sbar_DrawXNum(score_pos + '403 16 0' - '16 0 0' * TIME_DECIMALS, distsec, 4, minusplus, 16, distribution_color, 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); - drawpic(score_pos + '335 16 0' - '16 0 0' * TIME_DECIMALS, "gfx/hud/num_dot", '16 16 0', distribution_color, sbar_alpha_fg, DRAWFLAG_ADDITIVE); + Sbar_DrawXNum(score_pos + '232 -4 0' - '16 0 0' * TIME_DECIMALS, distmsec, -TIME_DECIMALS, 0, 16, distribution_color, 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); + Sbar_DrawXNum(score_pos + '232 12 0' - '16 0 0' * TIME_DECIMALS, distsec, 4, minusplus, 16, distribution_color, 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); + drawstring(score_pos + '216 -4 0' - '16 0 0' * TIME_DECIMALS, ".", '16 16 0', distribution_color, sbar_alpha_fg, DRAWFLAG_ADDITIVE); } // race record display if (distribution <= 0 || distribution == score) // draw the highlight background behind the timer if we have the lead - drawpic(score_pos + '335 0 0' - '32 0 0' * (4 + TIME_DECIMALS), "gfx/hud/sb_highlight_4", '0 28 0' + '32 0 0' * (4 + TIME_DECIMALS), '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); + drawpic(score_pos + '173 0 0' - '32 0 0' * (4 + TIME_DECIMALS), "gfx/hud/sb_highlight_4", '0 28 0' + '32 0 0' * (4 + TIME_DECIMALS), '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); - Sbar_DrawXNum(score_pos + '335 0 0' - TIME_DECIMALS * '30 0 0', racemsec, -TIME_DECIMALS, 0, 30, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); - Sbar_DrawXNum(score_pos + '335 0 0' - TIME_DECIMALS * '30 0 0' - '66 0 0', racesec, -2, 0, 30, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); - drawpic(score_pos + '335 0 0' - TIME_DECIMALS * '30 0 0' - '18 0 0', "gfx/hud/num_dot", '30 30 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_ADDITIVE); + Sbar_DrawXNum(score_pos + '192 0 0' - TIME_DECIMALS * '30 0 0', racemsec, -TIME_DECIMALS, 0, 30, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); + Sbar_DrawXNum(score_pos + '192 0 0' - TIME_DECIMALS * '30 0 0' - '66 0 0', racesec, -2, 0, 30, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); + drawstring(score_pos + '192 0 0' - TIME_DECIMALS * '30 0 0' - '18 0 0', ".", '30 30 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_ADDITIVE); - Sbar_DrawXNum(score_pos + '335 0 0' - TIME_DECIMALS * '30 0 0' - '132 0 0', racemin, -2, 0, 30, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); - drawpic(score_pos + '335 0 0' - TIME_DECIMALS * '30 0 0' - '84 0 0', "gfx/hud/num_colon", '30 30 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_ADDITIVE); + Sbar_DrawXNum(score_pos + '192 0 0' - TIME_DECIMALS * '30 0 0' - '132 0 0', racemin, -2, 0, 30, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); + drawstring(score_pos + '192 0 0' - TIME_DECIMALS * '30 0 0' - '84 0 0', ":", '30 30 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_ADDITIVE); } else if (!teamplay) { // non-teamgames, except race/cts // me vector := [team/connected frags id] @@ -1963,9 +1957,9 @@ void Sbar_Timer() if (minutes < 10) bgpos_x = topright_x - (54 + 17 + 12) * scale; else if (minutes < 100) // nudge the timer background left if more digits are drawn - bgpos_x = topright_x - (72 + 17 + 12) * scale; + bgpos_x = topright_x - (62 + 17 + 12) * scale; else - bgpos_x = topright_x - (90 + 17 + 12) * scale; + bgpos_x = topright_x - (70 + 17 + 12) * scale; bgpos_y = 0; bgpos_z = 0; } else { @@ -1996,10 +1990,10 @@ void Sbar_Timer() } if(minutesLeft >= 1 || cvar("sbar_increment_maptime") || timelimit == 0 || warmup_stage) { - Sbar_DrawXNum(topright - ('103 -2 0' - '0 2 0') * scale, minutes, 3, 0, 18 * scale, timer_color, 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); - drawpic(topright - ('53 0 0' - '0 1 0') * scale, "gfx/hud/num_colon", '18 18 0' * scale, timer_color, sbar_alpha_fg, DRAWFLAG_NORMAL); + Sbar_DrawXNum(topright - ('44 -2 0' - '0 2 0') - (strlen(ftos(minutes)) * 18 * scale * '0.5 0 0'), minutes, 3, 0, 18 * scale, timer_color, 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); + drawstring(topright - ('42 -2 0' - '0 1 0'), ":", '18 18 0' * scale, timer_color, sbar_alpha_fg, DRAWFLAG_NORMAL); } - Sbar_DrawXNum(topright - ('36 -2 0' + '3 0 0' - '0 2 0') * scale, seconds, -2, 0, 18 * scale, timer_color, 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); + Sbar_DrawXNum(topright - ('31 -2 0' + '3 0 0' - '0 2 0'), seconds, -2, 0, 18 * scale, timer_color, 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); } void CSQC_Strength_Timer() { @@ -2027,10 +2021,7 @@ void CSQC_Strength_Timer() { picsize = '22 22 0'; countdown_fontsize = 18; - if (vid_conwidth >= 800) - pos = bottomright - '34 48 0'; - else - pos = bottomright - '34 96 0'; + pos = bottomright - '34 48 0'; //strength strength_time = getstatf(STAT_STRENGTH_FINISHED); @@ -2049,7 +2040,7 @@ void CSQC_Strength_Timer() { { drawpic(pos, "gfx/hud/sb_str", picsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_ADDITIVE); } - Sbar_DrawXNum(pos - '40 -2 0', ceil(dt), 2, 0, countdown_fontsize, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); + Sbar_DrawXNum(pos - '20 -2 0', ceil(dt), 2, 0, countdown_fontsize, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); } else if(dt > -1) { @@ -2072,7 +2063,7 @@ void CSQC_Strength_Timer() { { drawpic(pos - '0 -22 0', "gfx/hud/sb_invinc", picsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_ADDITIVE); } - Sbar_DrawXNum(pos - '40 -24 0', ceil(dt), 2, 0, countdown_fontsize, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); + Sbar_DrawXNum(pos - '20 -24 0', ceil(dt), 2, 0, countdown_fontsize, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); } else if(dt > -1) { @@ -2903,8 +2894,7 @@ void Sbar_Draw (void) Sbar_UpdatePlayerTeams(); if (intermission == 2) // map voting screen { - if(spectatee_status != -1) - Sbar_Timer(); + Sbar_Timer(); if(sb_showscores) Sbar_DrawScoreboard(); else @@ -2929,7 +2919,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); @@ -2968,9 +2958,9 @@ void Sbar_Draw (void) float stomach_load; stomach_load = getstati(STAT_VORE_LOAD); // shows the predator's stomach load when we are eaten, and ours otherwise - Sbar_DrawXNum(bottomleft - '-18 170 0', bound(0, stomach_load, 9), 1, 0, 22, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); - drawstring(bottomleft - '-40 170 0', "/", '22 22 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); - 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); + Sbar_DrawXNum(bottomleft - '-26 171 0', bound(0, stomach_load, 9), 1, 0, 22, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); + drawstring(bottomleft - '-41 171 0', "/", '22 22 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); + Sbar_DrawXNum(bottomleft - '-50 171 0', bound(0, g_balance_vore_swallow_limit, 9), 1, 0, 22, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); if(getstati(STAT_VORE_DIGESTING)) drawstring(bottomleft - '-76 142 0', "stomach digesting", '12 12 0', '1 0.5 0.5', sbar_alpha_fg, DRAWFLAG_NORMAL); @@ -3026,26 +3016,39 @@ void Sbar_Draw (void) } } - vector health_pos; - health_pos = bottom - '77 58 0'; + vector health_pos, armor_pos; + health_pos = bottom - '60 58 0'; + armor_pos = bottom - '52.5 68 0'; + + // armor + x = armor; + if (x > 0) + { + drawpic(armor_pos + '0 -13.5 0', "gfx/hud/sb_armor", '16 16 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); + if(x < 100) armor_pos_x += 2.5; // always center + if(x < 10) armor_pos_x += 2.5; // always center + Sbar_DrawXNum_Colored(armor_pos, x, 12, sbar_alpha_fg); + } // health x = health; - drawpic(health_pos + '22 16 0', "gfx/hud/sb_health", '32 32 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); - if(x < 100) health_pos_x -= 9; // always center - if(x < 10) health_pos_x -= 11; // always center + drawpic(health_pos + '4.5 16 0', "gfx/hud/sb_health", '32 32 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); + if(x < 100) health_pos_x += 5; // always center + if(x < 10) health_pos_x += 5; // always center Sbar_DrawXNum_Colored(health_pos, x, 22, sbar_alpha_fg); // ammo 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) { a = getstati(GetAmmoStat(0)); // how much fuel do we have? drawpic(pos - '98 18 0', GetAmmoPicture(0), '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); + Sbar_DrawXNum(pos - '128 16 0', a, 3, 0, 16, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); } else { @@ -3056,7 +3059,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 - '104 23 0', "- -", '16 16 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); + else + Sbar_DrawXNum(pos - '124 23 0', weapon_clipload, 2, 0, 16, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); + Sbar_DrawXNum(pos - '126 7 0', a, 3, 0, 12, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); + } + else + Sbar_DrawXNum(pos - '128 16 0', a, 3, 0, 16, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); } } }