[nexuiz-commits] r8531 - trunk/data/qcsrc/client
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Sat Jan 23 05:03:13 EST 2010
Author: fruitiex
Date: 2010-01-23 05:03:12 -0500 (Sat, 23 Jan 2010)
New Revision: 8531
Modified:
trunk/data/qcsrc/client/Defs.qc
trunk/data/qcsrc/client/Main.qc
trunk/data/qcsrc/client/sbar.qc
Log:
fix yellow race medal, add gained/improved pos to them
Modified: trunk/data/qcsrc/client/Defs.qc
===================================================================
--- trunk/data/qcsrc/client/Defs.qc 2010-01-22 20:53:50 UTC (rev 8530)
+++ trunk/data/qcsrc/client/Defs.qc 2010-01-23 10:03:12 UTC (rev 8531)
@@ -212,7 +212,7 @@
float sb_showscores_force;
float race_status;
string race_status_name;
-float myrank_old;
+float race_myrank;
// Nexball
float nb_pb_period;
Modified: trunk/data/qcsrc/client/Main.qc
===================================================================
--- trunk/data/qcsrc/client/Main.qc 2010-01-22 20:53:50 UTC (rev 8530)
+++ trunk/data/qcsrc/client/Main.qc 2010-01-23 10:03:12 UTC (rev 8531)
@@ -1128,11 +1128,8 @@
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();
Modified: trunk/data/qcsrc/client/sbar.qc
===================================================================
--- trunk/data/qcsrc/client/sbar.qc 2010-01-22 20:53:50 UTC (rev 8530)
+++ trunk/data/qcsrc/client/sbar.qc 2010-01-23 10:03:12 UTC (rev 8531)
@@ -1586,7 +1586,6 @@
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 @@
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) {
More information about the nexuiz-commits
mailing list