LuaGuiElement::enabled read/write

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1197
Joined: Wed May 18, 2016 4:55 pm
Contact:

LuaGuiElement::enabled read/write

Post by Mooncat »

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.
disabled_menu.png
disabled_menu.png (40.84 KiB) Viewed 1236 times
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.
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. :lol:
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: LuaGuiElement::enabled read/write

Post by aubergine18 »

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.
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: LuaGuiElement::enabled read/write

Post by bobingabout »

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.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
Post Reply

Return to “Implemented mod requests”