mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-07-29 16:54:56 +02:00
Fixed previewer interaction with boxes for SummaryScreen
This commit is contained in:
parent
d39eb53bbd
commit
0f839cce23
@ -13,6 +13,9 @@
|
|||||||
'Pointer
|
'Pointer
|
||||||
Private _pointerDest As Integer = 0
|
Private _pointerDest As Integer = 0
|
||||||
Private _pointerPos As Single = 0F
|
Private _pointerPos As Single = 0F
|
||||||
|
Private _pokemonDest As Integer = 0
|
||||||
|
Private _pokemonPos As Single = 0F
|
||||||
|
Private _previewerOffset As Integer = 0
|
||||||
|
|
||||||
'Fade in animation:
|
'Fade in animation:
|
||||||
Private _fadeIn As Single = 0F
|
Private _fadeIn As Single = 0F
|
||||||
@ -56,9 +59,10 @@
|
|||||||
_partyIndex = partyIndex
|
_partyIndex = partyIndex
|
||||||
_party = party
|
_party = party
|
||||||
|
|
||||||
SetPointerDest(_partyIndex)
|
SetDest(_partyIndex)
|
||||||
GetYOffset()
|
GetYOffset()
|
||||||
_pointerPos = _pointerDest
|
_pointerPos = _pointerDest
|
||||||
|
_pokemonPos = _pokemonDest
|
||||||
_moveSelectorPosition = GetMoveSelectorDest(_moveIndex)
|
_moveSelectorPosition = GetMoveSelectorDest(_moveIndex)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@ -71,9 +75,10 @@
|
|||||||
_pageIndex = Player.Temp.PokemonSummaryPageIndex
|
_pageIndex = Player.Temp.PokemonSummaryPageIndex
|
||||||
_selectedPokemon = selectedPokemon
|
_selectedPokemon = selectedPokemon
|
||||||
|
|
||||||
SetPointerDest(_partyIndex)
|
SetDest(_partyIndex)
|
||||||
GetYOffset()
|
GetYOffset()
|
||||||
_pointerPos = _pointerDest
|
_pointerPos = _pointerDest
|
||||||
|
_pokemonPos = _pokemonDest
|
||||||
_moveSelectorPosition = GetMoveSelectorDest(_moveIndex)
|
_moveSelectorPosition = GetMoveSelectorDest(_moveIndex)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@ -138,7 +143,7 @@
|
|||||||
|
|
||||||
If _partyIndex > -1 Then
|
If _partyIndex > -1 Then
|
||||||
For i = 0 To _party.Count - 1
|
For i = 0 To _party.Count - 1
|
||||||
Dim pokemonPos As Double = GetPointerDest(i) - 16
|
Dim pokemonPos As Double = GetPokemonDest(i) - 16 - (64 + 16) * (_pokemonDest - _pokemonPos)
|
||||||
|
|
||||||
Core.SpriteBatch.Draw(_party(i).GetMenuTexture(), New Rectangle(CInt(pokemonPos), 16, 64, 64), mainBackgroundColor)
|
Core.SpriteBatch.Draw(_party(i).GetMenuTexture(), New Rectangle(CInt(pokemonPos), 16, 64, 64), mainBackgroundColor)
|
||||||
Next
|
Next
|
||||||
@ -600,7 +605,7 @@
|
|||||||
If _partyIndex > 0 Then
|
If _partyIndex > 0 Then
|
||||||
_partyIndex -= 1
|
_partyIndex -= 1
|
||||||
GetYOffset()
|
GetYOffset()
|
||||||
SetPointerDest(_partyIndex)
|
SetDest(_partyIndex)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
@ -608,7 +613,7 @@
|
|||||||
If _partyIndex < _party.Count - 1 Then
|
If _partyIndex < _party.Count - 1 Then
|
||||||
_partyIndex += 1
|
_partyIndex += 1
|
||||||
GetYOffset()
|
GetYOffset()
|
||||||
SetPointerDest(_partyIndex)
|
SetDest(_partyIndex)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
@ -743,39 +748,60 @@
|
|||||||
_pointerPos = _pointerDest
|
_pointerPos = _pointerDest
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
If _pokemonPos < _pokemonDest Then
|
||||||
|
_pokemonPos = MathHelper.Lerp(_pokemonDest, _pokemonPos, 0.8F)
|
||||||
|
If _pokemonPos >= _pokemonDest Then
|
||||||
|
_pokemonPos = _pokemonDest
|
||||||
|
End If
|
||||||
|
ElseIf _pokemonPos > _pokemonDest Then
|
||||||
|
_pokemonPos = MathHelper.Lerp(_pokemonDest, _pokemonPos, 0.8F)
|
||||||
|
If _pokemonPos <= _pokemonDest Then
|
||||||
|
_pokemonPos = _pokemonDest
|
||||||
|
End If
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function GetPointerDest(ByVal partyIndex As Integer) As Integer
|
Private Function GetDest(ByVal partyIndex As Integer) As Integer
|
||||||
Dim pointerX As Double = Core.ScreenSize.Width / 2
|
Dim pointerX As Double = Core.ScreenSize.Width / 2
|
||||||
|
|
||||||
If _party.Length Mod 2 = 0 Then
|
If _party.Length Mod 2 = 0 Then
|
||||||
'Even:
|
'Even:
|
||||||
Dim half As Integer = CInt(_party.Length / 2)
|
Dim half As Integer = CInt(_party.Length / 2)
|
||||||
|
|
||||||
If partyIndex < _party.Length / 2 Then
|
|
||||||
pointerX -= (8 + 64 * (half - partyIndex) + 16 * ((half - 1) - partyIndex))
|
|
||||||
Else
|
|
||||||
pointerX += (8 + (64 + 16) * (partyIndex - half))
|
pointerX += (8 + (64 + 16) * (partyIndex - half))
|
||||||
End If
|
|
||||||
Else
|
Else
|
||||||
'Odd:
|
'Odd:
|
||||||
Dim half As Integer = CInt(Math.Floor(_party.Length / 2))
|
Dim half As Integer = CInt(Math.Floor(_party.Length / 2))
|
||||||
|
pointerX += (64 + 16) * (partyIndex - half)
|
||||||
If partyIndex < half Then
|
|
||||||
pointerX -= (16 + 64) * (half - partyIndex)
|
|
||||||
ElseIf partyIndex > half Then
|
|
||||||
pointerX += (16 + 64) * (partyIndex - half)
|
|
||||||
End If
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Return CInt(pointerX)
|
Return CInt(pointerX)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Sub SetPointerDest(ByVal partyIndex As Integer)
|
Private Function GetPointerDest(ByVal partyIndex As Integer) As Integer
|
||||||
|
Dim pointerX As Double = GetDest(partyIndex)
|
||||||
|
_previewerOffset = 0
|
||||||
|
While pointerX > Core.ScreenSize.Width - (64 + 16)
|
||||||
|
pointerX -= (64 + 16)
|
||||||
|
_previewerOffset -= 1
|
||||||
|
End While
|
||||||
|
While pointerX < (64)
|
||||||
|
pointerX += (64 + 16)
|
||||||
|
_previewerOffset += 1
|
||||||
|
End While
|
||||||
|
|
||||||
|
Return CInt(pointerX)
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Function GetPokemonDest(ByVal partyIndex As Integer) As Integer
|
||||||
|
Dim pointerX As Double = GetDest(partyIndex)
|
||||||
|
pointerX += (_previewerOffset * (64 + 16))
|
||||||
|
Return CInt(pointerX)
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Sub SetDest(ByVal partyIndex As Integer)
|
||||||
_fadeIn = 0F
|
_fadeIn = 0F
|
||||||
_pixelFade = 0F
|
_pixelFade = 0F
|
||||||
_pointerDest = GetPointerDest(partyIndex)
|
_pointerDest = GetPointerDest(partyIndex)
|
||||||
|
_pokemonDest = _previewerOffset
|
||||||
If GetPokemon().IsEgg() = False Then
|
If GetPokemon().IsEgg() = False Then
|
||||||
GetPokemon().PlayCry()
|
GetPokemon().PlayCry()
|
||||||
End If
|
End If
|
||||||
|
Loading…
x
Reference in New Issue
Block a user