How to access toggled state for a button.

Place to get help with not working mods / modding interface.
Post Reply
User avatar
Cooldude2606
Long Handed Inserter
Long Handed Inserter
Posts: 86
Joined: Sat Sep 16, 2017 9:04 pm
Contact:

How to access toggled state for a button.

Post by Cooldude2606 »

In the recent version alot of gui styles were changed. One of those was the removealo of selected style. Does any one know how to access the toggled state for a button? I have looked at the api for LuaGuiElement and LuaStyle but havent been able to find how you change the toggled state for a button.
selected_logistic_slot_button was removed. Use slot_button. For selected version use it's toggled state.
--- Developer for Explosive Gaming factorio community. Find our code on GitHub. Please contact me via our Discord. ---

User avatar
moon69
Fast Inserter
Fast Inserter
Posts: 181
Joined: Sun Sep 18, 2016 6:53 pm
Contact:

Re: How to access toggled state for a button.

Post by moon69 »

Not sure from the API side, but I think the selected style stuff is here...
Types/StyleWithClickableGraphicalSetSpecification

User avatar
Cooldude2606
Long Handed Inserter
Long Handed Inserter
Posts: 86
Joined: Sat Sep 16, 2017 9:04 pm
Contact:

Re: How to access toggled state for a button.

Post by Cooldude2606 »

moon69 wrote:
Fri May 29, 2020 11:40 am
Not sure from the API side, but I think the selected style stuff is here...
Types/StyleWithClickableGraphicalSetSpecification
I was able to find this as well, but there is no mention of toggled state. I assume that it would be a property that would cause an element to show its selected style. Similar to LuaGuiElement.state but for buttons.
--- Developer for Explosive Gaming factorio community. Find our code on GitHub. Please contact me via our Discord. ---

User avatar
ZlovreD
Fast Inserter
Fast Inserter
Posts: 129
Joined: Thu Apr 06, 2017 1:07 pm
Contact:

Re: How to access toggled state for a button.

Post by ZlovreD »

Yeah, it's a bit pissing me off. I can create button/tab style with "selected" graphical set, but i can't use it. Tabs can be used only in tab-container. But i can't group my custom buttons/tabs to manage selected states or swith their state separately.
Dear devs, could you please add an additional field into LuaGUIElement for all "clickable" elements to manage their states?
Because for now i must to create different styles for all states and manualy change them, writing additional code.

Post Reply

Return to “Modding help”