Actually fix the water reset this time

This commit is contained in:
JappaWakka 2023-06-05 16:12:22 +02:00
parent ef0e2709f4
commit c6caf0dbbb
3 changed files with 35 additions and 2 deletions

View File

@ -2,7 +2,8 @@
Inherits Entity
Shared WaterTexturesTemp As New Dictionary(Of String, Texture2D)
Public Shared WaterTexturesTemp As New Dictionary(Of String, Texture2D)
Shared SetWaterTextures As Boolean = True
Dim waterTextureName As String = ""
Dim WaterAnimation As Animation
@ -22,6 +23,20 @@
WaterTexturesTemp.Clear()
End Sub
Public Shared Sub AddDefaultWaterAnimationResources()
Water.WaterTexturesTemp.Add("_0", TextureManager.GetTexture("Routes", New Rectangle(0, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_1", TextureManager.GetTexture("Routes", New Rectangle(20, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_2", TextureManager.GetTexture("Routes", New Rectangle(40, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_3", TextureManager.GetTexture("Routes", New Rectangle(60, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_4", TextureManager.GetTexture("Routes", New Rectangle(80, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_5", TextureManager.GetTexture("Routes", New Rectangle(100, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_6", TextureManager.GetTexture("Routes", New Rectangle(120, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_7", TextureManager.GetTexture("Routes", New Rectangle(140, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_8", TextureManager.GetTexture("Routes", New Rectangle(160, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_9", TextureManager.GetTexture("Routes", New Rectangle(180, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_10", TextureManager.GetTexture("Routes", New Rectangle(200, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_11", TextureManager.GetTexture("Routes", New Rectangle(220, 220, 20, 20)))
End Sub
Private Sub CreateWaterTextureTemp()
If Core.GameOptions.GraphicStyle = 1 Then
Dim textureData As List(Of String) = Me.AdditionalValue.Split(CChar(",")).ToList()

View File

@ -15,7 +15,20 @@
WaterfallTexturesTemp.Clear()
WaterTexturesTemp.Clear()
End Sub
Public Shared Sub AddDefaultWaterAnimationResources()
Waterfall.WaterTexturesTemp.Add("_0", TextureManager.GetTexture("Routes", New Rectangle(0, 220, 20, 20)))
Waterfall.WaterTexturesTemp.Add("_1", TextureManager.GetTexture("Routes", New Rectangle(20, 220, 20, 20)))
Waterfall.WaterTexturesTemp.Add("_2", TextureManager.GetTexture("Routes", New Rectangle(40, 220, 20, 20)))
Waterfall.WaterTexturesTemp.Add("_3", TextureManager.GetTexture("Routes", New Rectangle(60, 220, 20, 20)))
Waterfall.WaterTexturesTemp.Add("_4", TextureManager.GetTexture("Routes", New Rectangle(80, 220, 20, 20)))
Waterfall.WaterTexturesTemp.Add("_5", TextureManager.GetTexture("Routes", New Rectangle(100, 220, 20, 20)))
Waterfall.WaterTexturesTemp.Add("_6", TextureManager.GetTexture("Routes", New Rectangle(120, 220, 20, 20)))
Waterfall.WaterTexturesTemp.Add("_7", TextureManager.GetTexture("Routes", New Rectangle(140, 220, 20, 20)))
Waterfall.WaterTexturesTemp.Add("_8", TextureManager.GetTexture("Routes", New Rectangle(160, 220, 20, 20)))
Waterfall.WaterTexturesTemp.Add("_9", TextureManager.GetTexture("Routes", New Rectangle(180, 220, 20, 20)))
Waterfall.WaterTexturesTemp.Add("_10", TextureManager.GetTexture("Routes", New Rectangle(200, 220, 20, 20)))
Waterfall.WaterTexturesTemp.Add("_11", TextureManager.GetTexture("Routes", New Rectangle(220, 220, 20, 20)))
End Sub
Public Overrides Sub Initialize()
MyBase.Initialize()

View File

@ -1444,6 +1444,11 @@ Public Class NewMainMenuScreen
If _gameModeExists Then
GameModeManager.SetGameModePointer(_gameMode)
Localization.ReloadGameModeTokens()
Water.ClearAnimationResources()
Waterfall.ClearAnimationResources()
Water.AddDefaultWaterAnimationResources()
Waterfall.AddDefaultWaterAnimationResources()
World.IsMainMenu = False
If _isGameJolt Then
Core.Player.IsGameJoltSave = True