[0.16.3] radiobutton can not be toggled off

Bugs that are actually features.
User avatar
Cooldude2606
Fast Inserter
Fast Inserter
Posts: 112
Joined: Sat Sep 16, 2017 9:04 pm
Contact:

[0.16.3] radiobutton can not be toggled off

Post by Cooldude2606 »

Simple enough when i create a radiobutton you can toggle it to the true state (this raises the on_gui_checked_state_changed) but once the state is true i can not toggle it to false again (there is no on_gui_checked_state_changed or on_gui_click event). This is the code i used to make the button:
/c game.player.gui.top.add{type='frame',name='test'}.add{type='radiobutton',name='test',state=false}
* note checkboxs work fine only radiobuttons are effected
--- Developer for Explosive Gaming and Clusterio. Please contact me via our Discord. ---
Rseding91
Factorio Staff
Factorio Staff
Posts: 16102
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.16.3] radiobutton can not be toggled off

Post by Rseding91 »

Thanks for the report. That's how radio buttons work. It's up to you in the mod code to toggle other radio buttons off when the player toggles other ones on.
If you want to get ahold of me I'm almost always on Discord.
arbarbonif
Fast Inserter
Fast Inserter
Posts: 110
Joined: Fri Jul 01, 2016 2:46 am
Contact:

Re: [0.16.3] radiobutton can not be toggled off

Post by arbarbonif »

The lua documentation should probably be changed then. As is it says "Identical to checkbox except circular", but checkboxes can be unchecked...
Post Reply

Return to “Not a bug”