The International Simutrans Forum

Development => Scripting Scenarios and AI => Topic started by: Yona-TYT on June 16, 2020, 03:16:16 AM

Title: Automatically switch to "inspection tool"
Post by: Yona-TYT on June 16, 2020, 03:16:16 AM

There is a detail when using "rules.forbid_tool" and the tool we are using is no longer available.

It is a bit misleading since sometimes one starts to click without anything happening and then you realize that the tool is no longer there.

It would be good to change to the default selected tool (inspection tool) for those cases.
(https://www.mediafire.com/convkey/64ea/1qucngeslogmqug6g.jpg)
Title: Re: Automatically switch to "inspection tool"
Post by: Yona-TYT on June 17, 2020, 02:16:08 PM
Can you replicate this? It would be great to improve this.
Title: Re: Automatically switch to "inspection tool"
Post by: Dwachs on June 18, 2020, 05:24:47 AM
This can be changed.
Title: Re: Automatically switch to "inspection tool"
Post by: Dwachs on June 18, 2020, 06:11:44 AM
Please test with r9144. The tools should be reset, but only if game is not paused. I added also a routine rules.gui_needs_update to signal this to the scenario. There might be a tiny delay between the call and the actual resetting.
Title: Re: Automatically switch to "inspection tool"
Post by: Yona-TYT on June 18, 2020, 11:10:30 AM
Great !!, I'm going to try this !!... :D Edit.
It works very well, thank you very much!. 8)