From: Samual Lenks Date: Tue, 26 Feb 2013 21:52:56 +0000 (-0500) Subject: Timeout countdowns now too :D X-Git-Tag: xonotic-v0.7.0~62^2~23^2~101 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7c2e80951a66d9e8ba368dbdc29d45c3610c316c;p=xonotic%2Fxonotic-data.pk3dir.git Timeout countdowns now too :D --- diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh index e1562fb25..e60b0975a 100644 --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@ -378,8 +378,6 @@ float WATERLEVEL_SUBMERGED = 3; float MAX_SHOT_DISTANCE = 32768; //centerprint ID list -float CPID_GAME_STARTING = 7; -float CPID_TIMEOUT_COUNTDOWN = 8; float CPID_MOTD = 9; float CPID_KH_MSG = 10; diff --git a/qcsrc/common/notifications.qh b/qcsrc/common/notifications.qh index 7d06dc6fa..6502e6253 100644 --- a/qcsrc/common/notifications.qh +++ b/qcsrc/common/notifications.qh @@ -415,7 +415,9 @@ void Send_CSQC_Centerprint_Generic(entity e, float id, string s, float duration, MULTITEAM_CENTER(1, CENTER_TEAMCHANGE_, 4, 0, 1, "", CPID_TEAMCHANGE, "1 f1", _("^BGChanging to ^TC^TT^BG in ^COUNT"), "") \ MSG_CENTER_NOTIF(1, CENTER_TEAMCHANGE_SPECTATE, 0, 1, "", CPID_TEAMCHANGE, "1 f1", _("^BGSpectating in ^COUNT"), "") \ MSG_CENTER_NOTIF(1, CENTER_TEAMCHANGE_AUTO, 0, 1, "", CPID_TEAMCHANGE, "1 f1", _("^BGChanging team in ^COUNT"), "") \ - MSG_CENTER_NOTIF(1, CENTER_TEAMCHANGE_SUICIDE, 0, 1, "", CPID_TEAMCHANGE, "1 f1", _("^K1Suicide in ^COUNT"), "") + MSG_CENTER_NOTIF(1, CENTER_TEAMCHANGE_SUICIDE, 0, 1, "", CPID_TEAMCHANGE, "1 f1", _("^K1Suicide in ^COUNT"), "") \ + MSG_CENTER_NOTIF(1, CENTER_TIMEOUT_BEGINNING, 0, 1, "", CPID_TIMEOUT, "1 f1", _("^F4Timeout begins in ^COUNT"), "") \ + MSG_CENTER_NOTIF(1, CENTER_TIMEOUT_ENDING, 0, 1, "", CPID_TIMEOUT, "1 f1", _("^F4Timeout ends in ^COUNT"), "") #define MSG_WEAPON_NOTIFICATIONS \ /*MSG_WEAPON_NOTIF(1, WEAPON_EMPTY, NO_MSG, NO_MSG)*/ \ diff --git a/qcsrc/server/command/common.qc b/qcsrc/server/command/common.qc index 516c6aa5d..6022b689a 100644 --- a/qcsrc/server/command/common.qc +++ b/qcsrc/server/command/common.qc @@ -162,14 +162,9 @@ void print_to(entity to, string input) // used by CommonCommand_timeout() and CommonCommand_timein() to handle game pausing and messaging and such. void timeout_handler_reset() { - entity tmp_player; - timeout_caller = world; timeout_time = 0; timeout_leadtime = 0; - - FOR_EACH_REALPLAYER(tmp_player) - Send_CSQC_Centerprint_Generic_Expire(tmp_player, CPID_TIMEOUT_COUNTDOWN); remove(self); } @@ -184,8 +179,7 @@ void timeout_handler_think() { if(timeout_time > 0) // countdown is still going { - FOR_EACH_REALPLAYER(tmp_player) - Send_CSQC_Centerprint_Generic(tmp_player, CPID_TIMEOUT_COUNTDOWN, "Timeout ends in %d seconds!", 1, timeout_time); + Send_Notification(NOTIF_ANY, world, MSG_CENTER, CENTER_TIMEOUT_ENDING, timeout_time); if(timeout_time == autocvar_sv_timeout_resumetime) // play a warning sound when only seconds are left Announce("prepareforbattle"); @@ -214,9 +208,7 @@ void timeout_handler_think() { if(timeout_leadtime > 0) // countdown is still going { - // centerprint the information to every player - FOR_EACH_REALPLAYER(tmp_player) - Send_CSQC_Centerprint_Generic(tmp_player, CPID_TIMEOUT_COUNTDOWN, "Timeout begins in %d seconds!", 1, timeout_leadtime); + Send_Notification(NOTIF_ANY, world, MSG_CENTER, CENTER_TIMEOUT_BEGINNING, timeout_leadtime); self.nextthink = time + 1; // think again in one second timeout_leadtime -= 1; // decrease the time counter