From 2841b2142c245f0a5bbe72596e086f79d0231edd Mon Sep 17 00:00:00 2001 From: esteel Date: Fri, 5 Sep 2008 19:43:02 +0000 Subject: [PATCH] added a simple 'warmup' indicator to the scoreboard git-svn-id: svn://svn.icculus.org/nexuiz/trunk@4368 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/client/Main.qc | 9 +++++++++ data/qcsrc/client/main.qh | 1 + data/qcsrc/client/sbar.qc | 8 ++++++++ data/qcsrc/common/constants.qh | 4 +++- data/qcsrc/server/cl_client.qc | 5 +++++ data/qcsrc/server/clientcommands.qc | 5 +++++ 6 files changed, 31 insertions(+), 1 deletion(-) diff --git a/data/qcsrc/client/Main.qc b/data/qcsrc/client/Main.qc index 65e67ca9c..ada82aa9e 100644 --- a/data/qcsrc/client/Main.qc +++ b/data/qcsrc/client/Main.qc @@ -764,6 +764,11 @@ void Net_ReadSpawn() current_viewzoom = 0.6; } +void Net_ReadWarmupStage() +{ + warmup_stage = ReadByte(); +} + // CSQC_Parse_TempEntity : Handles all temporary entity network data in the CSQC layer. // You must ALWAYS first acquire the temporary ID, which is sent as a byte. // Return value should be 1 if CSQC handled the temporary entity, otherwise return 0 to have the engine process the event. @@ -823,6 +828,10 @@ float CSQC_Parse_TempEntity() Net_ReadHoldAngles(); bHandled = true; break; + case TE_CSQC_WARMUP: + Net_ReadWarmupStage(); + bHandled = true; + break; default: // No special logic for this temporary entity; return 0 so the engine can handle it bHandled = false; diff --git a/data/qcsrc/client/main.qh b/data/qcsrc/client/main.qh index 501af193a..caace7521 100644 --- a/data/qcsrc/client/main.qh +++ b/data/qcsrc/client/main.qh @@ -122,5 +122,6 @@ float current_viewzoom; float zoomin_effect; float ignore_plus_zoom; float ignore_minus_zoom; +float warmup_stage; float weaponimpulse[24]; diff --git a/data/qcsrc/client/sbar.qc b/data/qcsrc/client/sbar.qc index 0c7b1a700..c7de2b487 100644 --- a/data/qcsrc/client/sbar.qc +++ b/data/qcsrc/client/sbar.qc @@ -931,9 +931,17 @@ void Sbar_DrawScoreboard() } } + pos_y += 1.5 * sbar_fontsize_y; drawcolorcodedstring(pos + '0.5 0 0' * (sbwidth - sbar_fontsize_x * stringwidth(str, TRUE)), str, sbar_fontsize, 0.8, 0); + if(warmup_stage) + { + str = "^1Currently just warmup phase"; + pos_y += 1.5 * sbar_fontsize_y; + drawcolorcodedstring(pos + '0.5 0 0' * (sbwidth - sbar_fontsize_x * stringwidth(str, TRUE)), str, sbar_fontsize, 0.8, 0); + } + sbar = sbar_save; } diff --git a/data/qcsrc/common/constants.qh b/data/qcsrc/common/constants.qh index 1f3d220d1..066ae5c6a 100644 --- a/data/qcsrc/common/constants.qh +++ b/data/qcsrc/common/constants.qh @@ -16,7 +16,8 @@ // Revision 15: zoom // Revision 16: multi-weapons // Revision 17: multi-weaponimpulses -#define CSQC_REVISION 17 +// Revision 18: warmup +#define CSQC_REVISION 18 // probably put these in common/ // so server/ and client/ can be synced better @@ -203,6 +204,7 @@ const float TE_CSQC_SPECTATING = 111; const float TE_CSQC_SPAWN = 112; const float TE_CSQC_ZOOMNOTIFY = 113; const float TE_CSQC_HOLDANGLES = 114; +const float TE_CSQC_WARMUP = 115; const float STAT_KH_KEYS = 32; const float STAT_CTF_STATE = 33; diff --git a/data/qcsrc/server/cl_client.qc b/data/qcsrc/server/cl_client.qc index 970c21aca..da885febd 100644 --- a/data/qcsrc/server/cl_client.qc +++ b/data/qcsrc/server/cl_client.qc @@ -586,6 +586,11 @@ void PutClientInServer (void) WriteEntity(MSG_ONE, self); } + msg_entity = self; + WriteByte(MSG_ONE, SVC_TEMPENTITY); + WriteByte(MSG_ONE, TE_CSQC_WARMUP); + WriteByte(MSG_ONE, !tourneyInMatchStage); + // player is dead and becomes observer // FIXME fix LMS scoring for new system if(g_lms) diff --git a/data/qcsrc/server/clientcommands.qc b/data/qcsrc/server/clientcommands.qc index 7a5ea2e78..0ebad287f 100644 --- a/data/qcsrc/server/clientcommands.qc +++ b/data/qcsrc/server/clientcommands.qc @@ -417,6 +417,11 @@ void ReadyRestart() //reset the .ready status of all players (also spectators) FOR_EACH_CLIENTSLOT(e) { + msg_entity = e; + WriteByte(MSG_ONE, SVC_TEMPENTITY); + WriteByte(MSG_ONE, TE_CSQC_WARMUP); + WriteByte(MSG_ONE, !tourneyInMatchStage); + e.ready = 0; } if(0