[17.69] on_gui_switch_state_changed

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
LuziferSenpai
Filter Inserter
Filter Inserter
Posts: 333
Joined: Tue Jul 08, 2014 10:06 am
Contact:

[17.69] on_gui_switch_state_changed

Post by LuziferSenpai »

Hey,

even when "none" is disabled, the state gets triggert, which results in false output, when not testing for the current State.

Greetz,

Luzifer
Coding is awesome!
Animes are love!
Factorio is life!

My MODs:
Click

Greetz,

Senpai

Rseding91
Factorio Staff
Factorio Staff
Posts: 13201
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [17.69] on_gui_switch_state_changed

Post by Rseding91 »

Thanks for the report however I have no idea what you mean.
If you want to get ahold of me I'm almost always on Discord.

User avatar
LuziferSenpai
Filter Inserter
Filter Inserter
Posts: 333
Joined: Tue Jul 08, 2014 10:06 am
Contact:

Re: [17.69] on_gui_switch_state_changed

Post by LuziferSenpai »

What I mean is:

You have the GuiElement Switch and its not a 3times Switch, its only a 2 times switch, so from left to right, not left to middle to right.

And then you have the Event and print something or log it and it shows that it gets 2times triggers when you go from left to right or viceversa.
Coding is awesome!
Animes are love!
Factorio is life!

My MODs:
Click

Greetz,

Senpai

User avatar
LuziferSenpai
Filter Inserter
Filter Inserter
Posts: 333
Joined: Tue Jul 08, 2014 10:06 am
Contact:

Re: [17.69] on_gui_switch_state_changed

Post by LuziferSenpai »

Here is the Modification which has this Problem:
Electronic_Locomotives_0.3.0.zip
(14.32 MiB) Downloaded 143 times
Coding is awesome!
Animes are love!
Factorio is life!

My MODs:
Click

Greetz,

Senpai

User avatar
Therenas
Factorio Staff
Factorio Staff
Posts: 232
Joined: Tue Dec 11, 2018 2:10 pm
Contact:

Re: [17.69] on_gui_switch_state_changed

Post by Therenas »

I can confirm this, for switches with allow_none_state=false, it will fire the on_gui_switch_state_changed event twice when the switch is clicked once, which is probably not intended that way.

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5150
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [17.69] on_gui_switch_state_changed

Post by Klonan »

Can you provide a code snippet/console command that will demonstrate the issue

Rseding91
Factorio Staff
Factorio Staff
Posts: 13201
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [17.69] on_gui_switch_state_changed

Post by Rseding91 »

Thanks for the report. It's now fixed for the next version of 0.17.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Resolved Problems and Bugs”