Skip to content

Refactor button widgets; add widgets.RadioButton#5781

Draft
Bumber64 wants to merge 7 commits into
DFHack:developfrom
Bumber64:button-widgets
Draft

Refactor button widgets; add widgets.RadioButton#5781
Bumber64 wants to merge 7 commits into
DFHack:developfrom
Bumber64:button-widgets

Conversation

@Bumber64

@Bumber64 Bumber64 commented Mar 31, 2026

Copy link
Copy Markdown
Member

Refactor widgets.ConfigureButton and make widgets.HelpButton a child of it. Add widgets.RadioButton, which looks and functions like the buttons in the gui/control-panel list.

I don't understand the ---@field stuff very well, so I based it on examples as best I could. Needs to be verified.

If there's a better way to do what ConfigureButton:refresh() does, I'd like to know. ConfigureButton:init() has already run by the time HelpButton:init() is called, so the changes need to be reapplied to the Label widget.

Needs changelog entries.

@Bumber64 Bumber64 marked this pull request as draft July 3, 2026 19:21
@Bumber64 Bumber64 changed the title Refactor button widgets; add widgets.ToggleButton Refactor button widgets; add widgets.RadioButton Jul 5, 2026
Bumber64 added 2 commits July 4, 2026 22:19
* Update widgets.lua - RadioButton
* Update and rename toggle_button.lua to radio_button.lua
* Update help_button.lua
* Update configure_button.lua - Replace GraphicButton
* Delete library/lua/gui/widgets/buttons/graphic_button.lua
* Update Lua API.rst - Add RadioButton; HelpButton now subclass
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