While I was messing with GUI style prototypes, I noticed that we actually have images for disabled elements. Also, when I was testing multiplayer for my mod, I saw that the menu was disabled when I quite the game.
By disabling a GUI element, 3 things will be done:
1) change its appearance if it is a button, checkbox, etc.
2) it becomes not interactive and cannot raise the on_gui events
3) all of its children are also disabled. (However, this is different from directly disabling the child elements. If we don't disable the children but only the parent, we can restore all of them by just enabling the parent.)
This will make our GUI system easier to use as we will have an additional, visually different option to "kill" GUI elements.
But it seems that we currently don't have any API for disabling/enabling a GUI element. I wish we can have a new read/write property for doing so.LuaGuiElement::enabled read/write
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: LuaGuiElement::enabled read/write
Yes, definitely want this!!
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: LuaGuiElement::enabled read/write
Yes, I agree. I could use this myself for my Inserters GUI, so instead of having to draw a blank, I can disable the button in that place instead.