From 4132bf6798324a1ac6f04e08e1fec82a885cc29f Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 5 Jan 2014 14:54:08 +1100 Subject: [PATCH] Disable quickmenu during mapvote screen and disable scoreboard while quickmenu is open --- qcsrc/client/hud.qc | 10 +++++++--- qcsrc/client/hud.qh | 2 ++ qcsrc/client/mapvoting.qc | 1 - qcsrc/client/scoreboard.qc | 2 ++ 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index e890ad120..6b943b67c 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -4491,6 +4491,7 @@ void HUD_QuickMenu_Close() HUD_QuickMenu_Buffer_Close(); if(autocvar_hud_cursormode) + if(!mv_active) setcursormode(0); } @@ -4648,7 +4649,7 @@ float HUD_QuickMenu_InputEvent(float bInputType, float nPrimary, float nSecondar if(bInputType == 2) return false; - if(!HUD_QuickMenu_IsOpened() || autocvar__hud_configure) + if(!HUD_QuickMenu_IsOpened() || autocvar__hud_configure || mv_active) return false; if(bInputType == 3) @@ -4715,6 +4716,8 @@ float HUD_QuickMenu_InputEvent(float bInputType, float nPrimary, float nSecondar } void HUD_QuickMenu_Mouse() { + if(mv_active) return; + if(!mouseClicked) if(prevMouseClicked & S_MOUSE2) { @@ -4722,7 +4725,7 @@ void HUD_QuickMenu_Mouse() return; } - if not(autocvar_hud_cursormode) + if(!autocvar_hud_cursormode) { mousepos = mousepos + getmousepos() * autocvar_menu_mouse_speed; @@ -4760,7 +4763,7 @@ void HUD_QuickMenu_Mouse() color = '1 1 1'; drawfill(panel_pos, eX * panel_size_x + eY * fontsize_y, color, .2, DRAWFLAG_NORMAL); - if(!mouseClicked && prevMouseClicked & S_MOUSE1) + if(!mouseClicked && (prevMouseClicked & S_MOUSE1)) { float f; if (entry_num < QUICKMENU_MAXLINES - 1) @@ -4799,6 +4802,7 @@ void HUD_QuickMenu(void) HUD_QuickMenu_Close(); if(!hud_draw_maximized) return; + if(mv_active) return; //if(!autocvar_hud_panel_quickmenu) return; // autocvar exists only for conformity with other panels if(!hud_panel_quickmenu) return; } diff --git a/qcsrc/client/hud.qh b/qcsrc/client/hud.qh index faae2326d..711929066 100644 --- a/qcsrc/client/hud.qh +++ b/qcsrc/client/hud.qh @@ -99,6 +99,8 @@ var string panel_bg_padding_str; float current_player; +float mv_active; + #define HUD_PANELS \ HUD_PANEL(WEAPONS , HUD_Weapons , weapons) \ diff --git a/qcsrc/client/mapvoting.qc b/qcsrc/client/mapvoting.qc index 8caeb01d5..75a280fe6 100644 --- a/qcsrc/client/mapvoting.qc +++ b/qcsrc/client/mapvoting.qc @@ -1,6 +1,5 @@ float mv_num_maps; -float mv_active; string mv_maps[MAPVOTE_COUNT]; string mv_pics[MAPVOTE_COUNT]; string mv_pk3[MAPVOTE_COUNT]; diff --git a/qcsrc/client/scoreboard.qc b/qcsrc/client/scoreboard.qc index b037d03d2..055e3b5cc 100644 --- a/qcsrc/client/scoreboard.qc +++ b/qcsrc/client/scoreboard.qc @@ -952,6 +952,8 @@ vector HUD_Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_siz float HUD_WouldDrawScoreboard() { if (autocvar__hud_configure) return 0; + else if (HUD_QuickMenu_IsOpened()) + return 0; else if (scoreboard_showscores) return 1; else if (intermission == 1) -- 2.39.2