add checks to reset buttons in construction menu on close #32319
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
About the PR
Fixed an issue where closing the construction menu while erase or build mode is active leaves those functions toggled and keeps certain top menu functions and interactions disabled.
Why / Balance
The issue is that with erase mode active in particular, there is no indication that erase mode is still active as the window is gone and the top menu button has toggled off. This leads to confusion as you are unable to perform certain interactions and shortcuts with no indication as to what is causing it.
Technical details
I wanted to get some feedback on this as the implementation may be poor or the issue may be intentional and just in need of some tweaking. I moved the code handling EraseButtonToggled to its own function similar to BuildButtonToggled and then added checks for both to reset them upon closing the window.
Media
2024-09-19.22-56-12.mp4
Requirements
Breaking changes
No breaking changes to note.
Changelog
🆑