LuaGuiElement::enabled read/write
Posted: Tue Sep 06, 2016 4:18 pm
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.![Laughing :lol:](./images/smilies/icon_lol.gif)
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.
![Laughing :lol:](./images/smilies/icon_lol.gif)