News:

Simutrans Sites
Know our official sites. Find tools and resources for Simutrans.

[Script API] is underground view active

Started by Yona-TYT, October 21, 2022, 02:34:51 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yona-TYT

This patch gets a boolean value to check if the is underground view active from the Script API.

This is for use in the underground builds of the tutorial script. :P
settings.is_underground_view_active()

Dwachs

Thanks. Maybe you also want to know which kind of underground mode is active (and the z coordinate of the sliced view) ?
Parsley, sage, rosemary, and maggikraut.

Yona-TYT

#2
Quote from: Dwachs on October 21, 2022, 05:39:26 AMThanks. Maybe you also want to know which kind of underground mode is active (and the z coordinate of the sliced view) ?
Thank you very much. :D

Edit.
Seems like a good idea, so I can display specific information for each underground view style.

Dwachs

I think it may be easier to return grund_t::underground_level, which is -128 for full underground, +127 for normal view, and otherwise it is the level of the sliced view. Then you have all information with one function. What do you think?
Parsley, sage, rosemary, and maggikraut.

Yona-TYT

Quote from: Dwachs on October 27, 2022, 06:58:35 PMI think it may be easier to return grund_t::underground_level, which is -128 for full underground, +127 for normal view, and otherwise it is the level of the sliced view. Then you have all information with one function. What do you think?
Sounds interesting, but what would you name it? Something like "get_ground_leve_view()"?

Dwachs

implemented this as settings.get_underground_view_level in r r10792
Parsley, sage, rosemary, and maggikraut.