X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=qcsrc%2Fclient%2Fhud%2Fhud_config.qc;h=4897ba55176d6e4e47fa8ec5b9e508467c0199d3;hb=63de1215428d078d5fb2021c49edf59a7900cef9;hp=e28ff04b71f227df7d4a7f9cbc6bed225d95108d;hpb=6585b5a8ef2ce4ee66826df826a6c759bd815cb8;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/hud/hud_config.qc b/qcsrc/client/hud/hud_config.qc index e28ff04b71..4897ba5517 100644 --- a/qcsrc/client/hud/hud_config.qc +++ b/qcsrc/client/hud/hud_config.qc @@ -226,6 +226,8 @@ void HUD_Panel_ExportCfg(string cfgname) } HUD_Write("\n"); } + MUTATOR_CALLHOOK(HUD_WriteCvars, fh); + HUD_Write("menu_sync\n"); // force the menu to reread the cvars, so that the dialogs are updated LOG_INFOF(_("^2Successfully exported to %s! (Note: It's saved in data/data/)\n"), filename); @@ -237,9 +239,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 +745,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 +850,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 +1103,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; @@ -1108,12 +1113,7 @@ void HUD_Panel_Mouse() return; if (!autocvar_hud_cursormode) - { - mousepos = mousepos + getmousepos() * autocvar_menu_mouse_speed; - - mousepos.x = bound(0, mousepos.x, vid_conwidth); - mousepos.y = bound(0, mousepos.y, vid_conheight); - } + update_mousepos(); if(mouseClicked) { @@ -1197,7 +1197,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 +1264,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 +1272,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;