You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the problem or limitation you are having in your project
I consistently find myself wanting to have a group of buttons where only one can be pressed at a time but you can also unpress all of them.
For instance, a map editor. When you press a button to select what object to place, you want the other buttons to unpress. Extremely easy with button groups. But what if you want to press that same button again to have no object selected? Currently this behavior is impossible without creating your own ButtonGroup-like system.
Example of map editor:
map_editor_example.mp4
You would hit the same road block developing a UI with categories and dropdowns like this:
category_example.mp4
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Solution 1: Add a toggle to ButtonGroup for whether or not all buttons can become unpressed
Solution 2: Create a child class of ButtonGroup that allows all buttons to become unpressed
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Current behavior:
normal_buttongroup.mp4
Proposed behavior:
unpressable_buttongroup.mp4
Possible feature UI (allow_unpress disabled by default to maintain compatibility):
If this enhancement will not be used often, can it be worked around with a few lines of script?
It can be worked around, but the workaround is creating an entire system yourself that copies the behavior of ButtonGroup with one minor tweak. While it's not that hard, it seems unnecessary given the engine already has a system that's 99% of the way there.
Is there a reason why this should be core and not an add-on in the asset library?
This seems like a useful enough feature to be part of the engine and it can be added without breaking compatibility. It would resolve a pain point that I'm sure many developers have run into and would make it even easier to create responsive UIs.
The text was updated successfully, but these errors were encountered:
Describe the project you are working on
User interface
Describe the problem or limitation you are having in your project
I consistently find myself wanting to have a group of buttons where only one can be pressed at a time but you can also unpress all of them.
For instance, a map editor. When you press a button to select what object to place, you want the other buttons to unpress. Extremely easy with button groups. But what if you want to press that same button again to have no object selected? Currently this behavior is impossible without creating your own ButtonGroup-like system.
Example of map editor:
map_editor_example.mp4
You would hit the same road block developing a UI with categories and dropdowns like this:
category_example.mp4
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Solution 1: Add a toggle to ButtonGroup for whether or not all buttons can become unpressed
Solution 2: Create a child class of ButtonGroup that allows all buttons to become unpressed
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Current behavior:
normal_buttongroup.mp4
Proposed behavior:
unpressable_buttongroup.mp4
Possible feature UI (
allow_unpress
disabled by default to maintain compatibility):PR with implementation:
godotengine/godot#76279
If this enhancement will not be used often, can it be worked around with a few lines of script?
It can be worked around, but the workaround is creating an entire system yourself that copies the behavior of ButtonGroup with one minor tweak. While it's not that hard, it seems unnecessary given the engine already has a system that's 99% of the way there.
Is there a reason why this should be core and not an add-on in the asset library?
This seems like a useful enough feature to be part of the engine and it can be added without breaking compatibility. It would resolve a pain point that I'm sure many developers have run into and would make it even easier to create responsive UIs.
The text was updated successfully, but these errors were encountered: