]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud/panel/infomessages.qc
Merge branch 'Mario/cs_clientcvars' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud / panel / infomessages.qc
index c47a3d74e6444665bdb4a9181306132febfc26cd..1e5a0c9f2f293403c18408e3ff0cdae1fc72d649 100644 (file)
@@ -1,10 +1,14 @@
 #include "infomessages.qh"
 
+#include <client/autocvars.qh>
+#include <client/miscfunctions.qh>
+
 #include <common/ent_cs.qh>
 #include <common/mapinfo.qh>
 
-// Info messages panel (#14)
+// Info messages (#14)
 
+float autocvar_hud_panel_infomessages_group0 = 1;
 float autocvar_hud_panel_infomessages_group_fadetime = 0.4;
 float autocvar_hud_panel_infomessages_group_time = 6;
 const int IMG_COUNT = 1; // number of InfoMessage Groups
@@ -59,7 +63,7 @@ void HUD_InfoMessages()
                if(!autocvar_hud_panel_infomessages) return;
        }
 
-       HUD_Panel_UpdateCvars();
+       HUD_Panel_LoadCvars();
        vector pos, mySize;
        pos = panel_pos;
        mySize = panel_size;
@@ -68,7 +72,7 @@ void HUD_InfoMessages()
                HUD_Scale_Enable();
        else
                HUD_Scale_Disable();
-       HUD_Panel_DrawBg(1);
+       HUD_Panel_DrawBg();
        if(panel_bg_padding)
        {
                pos += '1 1 0' * panel_bg_padding;
@@ -88,29 +92,34 @@ void HUD_InfoMessages()
                                s = sprintf(_("^1Spectating: ^7%s"), entcs_GetName(current_player));
                        InfoMessage(s);
 
-                       img_curr_group = 0;
-                       switch(img_select(img_curr_group) % 3)
+                       if(autocvar_hud_panel_infomessages_group0)
                        {
-                               default:
-                               case 0:
-                                       if(spectatee_status == -1)
-                                               s = sprintf(_("^1Press ^3%s^1 to spectate"), getcommandkey(_("primary fire"), "+fire"));
-                                       else
-                                               s = sprintf(_("^1Press ^3%s^1 or ^3%s^1 for next or previous player"), getcommandkey(_("next weapon"), "weapnext"), getcommandkey(_("previous weapon"), "weapprev"));
-                                       break;
-                               case 1:
-                                       if(spectatee_status == -1)
-                                               s = sprintf(_("^1Use ^3%s^1 or ^3%s^1 to change the speed"), getcommandkey(_("next weapon"), "weapnext"), getcommandkey(_("previous weapon"), "weapprev"));
-                                       else
-                                               s = sprintf(_("^1Press ^3%s^1 to observe, ^3%s^1 to change camera mode"), getcommandkey(_("secondary fire"), "+fire2"), getcommandkey(_("drop weapon"), "dropweapon"));
-                                       break;
-                               case 2:
-                                       s = sprintf(_("^1Press ^3%s^1 for gamemode info"), getcommandkey(_("server info"), "+show_info"));
-                                       break;
+                               img_curr_group = 0;
+                               switch(img_select(img_curr_group) % 3)
+                               {
+                                       default:
+                                       case 0:
+                                               if(spectatee_status == -1)
+                                                       s = sprintf(_("^1Press ^3%s^1 to spectate"), getcommandkey(_("primary fire"), "+fire"));
+                                               else
+                                                       s = sprintf(_("^1Press ^3%s^1 or ^3%s^1 for next or previous player"), getcommandkey(_("next weapon"), "weapnext"), getcommandkey(_("previous weapon"), "weapprev"));
+                                               break;
+                                       case 1:
+                                               if(spectatee_status == -1)
+                                                       s = sprintf(_("^1Use ^3%s^1 or ^3%s^1 to change the speed"), getcommandkey(_("next weapon"), "weapnext"), getcommandkey(_("previous weapon"), "weapprev"));
+                                               else
+                                                       s = sprintf(_("^1Press ^3%s^1 to observe, ^3%s^1 to change camera mode"), getcommandkey(_("secondary fire"), "+fire2"), getcommandkey(_("drop weapon"), "dropweapon"));
+                                               break;
+                                       case 2:
+                                               s = sprintf(_("^1Press ^3%s^1 for gamemode info"), getcommandkey(_("server info"), "+show_info"));
+                                               break;
+                               }
+                               InfoMessage(s);
                        }
-                       InfoMessage(s);
 
-                       if(gametype == MAPINFO_TYPE_LMS)
+                       MUTATOR_CALLHOOK(DrawInfoMessages, pos, mySize);
+
+                       if(!warmup_stage && gametype == MAPINFO_TYPE_LMS)
                        {
                                entity sk;
                                sk = playerslots[player_localnum];
@@ -170,7 +179,7 @@ void HUD_InfoMessages()
                        InfoMessage(s);
                }
 
-               if(teamplay && !spectatee_status && gametype != MAPINFO_TYPE_CA && teamnagger)
+               if(teamplay && !spectatee_status && teamnagger)
                {
                        float ts_min = 0, ts_max = 0;
                        entity tm = teams.sort_next;