The International Simutrans Forum

Development => Patches & Projects => Denied Requests & Patches => Topic started by: Yona-TYT on May 26, 2024, 09:19:21 PM

Title: [PATCH] ADD systemtype in is_tool_allowed
Post by: Yona-TYT on May 26, 2024, 09:19:21 PM
I would like to implement this to better control the tools using the script api.

This adds an additional parameter to "is_tool_allowed", I don't think there are many scripts that use this function, however I am committed to fixing those that are necessary.

0001-ADD-systemtype-in-is_tool_allowed.patch
Title: Re: [PATCH] ADD systemtype in is_tool_allowed
Post by: prissi on May 27, 2024, 06:23:07 AM
This will only work partially since there is also the pseudo waytypes like tram that gets translated into system types later.

I suppose you want that for the tutorial. I would again advise against changing the menus for the tutorial. Also, if a script ends, the main menu bar would stay like this until reload or going to underground mode.

I think this needs a little more discussion before incorporating.
Title: Re: [PATCH] ADD systemtype in is_tool_allowed
Post by: Roboron on May 27, 2024, 06:43:04 AM
I am also not very fond of hiding menu items for the tutorial. Recently, a player complained that they were unable to find a tool they had prevuously used in the tutorial. That's probably because the tool was in a completely different position.

Suggestion: If possible, highlight the required tool instead. Be it by darkening every other tool, or by placing some type of marker over it.
Title: Re: [PATCH] ADD systemtype in is_tool_allowed
Post by: Leartin on May 27, 2024, 09:23:40 AM
I agree that tutorials shouldn't hide the complete menu.

But the player shouldn't be able to build something completely different accidentially, so restricting their choices makes sense. Hence they would still need to be forbidden to use icons.

You may introduce a 'disabled' state for icons and have 'is_tool_allowed' disable them instead of removing them, but that has no bearing on the need to be more specific with target parameters.
Title: Re: [PATCH] ADD systemtype in is_tool_allowed
Post by: Yona-TYT on May 28, 2024, 12:02:49 AM
Quote from: Roboron on May 27, 2024, 06:43:04 AMSuggestion: If possible, highlight the required tool instead. Be it by darkening every other tool, or by placing some type of marker over it.
I like that idea, just darkening the tools that are not going to be used a little.

There is a problem with the elevated roads that I have wanted to fix for years, and the only easy method to do it is by adding systemtype as a parameter.

Basically you cannot differentiate normal roads and an elevated roads.
Captura desde 2024-05-27 20-00-07.png
Title: Re: [PATCH] ADD systemtype in is_tool_allowed
Post by: Yona-TYT on May 28, 2024, 07:23:05 PM
Quote from: Roboron on May 27, 2024, 06:43:04 AMSuggestion: If possible, highlight the required tool instead. Be it by darkening every other tool, or by placing some type of marker over it.

What do you think of this?.

https://forum.simutrans.com/index.php/topic,23052.msg207490/topicseen.html#msg207490