Skip to content

Fix COMMS_MENU_SELECT control usage with 'Hide Rearm/Repair items' and cleanup selection visibility - #7688

Merged
Goober5000 merged 3 commits into
scp-fs2open:masterfrom
wookieejedi:fix-skip-hidden-menu-items
Aug 16, 2026
Merged

Fix COMMS_MENU_SELECT control usage with 'Hide Rearm/Repair items' and cleanup selection visibility#7688
Goober5000 merged 3 commits into
scp-fs2open:masterfrom
wookieejedi:fix-skip-hidden-menu-items

Conversation

@wookieejedi

Copy link
Copy Markdown
Member

The game settings flag '$Hide main Rearm/Repair items in Comms Gauge:' hides the 'Rearm and Repair' lines in the HUD Comms menu from appearing, which is useful for mods that do not have repair ships and thus those lines confuse players. Unfortunately, the newer COMMS_MENU_SELECT control bindings do not properly account for hidden menu items, so using those controls on a comms menu with 'Rearm and Repair' hidden means the selection index gets off and also confuses the player.

This PR fixes that by allowing hud_squadmsg_selection_move_down() and hud_squadmsg_selection_move_up() to skip hidden menu items. Tested and works as expected.

For folks using the COMMS_MENU_SELECT controls, there is also a current UI confusion when the comms menu is first brought up because the first item is selected, but the Display_selector does not show. Thus, players are unsure what item is actively selected even though one is actively selected. In the original comms menu select PR this was set to on by default, but then switched to off by default by a different developer a bit later. This choice is especially useful for mods that have many players with gamepads such as Event Horizon. Alternatively, mods that already have many number keys utilized for other gameplay aspects seem to prefer to keep the comms menu visuals as is and only show the selection if the player uses those keys.

Given there is clearly arguments for both reasons, ideally modders should be able to choose how it displays for their own mods (always or off for the first pop-up of the Comms menu). Thus, this PR adds that as a cleanup game option, too. This also was tested and works as expected.

The game settings flag '$Hide main Rearm/Repair items in Comms Gauge:' hides the 'Rearm and Repair' lines in the HUD Comms menu from appearing, which is useful for mods that do not have repair ships and thus those lines confuse players. Unfortunately, the newer `COMMS_MENU_SELECT` control bindings do not properly account for hidden menu items, so using those controls on a comms menu with 'Rearm and Repair' hidden means the selection index gets off and also confuses the player.

This PR fixes that by allowing `hud_squadmsg_selection_move_down()` and `hud_squadmsg_selection_move_up()` to skip hidden menu items. Tested and works as expected.

For folks using the COMMS_MENU_SELECT controls, there is also a current UI confusion when the comms menu is first brought up because the first item is selected, but the `Display_selector` does not show. Thus, players are unsure what item is actively selected even though one is actively selected. In the original comms menu select PR this was set to on by default, but then switched to off by default by a different developer a bit later. This choice is especially useful for mods that have many players with gamepads such as Event Horizon. Alternatively, mods that already have many number keys utilized for other gameplay aspects seem to prefer to keep the comms menu visuals as is and only show the selection if the player uses those keys. Given there is clearly arguments for both reasons, ideally modders should be able to choose how it displays for their own mods (always or off for the first pop-up of the Comms menu).  Thus, this PR adds that as a cleanup game option, too. This also was tested and works as expected.
@wookieejedi wookieejedi added this to the Release 26.0.1 milestone Aug 6, 2026
@wookieejedi wookieejedi added cleanup A modification or rewrite of code to make it more understandable or easier to maintain. fix A fix for bugs, not-a-bugs, and/or regressions. HUD A feature or issue related to the HUD labels Aug 6, 2026
@wookieejedi wookieejedi mentioned this pull request Aug 7, 2026

@Goober5000 Goober5000 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple minor things

Comment thread code/hud/hudsquadmsg.cpp Outdated
Comment thread code/mod_table/mod_table.cpp
@wookieejedi

Copy link
Copy Markdown
Member Author

okay rebased and ready for re-review, thanks!

@Goober5000 Goober5000 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@Goober5000
Goober5000 merged commit 3f6a9f1 into scp-fs2open:master Aug 16, 2026
18 checks passed
Goober5000 added a commit that referenced this pull request Aug 16, 2026
Reset the selected item when we open a new menu.  This keeps the display state and internal state in sync if the player mixes arrow presses and number presses.  Follow-up to #7688.
@wookieejedi wookieejedi added Point Release Candidate An already merged bugfix that may be merged into a previous stable version added to point release and removed Point Release Candidate An already merged bugfix that may be merged into a previous stable version labels Aug 16, 2026
wookieejedi pushed a commit that referenced this pull request Aug 16, 2026
Fix COMMS_MENU_SELECT control usage with 'Hide  Rearm/Repair items' and cleanup selection visibility
wookieejedi pushed a commit that referenced this pull request Aug 16, 2026
Reset the selected item when we open a new menu.  This keeps the display state and internal state in sync if the player mixes arrow presses and number presses.  Follow-up to #7688.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

added to point release cleanup A modification or rewrite of code to make it more understandable or easier to maintain. fix A fix for bugs, not-a-bugs, and/or regressions. HUD A feature or issue related to the HUD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants