]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Move more things over to new system
authorSamual Lenks <samual@xonotic.org>
Sat, 20 Apr 2013 22:33:56 +0000 (18:33 -0400)
committerSamual Lenks <samual@xonotic.org>
Sat, 20 Apr 2013 22:33:56 +0000 (18:33 -0400)
qcsrc/client/announcer.qc
qcsrc/common/notifications.qh
qcsrc/server/arena.qc
qcsrc/server/cl_client.qc
qcsrc/server/command/common.qc
qcsrc/server/command/vote.qc
qcsrc/server/defs.qh
qcsrc/server/g_world.qc

index 6074bf89a4f85955818cbeb3825e04168c68d2f1..9bbbbb96787c2b6a4fedb16582cb40b550f170ff 100644 (file)
@@ -27,7 +27,7 @@ void Announcer_Countdown()
        
        if(countdown <= 0) // countdown has finished, starttime is now
        {
-               Local_Notification(MSG_MULTI, MULTI_BEGIN); 
+               Local_Notification(MSG_MULTI, MULTI_COUNTDOWN_BEGIN); 
                announcer_5min = announcer_1min = FALSE; // reset maptime announcers now as well
                remove(self);
                return;
index 18628e08206afe48468485299d303f5ab62799c8..c21488d3664d52dd8e427a418f5bf14a60a84ec0 100644 (file)
@@ -606,7 +606,8 @@ void Send_Notification_WOVA(
        MSG_MULTI_NOTIF(1, ITEM_WEAPON_NOAMMO,                   NO_MSG,       INFO_ITEM_WEAPON_NOAMMO,                   CENTER_ITEM_WEAPON_NOAMMO) \
        MSG_MULTI_NOTIF(1, ITEM_WEAPON_PRIMORSEC,                NO_MSG,       INFO_ITEM_WEAPON_PRIMORSEC,                CENTER_ITEM_WEAPON_PRIMORSEC) \
        MSG_MULTI_NOTIF(1, ITEM_WEAPON_UNAVAILABLE,              NO_MSG,       INFO_ITEM_WEAPON_UNAVAILABLE,              CENTER_ITEM_WEAPON_UNAVAILABLE) \
-       MSG_MULTI_NOTIF(1, MULTI_BEGIN,                          ANNCE_BEGIN,  NO_MSG,                                    CENTER_COUNTDOWN_BEGIN) \
+       MSG_MULTI_NOTIF(1, MULTI_ARENA_BEGIN,                    ANNCE_BEGIN,  NO_MSG,                                    CENTER_ARENA_BEGIN) \
+       MSG_MULTI_NOTIF(1, MULTI_COUNTDOWN_BEGIN,                ANNCE_BEGIN,  NO_MSG,                                    CENTER_COUNTDOWN_BEGIN) \
        MSG_MULTI_NOTIF(1, WEAPON_ACCORDEON_MURDER,              NO_MSG,       INFO_WEAPON_ACCORDEON_MURDER,              NO_MSG) \
        MSG_MULTI_NOTIF(1, WEAPON_ACCORDEON_SUICIDE,             NO_MSG,       INFO_WEAPON_ACCORDEON_SUICIDE,             CENTER_DEATH_SELF_GENERIC) \
        MSG_MULTI_NOTIF(1, WEAPON_CRYLINK_MURDER,                NO_MSG,       INFO_WEAPON_CRYLINK_MURDER,                NO_MSG) \
index 8a4a404307a1a87749fd88613f1418d79b4f5ed5..34b81bb62a1bb0d6c2b077ddc4e3d602c863c094 100644 (file)
@@ -237,13 +237,13 @@ void Arena_Warmup()
                                warmup = time + autocvar_g_ca_warmup;
                        } else {
                                if(f == 5)
-                                       Announce("prepareforbattle");
+                                       Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_PREPARE);
                                else if(f == 3)
-                                       Announce("3");
+                                       Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_NUM_3);
                                else if(f == 2)
-                                       Announce("2");
+                                       Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_NUM_2);
                                else if(f == 1)
-                                       Announce("1");
+                                       Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_NUM_1);
 
                                Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ARENA_ROUNDSTART, f);
                        }
@@ -266,8 +266,7 @@ void Arena_Warmup()
                        else
                                reset_map(TRUE);
                } else {
-                       Announce("begin");
-                       Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ARENA_BEGIN); 
+                       Send_Notification(NOTIF_ALL, world, MSG_MULTI, MULTI_ARENA_BEGIN);
                }
 
                if(g_arena) {
index 4c7d5c57564d8f7b674c610629e45faac08ab7b7..5322371f9b605fe4052bfa56b327e7a655dbfb74 100644 (file)
@@ -6,11 +6,6 @@ void send_CSQC_teamnagger() {
        WriteByte(MSG_BROADCAST, TE_CSQC_TEAMNAGGER);
 }
 
-void Announce(string snd) {
-       WriteByte(MSG_BROADCAST, SVC_TEMPENTITY);
-       WriteByte(MSG_BROADCAST, TE_CSQC_ANNOUNCE);
-       WriteString(MSG_BROADCAST, snd);
-}
 
 void AnnounceTo(entity e, string snd) {
        if (clienttype(e) == CLIENTTYPE_REAL)
index e95cf4c6585ba07ec0aa45008bdaf747bb728f8f..132a0af70e31be2fbc97bbc79006ae5b5c1f263c 100644 (file)
@@ -182,7 +182,7 @@ void timeout_handler_think()
                                Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_TIMEOUT_ENDING, timeout_time);
 
                                if(timeout_time == autocvar_sv_timeout_resumetime) // play a warning sound when only <sv_timeout_resumetime> seconds are left
-                                       Announce("prepareforbattle");
+                                       Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_PREPARE);
 
                                self.nextthink = time + TIMEOUT_SLOWMO_VALUE; // think again in one second
                                timeout_time -= 1; // decrease the time counter
@@ -575,7 +575,7 @@ void CommonCommand_timeout(float request, entity caller) // DEAR GOD THIS COMMAN
                                        timeout_handler.think = timeout_handler_think;
                                        timeout_handler.nextthink = time; // always let the entity think asap
 
-                                       Announce("timeoutcalled");
+                                       Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_TIMEOUT);
                                }
                        }
                        else { print_to(caller, "^1Timeouts are not allowed to be called, enable them with sv_timeout 1.\n"); }
index 329fb9d4ef98c1a4d8d4ee0c30b8b15e9625f701..059a51939d4287f5b58b0c68281bd92ce76c393f 100644 (file)
@@ -148,21 +148,21 @@ void VoteAccept()
        if(vote_caller) { vote_caller.vote_waittime = 0; } // people like your votes, you don't need to wait to vote again
 
        VoteReset();
-       Announce("voteaccept");
+       Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_VOTE_ACCEPT);
 }
 
 void VoteReject() 
 {
        bprint("\{1}^2* ^3", GetCallerName(vote_caller), "^2's vote for ", vote_called_display, "^2 was rejected\n");
        VoteReset();
-       Announce("votefail");
+       Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_VOTE_FAIL);
 }
 
 void VoteTimeout() 
 {
        bprint("\{1}^2* ^3", GetCallerName(vote_caller), "^2's vote for ", vote_called_display, "^2 timed out\n");
        VoteReset();
-       Announce("votefail");
+       Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_VOTE_FAIL);
 }
 
 void VoteSpam(float notvoters, float mincount, string result)
@@ -725,7 +725,7 @@ void VoteCommand_call(float request, entity caller, float argc, string vote_comm
                                }
                                
                                FOR_EACH_REALCLIENT(tmp_player) { ++tmp_playercount; }
-                               if(tmp_playercount > 1) { Announce("votecall"); } // don't announce a "vote now" sound if player is alone
+                               if(tmp_playercount > 1) { Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_VOTE_CALL); } // don't announce a "vote now" sound if player is alone
                                
                                bprint("\{1}^2* ^3", GetCallerName(vote_caller), "^2 calls a vote for ", vote_called_display, "\n");
                                if(autocvar_sv_eventlog) { GameLogEcho(strcat(":vote:vcall:", ftos(vote_caller.playerid), ":", vote_called_display)); }
index 668433ce0058ad55f603b9062a23bf4e3e478d5a..13b2dc7a06c17442a5607dd0811a791a48b69687 100644 (file)
@@ -281,7 +281,6 @@ float default_weapon_alpha;
 .float cvar_cl_allow_uidtracking;
 .string stored_netname;
 
-void Announce(string snd);
 void AnnounceTo(entity e, string snd);
 
 .float version_nagtime;
index a9b958568948339d897aff0fc110fe0ccfe33811..25cd566587e051965be60b23d6a586b0366fff63 100644 (file)
@@ -1961,11 +1961,11 @@ float WinningCondition_Scores(float limit, float leadlimit)
 
                        if (limit)
                        if (leaderfrags == limit - 1)
-                               Announce("1fragleft");
+                               Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_REMAINING_FRAG_1);
                        else if (leaderfrags == limit - 2)
-                               Announce("2fragsleft");
+                               Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_REMAINING_FRAG_2);
                        else if (leaderfrags == limit - 3)
-                               Announce("3fragsleft");
+                               Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_REMAINING_FRAG_3);
                }
        }