From a42ffc674f2013351aa953dd8012d8cbc35246b6 Mon Sep 17 00:00:00 2001 From: fruitiex Date: Sat, 23 Jan 2010 10:03:12 +0000 Subject: [PATCH] fix yellow race medal, add gained/improved pos to them git-svn-id: svn://svn.icculus.org/nexuiz/trunk@8531 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/client/Defs.qc | 2 +- data/qcsrc/client/Main.qc | 7 ++----- data/qcsrc/client/sbar.qc | 22 ++++++++++++---------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/data/qcsrc/client/Defs.qc b/data/qcsrc/client/Defs.qc index b446f1296..e726602dc 100644 --- a/data/qcsrc/client/Defs.qc +++ b/data/qcsrc/client/Defs.qc @@ -212,7 +212,7 @@ string race_othercheckpointenemy; float sb_showscores_force; float race_status; string race_status_name; -float myrank_old; +float race_myrank; // Nexball float nb_pb_period; diff --git a/data/qcsrc/client/Main.qc b/data/qcsrc/client/Main.qc index ebc9c4974..d34ae1c44 100644 --- a/data/qcsrc/client/Main.qc +++ b/data/qcsrc/client/Main.qc @@ -1128,11 +1128,8 @@ void Net_ReadRace() strunzone(grecordholder[pos-1]); grecordholder[pos-1] = strzone(ReadString()); grecordtime[pos-1] = ReadInt24_t(); - if(!myrank_old) { - myrank_old = race_CheckName(GetPlayerName(player_localentnum -1)); - if(!myrank_old) - myrank_old = -1; - } + if(grecordholder[pos-1] == GetPlayerName(player_localentnum -1)) + race_myrank = pos; break; case RACE_NET_SERVER_STATUS: race_status = ReadShort(); diff --git a/data/qcsrc/client/sbar.qc b/data/qcsrc/client/sbar.qc index b67c20e08..f46be275a 100644 --- a/data/qcsrc/client/sbar.qc +++ b/data/qcsrc/client/sbar.qc @@ -1586,7 +1586,6 @@ float race_CheckName(string net_name) { // Does the name already exist in rankin float race_status_time; float race_status_prev; string race_status_name_prev; -float myrank_old; void Sbar_DrawRaceStatus(vector pos) { if (race_status != race_status_prev || race_status_name != race_status_name_prev) { @@ -1603,26 +1602,29 @@ void Sbar_DrawRaceStatus(vector pos) string s; s = textShortenToWidth(race_status_name, 120/10, stringwidth_colors); - float myrank; + float rank; + if(race_status > 0) + rank = race_CheckName(race_status_name); + string rankname; + rankname = race_PlaceName(rank); + if(race_status == 0) drawpic(pos, "gfx/hud/race/newfail", '80 80 0', '1 1 1', sbar_alpha_fg * a, DRAWFLAG_NORMAL); else if(race_status == 1) { drawpic(pos, "gfx/hud/race/newtime", '80 80 0', '1 1 1', sbar_alpha_fg * a, DRAWFLAG_NORMAL); drawcolorcodedstring(pos + '40 80 0' - '5 0 0' * stringwidth(s, TRUE), s, '10 10 0', sbar_alpha_fg * a, DRAWFLAG_NORMAL); + drawstring(pos + '40 20 0' - '7 0 0' * stringwidth(rankname, TRUE), rankname, '14 14 0', '1 1 1', sbar_alpha_fg * a, DRAWFLAG_NORMAL); } else if(race_status == 2) { - myrank = race_CheckName(GetPlayerName(player_localentnum -1)); - if(myrank == myrank_old) { + if(race_status_name == GetPlayerName(player_localentnum -1) || !race_myrank || race_myrank < rank) drawpic(pos, "gfx/hud/race/newrankgreen", '80 80 0', '1 1 1', sbar_alpha_fg * a, DRAWFLAG_NORMAL); - drawcolorcodedstring(pos + '40 80 0' - '5 0 0' * stringwidth(s, TRUE), s, '10 10 0', sbar_alpha_fg * a, DRAWFLAG_NORMAL); - } - else { + else drawpic(pos, "gfx/hud/race/newrankyellow", '80 80 0', '1 1 1', sbar_alpha_fg * a, DRAWFLAG_NORMAL); - drawcolorcodedstring(pos + '40 80 0' - '5 0 0' * stringwidth(s, TRUE), s, '10 10 0', sbar_alpha_fg * a, DRAWFLAG_NORMAL); - myrank_old = race_CheckName(GetPlayerName(player_localentnum -1)); - } + drawcolorcodedstring(pos + '40 80 0' - '5 0 0' * stringwidth(s, TRUE), s, '10 10 0', sbar_alpha_fg * a, DRAWFLAG_NORMAL); + drawstring(pos + '40 20 0' - '7 0 0' * stringwidth(rankname, TRUE), rankname, '14 14 0', '1 1 1', sbar_alpha_fg * a, DRAWFLAG_NORMAL); } else if(race_status == 3) { drawpic(pos, "gfx/hud/race/newrecordserver", '80 80 0', '1 1 1', sbar_alpha_fg * a, DRAWFLAG_NORMAL); drawcolorcodedstring(pos + '40 80 0' - '5 0 0' * stringwidth(s, TRUE), s, '10 10 0', sbar_alpha_fg * a, DRAWFLAG_NORMAL); + drawstring(pos + '40 20 0' - '7 0 0' * stringwidth(rankname, TRUE), rankname, '14 14 0', '1 1 1', sbar_alpha_fg * a, DRAWFLAG_NORMAL); } if (race_status_time - time <= 0) { -- 2.39.2