From efc0dfc139b682cb2e6632105ac3feab0f1966e9 Mon Sep 17 00:00:00 2001 From: z411 Date: Sat, 12 Sep 2020 22:36:42 -0300 Subject: [PATCH] Bugfixes --- qcsrc/client/announcer.qc | 28 +++++++++++++++++++-------- qcsrc/client/hud/panel/centerprint.qc | 2 +- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/qcsrc/client/announcer.qc b/qcsrc/client/announcer.qc index 44237d9b3..01afb0902 100644 --- a/qcsrc/client/announcer.qc +++ b/qcsrc/client/announcer.qc @@ -7,6 +7,10 @@ #include #include "hud/panel/centerprint.qh" +#include +#include +#include "miscfunctions.qh" + bool announcer_1min; bool announcer_5min; string AnnouncerOption() @@ -64,7 +68,7 @@ void Announcer_Countdown(entity this) } else // countdown is still going { - // if concomitant countdown to round start overrides countdown to game start + // counting down to rounds if(rounds) { Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_ROUNDSTART, countdown_rounded); @@ -77,12 +81,10 @@ void Announcer_Countdown(entity this) { Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_GAMESTART, countdown_rounded); Notification annce_num = Announcer_PickNumber(CNT_GAMESTART, countdown_rounded); - if(annce_num != NULL) + if(!roundstarttime && annce_num != NULL) // count only if the gametype has no rounds Local_Notification(MSG_ANNCE, annce_num); this.nextthink = (starttime - (countdown - 1)); } - - } } @@ -125,12 +127,22 @@ void Announcer_Gamestart() } // z411 set title - if(time < STAT(GAMESTARTTIME) && !warmup_stage) - centerprint_SetTitle(MapInfo_Type_ToText(gametype)); + if(time < STAT(GAMESTARTTIME) && !warmup_stage) { + //if(IS_GAMETYPE(DUEL)) { + //if(g_duel) { + if(gametype == MAPINFO_TYPE_DUEL) { + entity pl1 = players.sort_next; + entity pl2 = pl1.sort_next; + + centerprint_SetTitle(strcat(entcs_GetName(pl1.sv_entnum), " vs ", entcs_GetName(pl2.sv_entnum))); + } else { + centerprint_SetTitle(MapInfo_Type_ToText(gametype)); + } + } if(time + 5.0 < startTime) // if connecting to server while restart was active don't always play prepareforbattle - if(time > announcer_countdown.nextthink && !warmup_stage) { // don't play it again if countdown was already going - if(teamplay && time < startTime) + if(time > announcer_countdown.nextthink && !warmup_stage && time < STAT(GAMESTARTTIME)) { // don't play it again if countdown was already going + if(teamplay) Local_Notification(MSG_ANNCE, ANNCE_PREPARE_TEAM); else Local_Notification(MSG_ANNCE, ANNCE_PREPARE); diff --git a/qcsrc/client/hud/panel/centerprint.qc b/qcsrc/client/hud/panel/centerprint.qc index f40966e0b..88819c932 100644 --- a/qcsrc/client/hud/panel/centerprint.qc +++ b/qcsrc/client/hud/panel/centerprint.qc @@ -297,7 +297,7 @@ void HUD_CenterPrint() // z411 title if(centerprint_title_show) { fontsize = '1 1 0' * vid_conheight/50 * autocvar_hud_panel_centerprint_fontscale * 1.5; - drawstring(pos + '0.5 0 0' * (panel_size.x - stringwidth(centerprint_title, true, fontsize)), centerprint_title, fontsize, '1 1 1', 1, DRAWFLAG_NORMAL); + drawcolorcodedstring(pos + '0.5 0 0' * (panel_size.x - stringwidth(centerprint_title, true, fontsize)), centerprint_title, fontsize, 1, DRAWFLAG_NORMAL); pos.y += fontsize.y + (fontsize.y / 4); all_messages_expired = false; -- 2.39.2