]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Makes medal display disableable
authorz411 <z411@omaera.org>
Wed, 14 Jul 2021 08:02:04 +0000 (04:02 -0400)
committerz411 <z411@omaera.org>
Wed, 14 Jul 2021 08:04:47 +0000 (04:04 -0400)
qcsrc/client/hud/panel/centerprint.qc
qcsrc/client/hud/panel/centerprint.qh
qcsrc/common/notifications/all.inc

index 5dd7cd828fd78bb4f40b29b02f25d8a73e2b41c4..2a6cf238cd800b2b7c71de9929bfc9b6079a273d 100644 (file)
@@ -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);
index 0d8bc95f4a71fecd572c9385890f0e69b863035a..903ba96191ef8133ccfe56c88246fb7827adfefa 100644 (file)
@@ -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);
index d688ddc4218082c0ca6bb7c3b3a628eccac3269a..0c04e84e0386074a21017451b775b35f26d318e2 100644 (file)
 
 #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)