Make LuaGuiElement::name writable
Posted: Thu Oct 01, 2020 5:48 am
Currently, you can only read a LuaGuiElement's name. I would love to be able to modify the name as well.
The reason is that while I don't use names to match against to fire specific GUI handlers, I do use them to encode information about which button was clicked for generic handlers. For example, I could have nine similar buttons that are all displaying different LTN depots, and I want to know which one was clicked.
Storing that information in the name is a lot easier than making a thing to store it in `global` and managing it myself. But, unless I destroy and re-create the element, there's no way for me to update which depot the button is referencing, leaving storing it in global as the only option.
Thanks!
The reason is that while I don't use names to match against to fire specific GUI handlers, I do use them to encode information about which button was clicked for generic handlers. For example, I could have nine similar buttons that are all displaying different LTN depots, and I want to know which one was clicked.
Storing that information in the name is a lot easier than making a thing to store it in `global` and managing it myself. But, unless I destroy and re-create the element, there's no way for me to update which depot the button is referencing, leaving storing it in global as the only option.
Thanks!