Page 1 of 1

[17.69] on_gui_switch_state_changed

Posted: Sun Sep 29, 2019 7:26 pm
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

Re: [17.69] on_gui_switch_state_changed

Posted: Sun Sep 29, 2019 11:50 pm
by Rseding91
Thanks for the report however I have no idea what you mean.

Re: [17.69] on_gui_switch_state_changed

Posted: Mon Sep 30, 2019 6:24 am
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.

Re: [17.69] on_gui_switch_state_changed

Posted: Mon Sep 30, 2019 3:26 pm
by LuziferSenpai
Here is the Modification which has this Problem:
Electronic_Locomotives_0.3.0.zip
(14.32 MiB) Downloaded 147 times

Re: [17.69] on_gui_switch_state_changed

Posted: Mon Sep 30, 2019 7:16 pm
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.

Re: [17.69] on_gui_switch_state_changed

Posted: Tue Oct 01, 2019 10:16 am
by Klonan
Can you provide a code snippet/console command that will demonstrate the issue

Re: [17.69] on_gui_switch_state_changed

Posted: Tue Oct 01, 2019 7:53 pm
by Rseding91
Thanks for the report. It's now fixed for the next version of 0.17.