News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

[PATCH] ADD systemtype in is_tool_allowed

Started by Yona-TYT, May 26, 2024, 09:19:21 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yona-TYT

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

prissi

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.

Roboron

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.

Leartin

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.

Yona-TYT

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

Yona-TYT

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