[nexuiz-commits] r8509 - in trunk/data/qcsrc: client server
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Sat Jan 16 17:26:53 EST 2010
Author: fruitiex
Date: 2010-01-16 17:26:53 -0500 (Sat, 16 Jan 2010)
New Revision: 8509
Modified:
trunk/data/qcsrc/client/Defs.qc
trunk/data/qcsrc/client/Main.qc
trunk/data/qcsrc/client/sbar.qc
trunk/data/qcsrc/server/race.qc
Log:
move the badge to a better place, show them to all players along with a name
Modified: trunk/data/qcsrc/client/Defs.qc
===================================================================
--- trunk/data/qcsrc/client/Defs.qc 2010-01-16 20:30:17 UTC (rev 8508)
+++ trunk/data/qcsrc/client/Defs.qc 2010-01-16 22:26:53 UTC (rev 8509)
@@ -211,6 +211,7 @@
string race_othercheckpointenemy;
float sb_showscores_force;
float race_status;
+string race_status_name;
// Nexball
float nb_pb_period;
Modified: trunk/data/qcsrc/client/Main.qc
===================================================================
--- trunk/data/qcsrc/client/Main.qc 2010-01-16 20:30:17 UTC (rev 8508)
+++ trunk/data/qcsrc/client/Main.qc 2010-01-16 22:26:53 UTC (rev 8509)
@@ -1122,6 +1122,9 @@
break;
case RACE_NET_SERVER_STATUS:
race_status = ReadShort();
+ if(race_status_name)
+ strunzone(race_status_name);
+ race_status_name = strzone(ReadString());
}
}
Modified: trunk/data/qcsrc/client/sbar.qc
===================================================================
--- trunk/data/qcsrc/client/sbar.qc 2010-01-16 20:30:17 UTC (rev 8508)
+++ trunk/data/qcsrc/client/sbar.qc 2010-01-16 22:26:53 UTC (rev 8509)
@@ -1587,12 +1587,19 @@
float a;
a = bound(0, race_status_time - time, 1);
+ string s;
+ s = textShortenToWidth(race_status_name, 120/9, stringwidth_colors);
+
if(race_status == 0)
drawpic(pos, "gfx/hud/race/newtime", '80 80 0', '1 1 1', sbar_alpha_fg * a, DRAWFLAG_NORMAL);
- else if(race_status == 1)
+ else if(race_status == 1) {
drawpic(pos, "gfx/hud/race/newrank", '80 80 0', '1 1 1', sbar_alpha_fg * a, DRAWFLAG_NORMAL);
- else if(race_status == 2)
+ drawcolorcodedstring(pos + '-20 80 0', s, '10 10 0', sbar_alpha_fg * a, DRAWFLAG_NORMAL);
+
+ } else if(race_status == 2) {
drawpic(pos, "gfx/hud/race/newrecord", '80 80 0', '1 1 1', sbar_alpha_fg * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos + '-20 80 0', s, '10 10 0', sbar_alpha_fg * a, DRAWFLAG_NORMAL);
+ }
if (race_status_time - time <= 0) {
race_status_prev = -1;
@@ -1729,7 +1736,6 @@
m = '0.5 0 0' * vid_conwidth + '0 1 0' * cvar_or("cl_racetimer_position", 0.25) * vid_conheight;
- Sbar_DrawRaceStatus(m + '100 0 0');
if(race_checkpointtime)
{
a = bound(0, 2 - (time - race_checkpointtime), 1);
@@ -1840,6 +1846,8 @@
float scale;
scale = cvar_or("sbar_timer_scale", 1);
timelimit = getstatf(STAT_TIMELIMIT);
+
+ Sbar_DrawRaceStatus((topright_x - 100) * '1 0 0' + '0 30 0' * scale);
timeleft = max(0, timelimit * 60 + getstatf(STAT_GAMESTARTTIME) - time);
timeleft = ceil(timeleft);
Modified: trunk/data/qcsrc/server/race.qc
===================================================================
--- trunk/data/qcsrc/server/race.qc 2010-01-16 20:30:17 UTC (rev 8508)
+++ trunk/data/qcsrc/server/race.qc 2010-01-16 22:26:53 UTC (rev 8509)
@@ -195,13 +195,18 @@
void race_SendStatus(float id, entity e)
{
- float msg = MSG_ONE;
+ float msg;
+ if (id == 0)
+ msg = MSG_ONE;
+ else
+ msg = MSG_ALL;
msg_entity = e;
WRITESPECTATABLE_MSG_ONE_VARNAME(dummy3, {
WriteByte(msg, SVC_TEMPENTITY);
WriteByte(msg, TE_CSQC_RACE);
WriteByte(msg, RACE_NET_SERVER_STATUS);
WriteShort(msg, id);
+ WriteString(msg, e.netname);
});
}
More information about the nexuiz-commits
mailing list