From 95c13330ba5b91cd4aab618abcdbda2476df6bbf Mon Sep 17 00:00:00 2001 From: Blixibon Date: Wed, 30 Jul 2025 22:29:14 -0500 Subject: [PATCH] Fix game_menu conflicting with voice command menu --- src/game/client/menu.h | 4 ++++ src/game/client/voice_menu.cpp | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/src/game/client/menu.h b/src/game/client/menu.h index 80f14eae70a..fb813f1ac02 100644 --- a/src/game/client/menu.h +++ b/src/game/client/menu.h @@ -41,6 +41,10 @@ class CHudMenu : public CHudElement, public vgui::Panel bool IsMenuOpen( void ); void SelectMenuItem( int menu_item ); +#ifdef MAPBASE + bool IsMenuMapDefined() const { return m_bMapDefinedMenu; } +#endif + private: virtual void OnThink(); virtual void Paint(); diff --git a/src/game/client/voice_menu.cpp b/src/game/client/voice_menu.cpp index c583634961a..e9f4c544ec3 100644 --- a/src/game/client/voice_menu.cpp +++ b/src/game/client/voice_menu.cpp @@ -50,6 +50,12 @@ void OpenVoiceMenu( int index ) if ( !pMenu ) return; +#ifdef MAPBASE + // Don't override map-defined menus + if ( pMenu->IsMenuMapDefined() && pMenu->IsMenuOpen() ) + return; +#endif + // if they hit the key again, close the menu if ( g_ActiveVoiceMenu == index ) {