From 886f1b8ced3dc389d9c34124a4fc912eab762db5 Mon Sep 17 00:00:00 2001 From: terencehill Date: Sun, 10 Mar 2013 00:12:30 +0100 Subject: [PATCH] Give missing teams/players msgs infinite lifetime, expire them only when they are shown and make them independent from round msgs so they can be used in other situations too. Countdown to round start is now stopped by a msg, as it seems there's no CS version of Kill_Notification --- qcsrc/client/announcer.qc | 1 + qcsrc/common/notifications.qh | 5 +++-- qcsrc/server/mutators/gamemode_arena.qc | 3 ++- qcsrc/server/mutators/gamemode_ca.qc | 3 ++- qcsrc/server/mutators/gamemode_freezetag.qc | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/qcsrc/client/announcer.qc b/qcsrc/client/announcer.qc index 3397f84ac..6258377b1 100644 --- a/qcsrc/client/announcer.qc +++ b/qcsrc/client/announcer.qc @@ -25,6 +25,7 @@ void Announcer_Countdown() float roundstarttime = getstatf(STAT_ROUNDSTARTTIME); if(roundstarttime == -1) { + Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_ROUNDSTOP); remove(self); return; } diff --git a/qcsrc/common/notifications.qh b/qcsrc/common/notifications.qh index d7e1477f7..5a8113128 100644 --- a/qcsrc/common/notifications.qh +++ b/qcsrc/common/notifications.qh @@ -371,6 +371,7 @@ void Send_Notification_WOVA( MSG_CENTER_NOTIF(1, CENTER_COUNTDOWN_BEGIN, 0, 0, "", CPID_ROUND, "2 0", _("^F4Begin!"), "") \ MSG_CENTER_NOTIF(1, CENTER_COUNTDOWN_GAMESTART, 0, 1, "", CPID_ROUND, "1 f1", _("^F4Game starts in ^COUNT"), "") \ MSG_CENTER_NOTIF(1, CENTER_COUNTDOWN_ROUNDSTART, 0, 1, "", CPID_ROUND, "1 f1", _("^F4Round starts in ^COUNT"), "") \ + MSG_CENTER_NOTIF(1, CENTER_COUNTDOWN_ROUNDSTOP, 0, 0, "", CPID_ROUND, "2 0", _("^F4Round cannot start"), "") \ MSG_CENTER_NOTIF(1, CENTER_ROUND_TIED, 0, 0, "", CPID_ROUND, "0 0", _("^BGRound tied"), "") \ MSG_CENTER_NOTIF(1, CENTER_ROUND_OVER, 0, 0, "", CPID_ROUND, "0 0", _("^BGRound over, there's no winner"), "") \ MSG_CENTER_NOTIF(1, CENTER_CTF_CAPTURESHIELD_FREE, 0, 0, "", CPID_CTF_CAPSHIELD, "0 0", _("^BGYou are now free.\n^BGFeel free to ^F2try to capture^BG the flag again\n^BGif you think you will succeed."), "") \ @@ -458,8 +459,8 @@ void Send_Notification_WOVA( MSG_CENTER_NOTIF(1, CENTER_KEYHUNT_SCAN, 0, 1, "", CPID_KEYHUNT_OTHER, "f1 0", _("^BGScanning frequency range..."), "") \ MULTITEAM_CENTER(1, CENTER_KEYHUNT_START_, 4, 0, 0, "", CPID_KEYHUNT, "0 0", _("^BGYou are starting with the ^TC^TT Key"), "") \ MSG_CENTER_NOTIF(1, CENTER_KEYHUNT_WAIT, 0, 4, "missing_teams", CPID_KEYHUNT_OTHER, "0 0", _("^BGWaiting for players to join...\nNeed active players for: %s"), "") \ - MSG_CENTER_NOTIF(1, CENTER_MISSING_TEAMS, 0, 4, "missing_teams", CPID_ROUND, "0 0", _("^BGWaiting for players to join...\nNeed active players for: %s"), "") \ - MSG_CENTER_NOTIF(1, CENTER_MISSING_PLAYERS, 0, 1, "f1", CPID_ROUND, "0 0", _("^BGWaiting for %s player(s) to join..."), "") \ + MSG_CENTER_NOTIF(1, CENTER_MISSING_TEAMS, 0, 4, "missing_teams", CPID_MISSING_TEAMS, "-1 0", _("^BGWaiting for players to join...\nNeed active players for: %s"), "") \ + MSG_CENTER_NOTIF(1, CENTER_MISSING_PLAYERS, 0, 1, "f1", CPID_MISSING_PLAYERS, "-1 0", _("^BGWaiting for %s player(s) to join..."), "") \ MSG_CENTER_NOTIF(1, CENTER_LMS_CAMPCHECK, 0, 0, "", CPID_LMS_CAMP, "0 0", _("^F2Don't camp!"), "") \ 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!"), _("^BGGet some ammo! ^F4^COUNT^BG left!")) \ diff --git a/qcsrc/server/mutators/gamemode_arena.qc b/qcsrc/server/mutators/gamemode_arena.qc index df82e23e0..0410eb2fb 100644 --- a/qcsrc/server/mutators/gamemode_arena.qc +++ b/qcsrc/server/mutators/gamemode_arena.qc @@ -120,7 +120,8 @@ float Arena_CheckPlayers() if(numspawned >= 2) { - Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_MISSING_PLAYERS); + if(prev_numspawned > 0) + Kill_Notification(NOTIF_ALL, world, MSG_CENTER_CPID, CPID_MISSING_PLAYERS); prev_numspawned = -1; return 1; } diff --git a/qcsrc/server/mutators/gamemode_ca.qc b/qcsrc/server/mutators/gamemode_ca.qc index 9a1e6b206..3e8d1b747 100644 --- a/qcsrc/server/mutators/gamemode_ca.qc +++ b/qcsrc/server/mutators/gamemode_ca.qc @@ -113,7 +113,8 @@ float CA_CheckTeams() CA_count_alive_players(); if(CA_ALIVE_TEAMS_OK()) { - Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_MISSING_TEAMS); + if(prev_total_players > 0) + Kill_Notification(NOTIF_ALL, world, MSG_CENTER_CPID, CPID_MISSING_TEAMS); prev_total_players = -1; return 1; } diff --git a/qcsrc/server/mutators/gamemode_freezetag.qc b/qcsrc/server/mutators/gamemode_freezetag.qc index 5cfd1b9f5..2c3ab37b0 100644 --- a/qcsrc/server/mutators/gamemode_freezetag.qc +++ b/qcsrc/server/mutators/gamemode_freezetag.qc @@ -47,7 +47,8 @@ float freezetag_CheckTeams() { if(FREEZETAG_ALIVE_TEAMS_OK()) { - Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_MISSING_TEAMS); + if(prev_total_players > 0) + Kill_Notification(NOTIF_ALL, world, MSG_CENTER_CPID, CPID_MISSING_TEAMS); prev_total_players = -1; return 1; } -- 2.39.2