Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show selected unit in legacy build menu pre-game #3963

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rhys-vdw
Copy link
Contributor

@rhys-vdw rhys-vdw commented Nov 23, 2024

Work done

This fixes a bug where the currently selected build option is not highighted in the build menu when placing buildings pre-game.

I found this while investigating use of empty units.unitName table (#3957 (comment)).

This table has been empty since e0f02ae, but there is a local table for the same purpose in gui_buildmenu.lua that is used instead.

  • Use correct lookup table: units.unitName is always empty, but there is a table local to this file that can be used.
  • Do not invert the def ID, the names are keyed by positive ID.
  • Remove table unitName from unit_buildmenu_config.lua which is now definitely not referenced anywhere.

Test steps

  • Play the game with legacy build menu.
  • Observe highlight selection pre-game

Screenshots

BEFORE:

image
Mex is not highlighed

AFTER:

image
Mex is highlighed

Rhys van der Waerden and others added 2 commits November 23, 2024 20:34
- Use correct lookup table: `units.unitName` is always empty, but there is a table local to this file that can be used.
- Do not invert the build command ID, the names are keyed by positive ID.
Table was not initialized nor referenced
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.

1 participant