]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Forbid enabling hud setup mode while playing back a demo
authorterencehill <piuntn@gmail.com>
Mon, 16 Jan 2012 21:12:47 +0000 (22:12 +0100)
committerterencehill <piuntn@gmail.com>
Mon, 16 Jan 2012 21:18:34 +0000 (22:18 +0100)
qcsrc/client/hud.qc
qcsrc/client/hud_config.qc

index 400af4e58d12b3d1896ba16920e41c60a2a1e847..efab2ec8a13bf9292ecd6ce96270f61993ab1c0a 100644 (file)
@@ -4914,11 +4914,11 @@ switch (id) {\
        case (HUD_PANEL_ENGINEINFO):\
                HUD_EngineInfo(); break;\
        case (HUD_PANEL_INFOMESSAGES):\
-                HUD_InfoMessages(); break;\
+               HUD_InfoMessages(); break;\
        case (HUD_PANEL_PHYSICS):\
-                HUD_Physics(); break;\
+               HUD_Physics(); break;\
        case (HUD_PANEL_CENTERPRINT):\
-                HUD_CenterPrint(); break;\
+               HUD_CenterPrint(); break;\
 } ENDS_WITH_CURLY_BRACE
 
 void HUD_Main (void)
@@ -4933,17 +4933,14 @@ void HUD_Main (void)
        if(scoreboard_fade_alpha)
                hud_fade_alpha = (1 - scoreboard_fade_alpha);
 
+       if(autocvar__hud_configure)
+               if(isdemo())
+                       HUD_Configure_Exit_Force();
+
        if(intermission == 2) // no hud during mapvote
        {
-               if (autocvar__hud_configure) //force exit from hud config
-               {
-                       if (menu_enabled)
-                       {
-                               menu_enabled = 0;
-                               localcmd("togglemenu\n");
-                       }
-                       cvar_set("_hud_configure", "0");
-               }
+               if (autocvar__hud_configure)
+                       HUD_Configure_Exit_Force();
                hud_fade_alpha = 0;
        }
        else if(autocvar__menu_alpha == 0 && scoreboard_fade_alpha == 0)
index 87914d566b59d1ffc752073eb3dd380d7ebdde99..15b924dd9cb9f6eae222bad1524642f001f52003 100644 (file)
@@ -64,7 +64,7 @@ void HUD_Panel_ExportCfg(string cfgname)
                        HUD_Write_PanelCvar_q("_bg_border");
                        HUD_Write_PanelCvar_q("_bg_padding");
                        switch(i) {
-                               case HUD_PANEL_WEAPONS: 
+                               case HUD_PANEL_WEAPONS:
                                        HUD_Write_PanelCvar_q("_accuracy");
                                        HUD_Write_PanelCvar_q("_label");
                                        HUD_Write_PanelCvar_q("_complainbubble");
@@ -189,6 +189,16 @@ void HUD_Panel_ExportCfg(string cfgname)
                print(sprintf(_("^1Couldn't write to %s\n"), filename));
 }
 
+void HUD_Configure_Exit_Force()
+{
+       if (menu_enabled)
+       {
+               menu_enabled = 0;
+               localcmd("togglemenu\n");
+       }
+       cvar_set("_hud_configure", "0");
+}
+
 // check if move will result in panel being moved into another panel. If so, return snapped vector, otherwise return the given vector
 vector HUD_Panel_CheckMove(vector myPos, vector mySize)
 {