BattleScreen + BattleCatchScreen softlock fixes

This commit is contained in:
JappaWakka 2023-01-13 14:46:44 +01:00
parent 9970d892de
commit dfbaaf2b33
8 changed files with 43 additions and 16 deletions

View File

@ -7,11 +7,18 @@
Moves Moves
End Enum End Enum
Public CanInteract As Boolean = True
Public MenuState As MenuStates = MenuStates.Main Public MenuState As MenuStates = MenuStates.Main
Public Visible As Boolean = False Public Visible As Boolean = False
Public Sub New() Public Sub New()
Me.Reset() Me.Reset()
Dim blockinteractscreen() As Screen.Identifications = {Screen.Identifications.PartyScreen, Screen.Identifications.SummaryScreen, Screen.Identifications.PauseScreen, Screen.Identifications.ChatScreen}
If blockinteractscreen.Contains(Core.CurrentScreen.Identification) = True Then
CanInteract = False
Else
CanInteract = True
End If
End Sub End Sub
Public Sub Reset() Public Sub Reset()
@ -193,9 +200,9 @@
End If End If
Dim cX As Integer = 0 Dim cX As Integer = 0
If HPpercentage <= 50.0F And HPpercentage > 15.0F Then If HPpercentage <= 75.0F And HPpercentage > 25.0F Then
cX = 2 cX = 2
ElseIf HPpercentage <= 15.0F Then ElseIf HPpercentage <= 25.0F Then
cX = 4 cX = 4
End If End If
@ -307,12 +314,14 @@
End Sub End Sub
Public Sub Update(ByRef BattleScreen As BattleScreen) Public Sub Update(ByRef BattleScreen As BattleScreen)
If CanInteract = True Then
Select Case MenuState Select Case MenuState
Case MenuStates.Main Case MenuStates.Main
UpdateMainMenu(BattleScreen) UpdateMainMenu(BattleScreen)
Case MenuStates.Moves Case MenuStates.Moves
UpdateMoveMenu(BattleScreen) UpdateMoveMenu(BattleScreen)
End Select End Select
End If
End Sub End Sub
Private _allItemsExtended As Integer = 0 Private _allItemsExtended As Integer = 0

View File

@ -1025,11 +1025,13 @@ nextIndexForeground:
End If End If
Lighting.UpdateLighting(Screen.Effect) Lighting.UpdateLighting(Screen.Effect)
If IsCurrentScreen() = True Then
Camera.Update() Camera.Update()
Level.Update() Level.Update()
SkyDome.Update() SkyDome.Update()
End If
TextBox.Update() TextBox.Update()
If TextBox.Showing = False Then If TextBox.Showing = False Then
Dim cIndex As Integer = 0 Dim cIndex As Integer = 0

View File

@ -58,11 +58,13 @@
Me._textIndex = Me._text.Length Me._textIndex = Me._text.Length
End If End If
Else Else
If CurrentScreen.Identification <> Screen.Identifications.PauseScreen AndAlso CurrentScreen.Identification <> Screen.Identifications.ChatScreen Then
If Controls.Accept(True, True) = True Then If Controls.Accept(True, True) = True Then
SoundManager.PlaySound("select") SoundManager.PlaySound("select")
Me._ready = True Me._ready = True
End If End If
End If End If
End If
End Sub End Sub
Public Overrides Sub Draw(BV2Screen As BattleScreen) Public Overrides Sub Draw(BV2Screen As BattleScreen)

View File

@ -61,9 +61,11 @@ Public Class ChatScreen
'Updates the level screen so online player entities get drawn. 'Updates the level screen so online player entities get drawn.
If PreScreen.Identification = Identifications.OverworldScreen And JoinServerScreen.Online = True Then If PreScreen.Identification = Identifications.OverworldScreen And JoinServerScreen.Online = True Then
Screen.Level.Update() Screen.Level.Update()
End If ElseIf PreScreen.Identification = Screen.Identifications.BattleScreen Then
If PreScreen.Identification = Screen.Identifications.BattleScreen Then
PreScreen.Update() PreScreen.Update()
ElseIf PreScreen.Identification = Identifications.BattleCatchScreen Then
PreScreen.Update()
CType(PreScreen, BattleCatchScreen).UpdateAnimations()
End If End If
If CursorDelay > 0 Then If CursorDelay > 0 Then

View File

@ -587,6 +587,9 @@ Public Class NewInventoryScreen
End Function End Function
Public Overrides Sub Update() Public Overrides Sub Update()
If PreScreen.Identification = Screen.Identifications.BattleScreen Then
PreScreen.Update()
End If
'Updates the tab highlight: 'Updates the tab highlight:
For index = 0 To _tabHighlight.Length - 1 For index = 0 To _tabHighlight.Length - 1
If index <> _tabIndex Then If index <> _tabIndex Then

View File

@ -82,7 +82,10 @@
If PreScreen.Identification = Identifications.OverworldScreen Then If PreScreen.Identification = Identifications.OverworldScreen Then
Screen.Level.Update() Screen.Level.Update()
ElseIf PreScreen.Identification = Identifications.BattleCatchScreen Then ElseIf PreScreen.Identification = Identifications.BattleCatchScreen Then
PreScreen.Update()
CType(PreScreen, BattleCatchScreen).UpdateAnimations() CType(PreScreen, BattleCatchScreen).UpdateAnimations()
ElseIf PreScreen.Identification = Screen.Identifications.BattleScreen Then
PreScreen.Update()
End If End If
Screen.TextBox.reDelay = 0.0F Screen.TextBox.reDelay = 0.0F

View File

@ -420,6 +420,9 @@ Public Class PartyScreen
End Function End Function
Public Overrides Sub Update() Public Overrides Sub Update()
If PreScreen.Identification = Screen.Identifications.BattleScreen Then
PreScreen.Update()
End If
If _pokemonAnimations.Count > 0 Then If _pokemonAnimations.Count > 0 Then
Dim animation As PokemonAnimation = _pokemonAnimations(_index) Dim animation As PokemonAnimation = _pokemonAnimations(_index)
If animation._shakeLeft Then If animation._shakeLeft Then

View File

@ -593,6 +593,9 @@
End Sub End Sub
Public Overrides Sub Update() Public Overrides Sub Update()
If PreScreen.PreScreen.Identification = Screen.Identifications.BattleScreen Then
PreScreen.PreScreen.Update()
End If
If _closing = True Then If _closing = True Then
If _fadeIn > 0F Then If _fadeIn > 0F Then
_fadeIn = MathHelper.Lerp(0, _fadeIn, 0.8F) _fadeIn = MathHelper.Lerp(0, _fadeIn, 0.8F)