From 9dd197c4a61ca8e6e2c935b8a4322ce1e8a2b93a Mon Sep 17 00:00:00 2001 From: FruitieX Date: Tue, 26 Oct 2010 15:12:40 +0300 Subject: [PATCH] integrate race to the hud notify system --- qcsrc/client/hud.qc | 22 ++++++++++++++++++++++ qcsrc/common/constants.qh | 6 ++++++ qcsrc/server/race.qc | 4 ++++ 3 files changed, 32 insertions(+) diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 357f8a0e3..63474604a 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -2919,6 +2919,16 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) // s HUD_KillNotify_Push(s1, s2, 0, INFO_CAPTUREFLAG); print(s1, "^7 captured the ", s2, s3, "\n"); } + } else if(msg == MSG_RACE) { + if(type == RACE_SERVER_RECORD) { + HUD_KillNotify_Push(s1, "", 0, RACE_SERVER_RECORD); + } + else if(type == RACE_NEW_RANK) { + HUD_KillNotify_Push(s1, "", 0, RACE_NEW_RANK); + } + else if(type == RACE_NEW_TIME) { + HUD_KillNotify_Push(s1, "", 0, RACE_NEW_TIME); + } } } @@ -3177,6 +3187,18 @@ void HUD_Notify (void) s = "notify_blue_captured"; } } + else if(killnotify_deathtype[j] == RACE_SERVER_RECORD) + { + s = "race_newrecordserver"; + } + else if(killnotify_deathtype[j] == RACE_NEW_RANK) + { + s = "race_newrankyellow"; + } + else if(killnotify_deathtype[j] == RACE_NEW_TIME) + { + s = "race_newtime"; + } if(s != "" && a) { drawpic_aspect_skin(weap_pos, s, '2 1 0' * height, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL); diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh index 6f0eccfaf..f8ccc13d8 100644 --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@ -560,6 +560,8 @@ float MSG_KILL_ACTION = 3; float MSG_KILL_ACTION_SPREE = 4; float MSG_INFO = 5; +float MSG_RACE = 10; + float KILL_TEAM_RED = 10301; float KILL_TEAM_BLUE = 10302; float KILL_TEAM_SPREE = 10303; @@ -585,6 +587,10 @@ float INFO_LOSTFLAG = 10321; float INFO_RETURNFLAG = 10322; float INFO_CAPTUREFLAG = 10323; +float RACE_SERVER_RECORD = 10400; +float RACE_NEW_TIME = 10401; +float RACE_NEW_RANK = 10402; + // weapon requests float WR_SETUP = 1; // (SVQC) setup weapon data float WR_THINK = 2; // (SVQC) logic to run every frame diff --git a/qcsrc/server/race.qc b/qcsrc/server/race.qc index b351e155e..fde140069 100644 --- a/qcsrc/server/race.qc +++ b/qcsrc/server/race.qc @@ -202,18 +202,22 @@ void race_setTime(string map, float t, string myuid, string mynetname, entity e) bprint(mynetname, "^1 broke ", oldrec_holder, "^1's 1st place record with ", strcat(TIME_ENCODED_TOSTRING(t), recorddifference, "\n")); } race_SendStatus(3, e); // "new server record" + Send_KillNotification(e.netname, "", "", RACE_SERVER_RECORD, MSG_RACE); } else { if(newpos == player_prevpos) { recorddifference = strcat(" ^2[-", TIME_ENCODED_TOSTRING(oldrec - t), "]"); bprint(mynetname, "^5 improved their ", race_placeName(newpos), " ^5place record with ", TIME_ENCODED_TOSTRING(t), recorddifference, "\n"); race_SendStatus(1, e); // "new time" + Send_KillNotification(e.netname, "", "", RACE_NEW_TIME, MSG_RACE); } else if (oldrec == 0) { bprint(mynetname, "^2 set the ", race_placeName(newpos), " ^2place record with ", TIME_ENCODED_TOSTRING(t), "\n"); race_SendStatus(2, e); // "new rank" + Send_KillNotification(e.netname, "", "", RACE_NEW_RANK, MSG_RACE); } else { recorddifference = strcat(" ^2[-", TIME_ENCODED_TOSTRING(oldrec - t), "]"); bprint(mynetname, "^2 broke ", oldrec_holder, "^2's ", race_placeName(newpos), " ^2place record with ", strcat(TIME_ENCODED_TOSTRING(t), recorddifference, "\n")); race_SendStatus(2, e); // "new rank" + Send_KillNotification(e.netname, "", "", RACE_NEW_TIME, MSG_RACE); } } } -- 2.39.2