Skip to content

[TF2] Fix further conflicts between game_menu and voice menu#470

Merged
Blixibon merged 1 commit into
mapbase-source:mapbase-mp-2025from
Blixibon:mapbase/mp-2025/voice-game-menu-fixes
Sep 5, 2025
Merged

[TF2] Fix further conflicts between game_menu and voice menu#470
Blixibon merged 1 commit into
mapbase-source:mapbase-mp-2025from
Blixibon:mapbase/mp-2025/voice-game-menu-fixes

Conversation

@Blixibon
Copy link
Copy Markdown
Member

@Blixibon Blixibon commented Sep 5, 2025

This PR fixes the voice menu overriding game_menu's options when the UI shows the opposite, and also fixes the voice menu using the wrong appearance.

The former is caused by g_ActiveVoiceMenu not being cleared when a game_menu is activated, causing the voice menu to swallow the menu input. Since g_ActiveVoiceMenu is static to voice_menu.cpp, I added a new function that's externally linked from there and activated when a game_menu is shown. I've gated it behind TF_CLIENT_DLL for now since no other project implements voice_menu.cpp by default, although a better implementation should be considered in the future so that non-TF2 mods which implement the voice menu don't miss this fix.

The latter is a conditional reversion of a bug fix: The menu technically has two different font definitions and colors between the title of the menu and its items. However, the voice menu's items were not recognized as actual items by the HUD, so it only showed them with properties intended for the menu's title. The changes made for game_menu coincidentally fixed this. In order to retain the original appearance and behavior of the voice menu, the menu will now revert this fix when it is opened via ShowMenu_KeyValueItems (which, by default, is only used with the voice menu). New cvars called hud_menu_voice_use_item_color, hud_menu_voice_use_item_font, and hud_menu_voice_use_item_anim have been added to selectively enable certain fixed behavior.


PR Checklist

  • My PR follows all guidelines in the CONTRIBUTING.md file
  • My PR targets a develop branch OR targets another branch with a specific goal in mind

@Blixibon Blixibon merged commit bab4b6f into mapbase-source:mapbase-mp-2025 Sep 5, 2025
4 checks passed
@Blixibon Blixibon deleted the mapbase/mp-2025/voice-game-menu-fixes branch September 5, 2025 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants