The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: Yona-TYT on October 21, 2022, 02:34:51 AM

Title: [Script API] is underground view active
Post by: Yona-TYT on October 21, 2022, 02:34:51 AM
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()
Title: Re: [Script API] is underground view active
Post by: Dwachs on October 21, 2022, 05:39:26 AM
Thanks. Maybe you also want to know which kind of underground mode is active (and the z coordinate of the sliced view) ?
Title: Re: [Script API] is underground view active
Post by: Yona-TYT on October 21, 2022, 10:57:21 AM
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.
Title: Re: [Script API] is underground view active
Post by: Dwachs on October 27, 2022, 06:58:35 PM
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?
Title: Re: [Script API] is underground view active
Post by: Yona-TYT on October 27, 2022, 11:03:45 PM
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()"?
Title: Re: [Script API] is underground view active
Post by: Dwachs on October 29, 2022, 04:27:22 PM
implemented this as settings.get_underground_view_level in r r10792
Title: Re: [Script API] is underground view active
Post by: Yona-TYT on October 29, 2022, 08:53:42 PM
Great, I'll update the tutorials. 8)