I'd like it if GuiElements had a boolean attribute (maybe named element.pressed) that would set the style of the button to it's clicked_graphical_set while pressed = true. It would not react to clicks or hovers, but would still show a tooltip. We can currently do this by defining a new style for the pressed version of the button, but that is a bit tedious, especially as the necessary graphical set is already right there in the style prototype.
This could then be used to easily used to achieve this effect:
Possible conflicts could arise if both this new attribute and enabled = false is set. In that case, I would just ignore the pressed attribute and show the button as disabled.
Add pressed attribute to GuiElement
Re: Add pressed attribute to GuiElement
That's exactly how the base game does it: on selection change the style.
If you want to get ahold of me I'm almost always on Discord.
Re: Add pressed attribute to GuiElement
Wouldn't it be nicer to have an attribute that does this for you? It's not a major issue, it would just be nicer to use.
Re: Add pressed attribute to GuiElement
No, that just adds extra complexity to every single widget out there you want to do it with. Styles are already universal.
If you want to get ahold of me I'm almost always on Discord.
Re: Add pressed attribute to GuiElement
This has been implemented in 1.1.82.
Don't forget, you're here forever.