Add pressed attribute to GuiElement
Posted: Thu Jun 06, 2019 1:42 pm
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.
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.