From c2c7033ece8990de40b82573fb55cf9e5520b751 Mon Sep 17 00:00:00 2001 From: JappaWakka Date: Tue, 31 May 2022 21:00:56 +0200 Subject: [PATCH] Added "@environment.resetregionweather" command Resets the weather to be based on the current season. --- P3D/World/ActionScript/V2/ScriptCommands/DoEnvironment.vb | 2 ++ P3D/World/ActionScript/V2/ScriptLibrary.vb | 1 + P3D/World/World.vb | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/P3D/World/ActionScript/V2/ScriptCommands/DoEnvironment.vb b/P3D/World/ActionScript/V2/ScriptCommands/DoEnvironment.vb index 4a8bde298..035828d75 100644 --- a/P3D/World/ActionScript/V2/ScriptCommands/DoEnvironment.vb +++ b/P3D/World/ActionScript/V2/ScriptCommands/DoEnvironment.vb @@ -15,6 +15,8 @@ Screen.Level.WeatherType = int(argument) Case "setregionweather" World.RegionWeather = CType(int(argument), World.Weathers) + Case "resetregionweather" + World.RegionWeather = World.GetRegionWeather(World.CurrentSeason) Case "setseason" If int(argument) = -1 Then World.setSeason = Nothing diff --git a/P3D/World/ActionScript/V2/ScriptLibrary.vb b/P3D/World/ActionScript/V2/ScriptLibrary.vb index 6a73101fb..b7b986319 100644 --- a/P3D/World/ActionScript/V2/ScriptLibrary.vb +++ b/P3D/World/ActionScript/V2/ScriptLibrary.vb @@ -397,6 +397,7 @@ Namespace ScriptVersion2 ' Commands: r(New ScriptCommand("environment", "setweather", {New ScriptArgument("weatherType", ScriptArgument.ArgumentTypes.Int)}.ToList(), "Changes the weather type of the current map.")) r(New ScriptCommand("environment", "setregionweather", {New ScriptArgument("weatherID", ScriptArgument.ArgumentTypes.Int)}.ToList(), "Changes the weather of the current region.")) + r(New ScriptCommand("environment", "resetregionweather", "Resets the weather to be based on the current season.")) r(New ScriptCommand("environment", "setseason", {New ScriptArgument("seasonID", ScriptArgument.ArgumentTypes.Int)}.ToList(), "Changes the season. Use -1 as the argument to change back to the default season.")) r(New ScriptCommand("environment", "setcanfly", {New ScriptArgument("canfly", ScriptArgument.ArgumentTypes.Bool)}.ToList(), "Sets the ""CanFly"" parameter of the current map.")) r(New ScriptCommand("environment", "setcandig", {New ScriptArgument("candig", ScriptArgument.ArgumentTypes.Bool)}.ToList(), "Sets the ""CanDig"" parameter of the current map.")) diff --git a/P3D/World/World.vb b/P3D/World/World.vb index 258eb4c61..bfc8b413f 100644 --- a/P3D/World/World.vb +++ b/P3D/World/World.vb @@ -382,7 +382,7 @@ endsub: Screen.Camera.CreateNewProjection(Screen.Camera.FOV) End Sub - Private Shared Function GetRegionWeather(ByVal Season As Seasons) As Weathers + Public Shared Function GetRegionWeather(ByVal Season As Seasons) As Weathers If IsMainMenu Then Return Weathers.Clear End If