From 694c6bc49ef494df87c68005dc69722dae6fc467 Mon Sep 17 00:00:00 2001 From: terencehill Date: Tue, 20 Sep 2016 18:18:41 +0200 Subject: [PATCH] Make timeout countdown message immediately fully visible otherwise it stays almost invisible as it starts fading in VERY slowly (due to slowmo being set to 0.0001 during a timeout) --- qcsrc/client/hud/panel/centerprint.qc | 4 ++++ qcsrc/common/notifications/all.inc | 2 +- qcsrc/common/notifications/all.qh | 1 + qcsrc/server/command/common.qc | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/qcsrc/client/hud/panel/centerprint.qc b/qcsrc/client/hud/panel/centerprint.qc index 5b8069010..f67cbffbd 100644 --- a/qcsrc/client/hud/panel/centerprint.qc +++ b/qcsrc/client/hud/panel/centerprint.qc @@ -1,6 +1,7 @@ #include "centerprint.qh" #include "scoreboard.qh" +#include // CenterPrint (#16) @@ -246,6 +247,9 @@ void HUD_CenterPrint () else // Expiring soon, so fade it out. a = (centerprint_expire_time[j] - time) / max(0.0001, autocvar_hud_panel_centerprint_fade_out); + if(centerprint_msgID[j] == CPID_TIMEIN) + a = 1; + // while counting down show it anyway in order to hold the current message position if (a <= 0.5/255.0 && centerprint_countdown_num[j] == 0) // Guaranteed invisible - don't show. continue; diff --git a/qcsrc/common/notifications/all.inc b/qcsrc/common/notifications/all.inc index e6be6b100..8b585d7e8 100644 --- a/qcsrc/common/notifications/all.inc +++ b/qcsrc/common/notifications/all.inc @@ -742,7 +742,7 @@ MSG_CENTER_NOTIF(TEAMCHANGE_SUICIDE, 1, 0, 1, "", CPID_TEAMCHANGE, "1 f1", _("^K1Suicide in ^COUNT"), "") MSG_CENTER_NOTIF(TIMEOUT_BEGINNING, 1, 0, 1, "", CPID_TIMEOUT, "1 f1", _("^F4Timeout begins in ^COUNT"), "") - MSG_CENTER_NOTIF(TIMEOUT_ENDING, 1, 0, 1, "", CPID_TIMEOUT, "1 f1", _("^F4Timeout ends in ^COUNT"), "") + MSG_CENTER_NOTIF(TIMEOUT_ENDING, 1, 0, 1, "", CPID_TIMEIN, "1 f1", _("^F4Timeout ends in ^COUNT"), "") MSG_CENTER_NOTIF(JOIN_PREVENT_MINIGAME, 1, 0, 0, "", CPID_Null, "0 0", _("^K1Cannot join given minigame session!"), "" ) diff --git a/qcsrc/common/notifications/all.qh b/qcsrc/common/notifications/all.qh index e7a02dd65..d2682a148 100644 --- a/qcsrc/common/notifications/all.qh +++ b/qcsrc/common/notifications/all.qh @@ -65,6 +65,7 @@ ENUMCLASS(CPID) CASE(CPID, RACE_FINISHLAP) CASE(CPID, TEAMCHANGE) CASE(CPID, TIMEOUT) + CASE(CPID, TIMEIN) CASE(CPID, VEHICLES) CASE(CPID, VEHICLES_OTHER) /** always last */ diff --git a/qcsrc/server/command/common.qc b/qcsrc/server/command/common.qc index 35418a02f..ec1f9c89f 100644 --- a/qcsrc/server/command/common.qc +++ b/qcsrc/server/command/common.qc @@ -210,6 +210,7 @@ void timeout_handler_think(entity this) } else // time to end the timeout { + Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_TIMEIN); timeout_status = TIMEOUT_INACTIVE; // reset the slowmo value back to normal -- 2.39.2