]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud/hud_config.qc
Merge branch 'master' into terencehill/hud_updates
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud / hud_config.qc
index e28ff04b71f227df7d4a7f9cbc6bed225d95108d..4f116d724fb35a8203132f7ff43cec23504ab142 100644 (file)
@@ -237,9 +237,9 @@ void HUD_Panel_ExportCfg(string cfgname)
 
 void HUD_Configure_Exit_Force()
 {
-       if (menu_enabled)
+       if (hud_configure_menu_open)
        {
-               menu_enabled = 0;
+               hud_configure_menu_open = 0;
                localcmd("togglemenu\n");
        }
        cvar_set("_hud_configure", "0");
@@ -743,14 +743,14 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
        {
                if (bInputType == 1)
                        return true;
-               menu_enabled = 1;
+               hud_configure_menu_open = 1;
                localcmd("menu_showhudexit\n");
        }
        else if(nPrimary == K_BACKSPACE && hudShiftState & S_CTRL)
        {
                if (bInputType == 1)
                        return true;
-               if (!menu_enabled)
+               if (!hud_configure_menu_open)
                        cvar_set("_hud_configure", "0");
        }
        else if(nPrimary == K_TAB && hudShiftState & S_CTRL) // switch panel
@@ -848,7 +848,10 @@ LABEL(find_tab_panel)
                        return true;
 
                if (highlightedPanel)
-                       cvar_set(strcat("hud_panel_", highlightedPanel.panel_name), ftos(!cvar(strcat("hud_panel_", highlightedPanel.panel_name))));
+               {
+                       if(panel.panel_configflags & PANEL_CONFIG_CANBEOFF)
+                               cvar_set(strcat("hud_panel_", highlightedPanel.panel_name), ftos(!cvar(strcat("hud_panel_", highlightedPanel.panel_name))));
+               }
                else
                        cvar_set(strcat("hud_dock"), (autocvar_hud_dock == "") ? "dock" : "");
        }
@@ -1098,7 +1101,7 @@ void HUD_Panel_Highlight(float allow_move)
 
 void HUD_Panel_EnableMenu()
 {
-       menu_enabled = 2;
+       hud_configure_menu_open = 2;
        localcmd("menu_showhudoptions ", highlightedPanel.panel_name, "\n");
 }
 float mouse_over_panel;
@@ -1197,7 +1200,7 @@ void HUD_Panel_Mouse()
        {
                if(prevMouseClicked)
                        highlightedAction = 0;
-               if(menu_enabled == 2)
+               if(hud_configure_menu_open == 2)
                        mouse_over_panel = 0;
                else
                        mouse_over_panel = HUD_Panel_Check_Mouse_Pos(true);
@@ -1264,7 +1267,7 @@ void HUD_Configure_Frame()
                if(autocvar__menu_alpha != _menu_alpha_prev)
                {
                        if(autocvar__menu_alpha == 0)
-                               menu_enabled = 0;
+                               hud_configure_menu_open = 0;
                        _menu_alpha_prev = autocvar__menu_alpha;
                }
 
@@ -1272,8 +1275,8 @@ void HUD_Configure_Frame()
        }
        else if(hud_configure_prev)
        {
-               if(menu_enabled)
-                       menu_enabled = 0;
+               if(hud_configure_menu_open)
+                       hud_configure_menu_open = 0;
                if(autocvar_hud_cursormode)
                        setcursormode(0);
                hud_dynamic_shake_factor = -1;