Buttons and checkboxes have disabled graphics in their styles.
How do you disable/enable them?
In http://lua-api.factorio.com/0.12.29/LuaGuiElement.html there doesn't seem to be an enable/disable state.
How do you disable buttons and checkboxes?
How do you disable buttons and checkboxes?
Took a break from 0.12.29 to 0.17.79, and then to ... oh god now it's 1.something. I never know what's happening.
Re: How do you disable buttons and checkboxes?
I was wondering the same thing, and was going to try creating a style that 'looks' disabled, then on_click check if that style is set and ignore the click. I haven't actually tried this yet, so if you do, post back and let me know if it worked
update: There is actually a style called "fake_disabled_button_style" already in the game. just set that, and in your gui click handler if event.element.style.name == 'fake_disabled_button_style' bail out early
update: There is actually a style called "fake_disabled_button_style" already in the game. just set that, and in your gui click handler if event.element.style.name == 'fake_disabled_button_style' bail out early
Re: How do you disable buttons and checkboxes?
Hey, that's a good idea.metalhedd wrote:I was wondering the same thing, and was going to try creating a style that 'looks' disabled, then on_click check if that style is set and ignore the click. ... update: There is actually a style called "fake_disabled_button_style" already in the game. just set that, and in your gui click handler if event.element.style.name == 'fake_disabled_button_style' bail out early
The bigger motivation behind my question is whether I should bother going through the effort of creating graphic sets for disabled_background (checkboxes) and disabled_graphical_set (buttons), or if those were just an API dead-end.
I probably should specify them in any case just as good form, though.
Took a break from 0.12.29 to 0.17.79, and then to ... oh god now it's 1.something. I never know what's happening.