]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
MOTD moved to notif system by mario
authorSamual Lenks <samual@xonotic.org>
Wed, 27 Feb 2013 20:30:35 +0000 (15:30 -0500)
committerSamual Lenks <samual@xonotic.org>
Wed, 27 Feb 2013 20:30:35 +0000 (15:30 -0500)
qcsrc/common/notifications.qh
qcsrc/server/cl_client.qc

index 39c92dfa74d1bfb816f1925b29098577fd416998..324825855ae93b3a86641c2f4db621fedac136db 100644 (file)
@@ -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"), "") \
index 364e0ffdcb1556c65b5cfe9d5952e38cf0be94eb..b6adecabc674765515140c5ad5889ef0c0c4f994 100644 (file)
@@ -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);
                                }
                        }
                }