From: Samual Lenks Date: Wed, 27 Feb 2013 20:30:35 +0000 (-0500) Subject: MOTD moved to notif system by mario X-Git-Tag: xonotic-v0.7.0~62^2~23^2~74 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8f90a7d3b94317b9a81c21e54a31ce5d27bb4ba1;p=xonotic%2Fxonotic-data.pk3dir.git MOTD moved to notif system by mario --- diff --git a/qcsrc/common/notifications.qh b/qcsrc/common/notifications.qh index 39c92dfa7..324825855 100644 --- a/qcsrc/common/notifications.qh +++ b/qcsrc/common/notifications.qh @@ -64,7 +64,6 @@ void Send_Notification_WOVA(float broadcast, entity client, float net_type, floa // legacy stuff void Send_CSQC_Centerprint_Generic(entity e, float id, string s, float duration, float countdown_num); #define Send_CSQC_Centerprint_Generic_Expire(e,id) Send_CSQC_Centerprint_Generic(e, id, "", 1, 0) -float CPID_MOTD = 9; float CPID_KH_MSG = 10; #endif @@ -400,6 +399,7 @@ float CPID_KH_MSG = 10; MSG_CENTER_NOTIF(1, CENTER_KEEPAWAY_PICKUP, 1, 0, "s1", CPID_KEEPAWAY, "0 0", _("^BG%s^BG has picked up the ball!"), "") \ MSG_CENTER_NOTIF(1, CENTER_KEEPAWAY_WARN, 0, 0, "", CPID_KA_WARN, "0 0", _("^BGKilling people while you don't have the ball gives no points!"), "") \ MSG_CENTER_NOTIF(1, CENTER_LMS_CAMPCHECK, 0, 0, "", CPID_LMS_CAMP, "0 0", _("^F2Don't camp!"), "") \ + MSG_CENTER_NOTIF(1, CENTER_MOTD, 1, 0, "s1", CPID_MOTD, "-1 0", _("^BG%s"), "") \ MSG_CENTER_NOTIF(1, CENTER_MINSTA_FINDAMMO, 0, 0, "", CPID_MINSTA_FINDAMMO, "1 9", _("^F4^COUNT^BG left to find some ammo!"), "") \ MSG_CENTER_NOTIF(1, CENTER_MINSTA_FINDAMMO_FIRST, 0, 0, "", CPID_MINSTA_FINDAMMO, "1 10", _("^BGGet some ammo or you'll be dead in ^F4^COUNT^BG!"), _("Get some ammo! ^F4^COUNT^BG left!")) \ MSG_CENTER_NOTIF(1, CENTER_NIX_COUNTDOWN, 0, 2, "item_wepname", CPID_NIX, "1 f2", _("^F2^COUNT^BG until weapon change...\nNext weapon: ^F1%s"), "") \ diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 364e0ffdc..b6adecabc 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -1579,7 +1579,7 @@ void ClientConnect (void) CheatInitClient(); if(!autocvar_g_campaign) - Send_CSQC_Centerprint_Generic(self, CPID_MOTD, getwelcomemessage(), autocvar_welcome_message_time, 0); + Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_MOTD, getwelcomemessage()); CSQCMODEL_AUTOINIT(); @@ -2341,7 +2341,7 @@ void LeaveSpectatorMode() if(!autocvar_g_campaign) if (time < self.jointime + autocvar_welcome_message_time) - Send_CSQC_Centerprint_Generic_Expire(self, CPID_MOTD); // clear MOTD + Kill_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_MOTD); if (self.prevent_join_msgtime) { @@ -2428,12 +2428,12 @@ void PrintWelcomeMessage() if (autocvar_g_campaign) { if ((self.classname == "player" && self.BUTTON_INFO) || (self.classname != "player")) { self.motd_actived_time = time; - Send_CSQC_Centerprint_Generic(self, CPID_MOTD, campaign_message, -1, 0); + Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_MOTD, campaign_message); } } else { if ((time - self.jointime > autocvar_welcome_message_time) && self.BUTTON_INFO) { self.motd_actived_time = time; - Send_CSQC_Centerprint_Generic(self, CPID_MOTD, getwelcomemessage(), -1, 0); + Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_MOTD, getwelcomemessage()); } } } else { // showing MOTD or campaign message @@ -2442,7 +2442,7 @@ void PrintWelcomeMessage() self.motd_actived_time = time; else if ((time - self.motd_actived_time > 2) && self.classname == "player") { // hide it some seconds after BUTTON_INFO has been released self.motd_actived_time = 0; - Send_CSQC_Centerprint_Generic_Expire(self, CPID_MOTD); + Kill_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_MOTD); } } else { if ((time - self.jointime) > autocvar_welcome_message_time) { @@ -2450,7 +2450,7 @@ void PrintWelcomeMessage() self.motd_actived_time = time; else if (time - self.motd_actived_time > 2) { // hide it some seconds after BUTTON_INFO has been released self.motd_actived_time = 0; - Send_CSQC_Centerprint_Generic_Expire(self, CPID_MOTD); + Kill_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_MOTD); } } }