A simplified alternative to Godot's OptionButton.
Copy the addons/buttons_select folder into your project.
You should now be able to see ButtonsSelect as one of the Button control variations when adding nodes in the editor.
See provided samples and their README.md files for more usage examples.
While OptionButton is perfectly usable and handles a lot more use cases compared to this control, it has some issues.
Disregarding the 64 open issues that mention OptionButton in the Godot Engine Github at the time of writing this,
the ones I personally encountered and which ButtonsSelect aims to alleviate are:
- Limited access to the
PopupMenunode that contains selectable items, making it less convenient to customize. - Item IDs being
int, making the selection values less readable and less convenient when you want to useStringkey values. PopupMenubeing hard-set to layer1024.- e.g. if you want to have a customizable cursor, you'd need to put it on layer 1025+ to visualize above the
PopupMenu.
- e.g. if you want to have a customizable cursor, you'd need to put it on layer 1025+ to visualize above the
- Inability to add child nodes to each individual item in the
PopupMenu.- e.g. in case you want to customize each individual item with a custom child component.
- Add more samples to cover more use cases
- Add more tests
- Check what reasonable functionality is missing in
ButtonsSelectcompared toOptionButtonand consider implementing it.
- Godot Engine: https://godotengine.org/license/
- Godot Engine 3rd Party Licenses: GODOT_COPYRIGHT.txt
- gdUnit4: https://github.com/godot-gdunit-labs/gdUnit4/blob/master/LICENSE
- Public Pixel Font: https://ggbot.itch.io/public-pixel-font