From bb5c439ed24192cd45da5db7ea88d5a3f1888caf Mon Sep 17 00:00:00 2001 From: z411 Date: Wed, 14 Jul 2021 04:02:04 -0400 Subject: [PATCH] Makes medal display disableable --- qcsrc/client/hud/panel/centerprint.qc | 6 ++++-- qcsrc/client/hud/panel/centerprint.qh | 3 +++ qcsrc/common/notifications/all.inc | 1 - 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/qcsrc/client/hud/panel/centerprint.qc b/qcsrc/client/hud/panel/centerprint.qc index 5dd7cd828..2a6cf238c 100644 --- a/qcsrc/client/hud/panel/centerprint.qc +++ b/qcsrc/client/hud/panel/centerprint.qc @@ -67,6 +67,8 @@ void centerprint_SetTitle(string title) void centerprint_Medal(string icon, float times) { + if(!autocvar_hud_panel_centerprint_medals) return; + //LOG_INFOF("centerprint_Medal: icon: %s times: %d", icon, times); //centerprint_medal_expire_time = time + autocvar_hud_panel_centerprint_time; centerprint_medal_expire_time = time + MSG_MEDAL_TIME; @@ -275,7 +277,7 @@ void HUD_CenterPrint() pos.y -= height; // z411 draw medals first - if (time < centerprint_medal_expire_time) { + if (autocvar_hud_panel_centerprint_medals && time < centerprint_medal_expire_time) { if(time < centerprint_medal_expire_time - MSG_MEDAL_FADE_TIME) a = 1; else @@ -289,7 +291,7 @@ void HUD_CenterPrint() tmp_in.x += (panel_size.x - newsize.x) / 2; // center medal icon - if(centerprint_medal_times < MSG_MEDAL_SCREEN) { + if(centerprint_medal_times < autocvar_hud_panel_centerprint_medals_max) { tmp_in.x -= ((newsize.x * 1.1) * (centerprint_medal_times - 1) / 2); for(int t = 0; t < centerprint_medal_times; t++) { drawpic(tmp_in, centerprint_medal_icon, newsize, '1 1 1', a, DRAWFLAG_NORMAL); diff --git a/qcsrc/client/hud/panel/centerprint.qh b/qcsrc/client/hud/panel/centerprint.qh index 0d8bc95f4..903ba9619 100644 --- a/qcsrc/client/hud/panel/centerprint.qh +++ b/qcsrc/client/hud/panel/centerprint.qh @@ -18,6 +18,9 @@ float autocvar_hud_panel_centerprint_fontscale_bold = 1.4; bool autocvar_hud_panel_centerprint_dynamichud = true; float autocvar_hud_panel_centerprint_time; +bool autocvar_hud_panel_centerprint_medals = true; +int autocvar_hud_panel_centerprint_medals_max = 5; + void centerprint_ClearTitle(); void centerprint_SetTitle(string title); void centerprint_Medal(string icon, int times); diff --git a/qcsrc/common/notifications/all.inc b/qcsrc/common/notifications/all.inc index d688ddc42..0c04e84e0 100644 --- a/qcsrc/common/notifications/all.inc +++ b/qcsrc/common/notifications/all.inc @@ -254,7 +254,6 @@ #define MSG_MEDAL_TIME 2 #define MSG_MEDAL_FADE_TIME 0.5 -#define MSG_MEDAL_SCREEN 10 MSG_MEDAL_NOTIF(AIRSHOT, N__ALWAYS, "airshot", ANNCE_ACHIEVEMENT_AIRSHOT) MSG_MEDAL_NOTIF(ASSIST, N__ALWAYS, "assist", ANNCE_ACHIEVEMENT_ASSIST) -- 2.39.2