Switch between forms and dex entries
This commit is contained in:
parent
47e0594bb5
commit
de6001a97d
|
@ -346,7 +346,7 @@ Public Class PokedexScreen
|
||||||
Dim Scroll As Integer = 0
|
Dim Scroll As Integer = 0
|
||||||
Dim Cursor As New Vector2(0)
|
Dim Cursor As New Vector2(0)
|
||||||
|
|
||||||
Shared TempPokemonStorage As New Dictionary(Of Integer, Pokemon)
|
Public Shared TempPokemonStorage As New Dictionary(Of Integer, Pokemon)
|
||||||
Shared TempPokemonDexType As New Dictionary(Of Integer, Integer)
|
Shared TempPokemonDexType As New Dictionary(Of Integer, Integer)
|
||||||
|
|
||||||
Dim PokemonList As New List(Of Pokemon)
|
Dim PokemonList As New List(Of Pokemon)
|
||||||
|
@ -473,10 +473,13 @@ Public Class PokedexScreen
|
||||||
Next
|
Next
|
||||||
|
|
||||||
If valid = True Then
|
If valid = True Then
|
||||||
|
If Profile.Pokedex IsNot Nothing Then
|
||||||
If Profile.Pokedex.GetPlace(pokeSearchList(i)) <> -1 Then
|
If Profile.Pokedex.GetPlace(pokeSearchList(i)) <> -1 Then
|
||||||
Me.PokemonList.Add(p)
|
Me.PokemonList.Add(p)
|
||||||
End If
|
End If
|
||||||
|
Else
|
||||||
|
Me.PokemonList.Add(p)
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
@ -804,9 +807,11 @@ Public Class PokedexScreen
|
||||||
|
|
||||||
If New Rectangle(50 + x * 100, 140 + y * 100, 64, 92).Contains(MouseHandler.MousePosition) = True Then
|
If New Rectangle(50 + x * 100, 140 + y * 100, 64, 92).Contains(MouseHandler.MousePosition) = True Then
|
||||||
If Cursor.X + Cursor.Y * 6 = i Then
|
If Cursor.X + Cursor.Y * 6 = i Then
|
||||||
If TempPokemonDexType(CInt((Cursor.Y + Scroll) * 6 + Cursor.X + 1)) > 0 Then
|
Dim dexIndex As Integer = CInt((Cursor.Y + Scroll) * 6 + Cursor.X + 1)
|
||||||
|
If TempPokemonDexType(dexIndex) > 0 Then
|
||||||
SoundManager.PlaySound("select")
|
SoundManager.PlaySound("select")
|
||||||
Core.SetScreen(New PokedexViewScreen(Me, TempPokemonStorage(CInt((Cursor.Y + Scroll) * 6 + Cursor.X + 1)), False))
|
|
||||||
|
Core.SetScreen(New PokedexViewScreen(Me, TempPokemonStorage(dexIndex), False, dexIndex))
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
Cursor.X = x
|
Cursor.X = x
|
||||||
|
@ -819,9 +824,10 @@ Public Class PokedexScreen
|
||||||
ClampCursor()
|
ClampCursor()
|
||||||
|
|
||||||
If Controls.Accept(False, True, True) = True Then
|
If Controls.Accept(False, True, True) = True Then
|
||||||
If TempPokemonDexType(CInt((Cursor.Y + Scroll) * 6 + Cursor.X + 1)) > 0 Then
|
Dim dexIndex As Integer = CInt((Cursor.Y + Scroll) * 6 + Cursor.X + 1)
|
||||||
|
If TempPokemonDexType(dexIndex) > 0 Then
|
||||||
SoundManager.PlaySound("select")
|
SoundManager.PlaySound("select")
|
||||||
Core.SetScreen(New PokedexViewScreen(Me, TempPokemonStorage(CInt((Cursor.Y + Scroll) * 6 + Cursor.X + 1)), False))
|
Core.SetScreen(New PokedexViewScreen(Me, TempPokemonStorage(dexIndex), False, dexIndex))
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
@ -1284,9 +1290,12 @@ Public Class PokedexViewScreen
|
||||||
|
|
||||||
Inherits Screen
|
Inherits Screen
|
||||||
|
|
||||||
|
Dim DexIndex As Integer = -1
|
||||||
Dim Pokemon As Pokemon
|
Dim Pokemon As Pokemon
|
||||||
Dim texture As Texture2D
|
Dim texture As Texture2D
|
||||||
Dim Page As Integer = 0
|
Dim Page As Integer = 0
|
||||||
|
Dim Forms As New List(Of String)
|
||||||
|
Dim FormIndex As Integer = 0
|
||||||
|
|
||||||
Dim EntryType As Integer = 0
|
Dim EntryType As Integer = 0
|
||||||
Dim _transitionOut As Boolean = False
|
Dim _transitionOut As Boolean = False
|
||||||
|
@ -1336,7 +1345,7 @@ Public Class PokedexViewScreen
|
||||||
''' <param name="currentScreen">The screen that is currently active.</param>
|
''' <param name="currentScreen">The screen that is currently active.</param>
|
||||||
''' <param name="Pokemon">The Pokémon to display.</param>
|
''' <param name="Pokemon">The Pokémon to display.</param>
|
||||||
''' <param name="transitionOut">If the screen should fade out when closed.</param>
|
''' <param name="transitionOut">If the screen should fade out when closed.</param>
|
||||||
Public Sub New(ByVal currentScreen As Screen, ByVal Pokemon As Pokemon, ByVal transitionOut As Boolean)
|
Public Sub New(ByVal currentScreen As Screen, ByVal Pokemon As Pokemon, ByVal transitionOut As Boolean, Optional DexIndex As Integer = -1)
|
||||||
Me.PreScreen = currentScreen
|
Me.PreScreen = currentScreen
|
||||||
Me.Identification = Identifications.PokedexViewScreen
|
Me.Identification = Identifications.PokedexViewScreen
|
||||||
Me.texture = TextureManager.GetTexture("GUI\Menus\General")
|
Me.texture = TextureManager.GetTexture("GUI\Menus\General")
|
||||||
|
@ -1346,7 +1355,29 @@ Public Class PokedexViewScreen
|
||||||
Me.CanBePaused = True
|
Me.CanBePaused = True
|
||||||
Me._transitionOut = transitionOut
|
Me._transitionOut = transitionOut
|
||||||
|
|
||||||
Me.Pokemon = Pokemon
|
If Me.Forms.Count > 0 Then
|
||||||
|
Me.Forms.Clear()
|
||||||
|
Me.Forms.Add(Me.Pokemon.Number.ToString)
|
||||||
|
Me.FormIndex = 0
|
||||||
|
End If
|
||||||
|
|
||||||
|
LoadPokemonData(DexIndex, Pokemon)
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub LoadPokemonData(ByVal newDexIndex As Integer, Optional ByVal newPokemon As Pokemon = Nothing, Optional playCry As Boolean = False)
|
||||||
|
If newPokemon IsNot Nothing Then
|
||||||
|
EvolutionLineConnections.Clear()
|
||||||
|
Me.Pokemon = newPokemon
|
||||||
|
End If
|
||||||
|
If newDexIndex <> -1 AndAlso newDexIndex <> Me.DexIndex Then
|
||||||
|
Me.Pokemon = PokedexScreen.TempPokemonStorage(newDexIndex)
|
||||||
|
Me.DexIndex = newDexIndex
|
||||||
|
Me.Forms.Clear()
|
||||||
|
Me.Forms.Add(Me.Pokemon.Number.ToString)
|
||||||
|
Me.FormIndex = 0
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
Dim dexID As String = PokemonForms.GetPokemonDataFileName(Me.Pokemon.Number, Me.Pokemon.AdditionalData)
|
Dim dexID As String = PokemonForms.GetPokemonDataFileName(Me.Pokemon.Number, Me.Pokemon.AdditionalData)
|
||||||
If dexID.Contains("_") = False Then
|
If dexID.Contains("_") = False Then
|
||||||
|
@ -1360,8 +1391,14 @@ Public Class PokedexViewScreen
|
||||||
Me.EntryType = Pokedex.GetEntryType(Core.Player.PokedexData, dexID)
|
Me.EntryType = Pokedex.GetEntryType(Core.Player.PokedexData, dexID)
|
||||||
|
|
||||||
Me.GetYOffset()
|
Me.GetYOffset()
|
||||||
Me.FillEvolutionGrid()
|
|
||||||
Me.FillHabitats()
|
Me.FillHabitats()
|
||||||
|
Me.FillEvolutionGrid()
|
||||||
|
|
||||||
|
If playCry = True Then
|
||||||
|
Dim crySuffix As String = PokemonForms.GetCrySuffix(Me.Pokemon)
|
||||||
|
SoundManager.PlayPokemonCry(Pokemon.Number, crySuffix)
|
||||||
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub FillEvolutionGrid()
|
Private Sub FillEvolutionGrid()
|
||||||
|
@ -1395,6 +1432,14 @@ Public Class PokedexViewScreen
|
||||||
Next
|
Next
|
||||||
Dim evoline As New PokemonEvolutionLine(GridPositions, PokemonIDs)
|
Dim evoline As New PokemonEvolutionLine(GridPositions, PokemonIDs)
|
||||||
EvolutionLineConnections.Add(evoline)
|
EvolutionLineConnections.Add(evoline)
|
||||||
|
|
||||||
|
For Each f As String In PokemonIDs
|
||||||
|
If CInt(f.GetSplit(0, "_").GetSplit(0, ";")) = Me.Pokemon.Number Then
|
||||||
|
If Me.Forms.Contains(f) = False Then
|
||||||
|
Me.Forms.Add(f)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Next
|
||||||
Next
|
Next
|
||||||
Else
|
Else
|
||||||
Dim GridPositions As New List(Of Vector2)
|
Dim GridPositions As New List(Of Vector2)
|
||||||
|
@ -1509,7 +1554,8 @@ Public Class PokedexViewScreen
|
||||||
|
|
||||||
For i = 0 To Me.HabitatList.Count - 1
|
For i = 0 To Me.HabitatList.Count - 1
|
||||||
If i <= Me.HabitatList.Count - 1 Then
|
If i <= Me.HabitatList.Count - 1 Then
|
||||||
If Me.HabitatList(i).HasPokemon(PokemonForms.GetPokemonDataFileName(Me.Pokemon.Number, Me.Pokemon.AdditionalData)) = False Then
|
Dim dexID As String = PokemonForms.GetPokemonDataFileName(Me.Pokemon.Number, Me.Pokemon.AdditionalData)
|
||||||
|
If Me.HabitatList(i).HasPokemon(dexID) = False Then
|
||||||
Me.HabitatList.RemoveAt(i)
|
Me.HabitatList.RemoveAt(i)
|
||||||
i -= 1
|
i -= 1
|
||||||
End If
|
End If
|
||||||
|
@ -1630,6 +1676,9 @@ Public Class PokedexViewScreen
|
||||||
Else
|
Else
|
||||||
Core.SpriteBatch.Draw(TextureManager.GetTexture("GUI\Menus\Types"), New Rectangle(CInt(mV.X - 350), CInt(mV.Y + 123), 96, 32), Pokemon.Type1.GetElementImage(), Color.White)
|
Core.SpriteBatch.Draw(TextureManager.GetTexture("GUI\Menus\Types"), New Rectangle(CInt(mV.X - 350), CInt(mV.Y + 123), 96, 32), Pokemon.Type1.GetElementImage(), Color.White)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Core.SpriteBatch.DrawString(FontManager.MainFont, Pokemon.PokedexEntry.Text.CropStringToWidth(FontManager.MainFont, 720), New Vector2(mV.X - FontManager.MainFont.MeasureString(Pokemon.PokedexEntry.Text.CropStringToWidth(FontManager.MainFont, 720)).X / 2, windowSize.Height - 128), Color.Black)
|
||||||
|
|
||||||
Else
|
Else
|
||||||
Core.SpriteBatch.DrawString(FontManager.MainFont, "??? m", New Vector2(mV.X + 250, mV.Y - 152), Color.Black)
|
Core.SpriteBatch.DrawString(FontManager.MainFont, "??? m", New Vector2(mV.X + 250, mV.Y - 152), Color.Black)
|
||||||
Core.SpriteBatch.DrawString(FontManager.MainFont, "??? kg", New Vector2(mV.X + 250, mV.Y + 128), Color.Black)
|
Core.SpriteBatch.DrawString(FontManager.MainFont, "??? kg", New Vector2(mV.X + 250, mV.Y + 128), Color.Black)
|
||||||
|
@ -1782,6 +1831,52 @@ Public Class PokedexViewScreen
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If DexIndex > -1 Then
|
||||||
|
If Me.DexIndex > PokedexScreen.TempPokemonStorage.Keys(0) Then
|
||||||
|
If Controls.Up(True, True, False, True, True, True) = True Then
|
||||||
|
vLineLength = 1
|
||||||
|
mLineLength = 1
|
||||||
|
fadeMainImage = 0
|
||||||
|
LoadPokemonData(Me.DexIndex - 1, Nothing, True)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Me.DexIndex < PokedexScreen.TempPokemonStorage.Keys(PokedexScreen.TempPokemonStorage.Count - 1) Then
|
||||||
|
If Controls.Down(True, True, False, True, True, True) = True Then
|
||||||
|
vLineLength = 1
|
||||||
|
mLineLength = 1
|
||||||
|
fadeMainImage = 0
|
||||||
|
LoadPokemonData(Me.DexIndex + 1, Nothing, True)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Controls.ShiftPressed = True Then
|
||||||
|
Me.FormIndex += 1
|
||||||
|
If Me.FormIndex > Me.Forms.Count - 1 Then
|
||||||
|
Me.FormIndex = 0
|
||||||
|
End If
|
||||||
|
If Me.Forms(Me.FormIndex) IsNot "" Then
|
||||||
|
Dim PokeID As Integer = CInt(Me.Forms(Me.FormIndex).GetSplit(0, "_").GetSplit(0, ";"))
|
||||||
|
Dim PokeAD As String = ""
|
||||||
|
|
||||||
|
If Me.Forms(Me.FormIndex).Contains("_") Then
|
||||||
|
PokeAD = PokemonForms.GetAdditionalValueFromDataFile(Me.Forms(Me.FormIndex))
|
||||||
|
ElseIf Me.Forms(Me.FormIndex).Contains(";") Then
|
||||||
|
PokeAD = Me.Forms(Me.FormIndex).GetSplit(1, ";")
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim newPokemon As Pokemon = Pokemon.GetPokemonByID(PokeID, PokeAD, True)
|
||||||
|
|
||||||
|
Dim playCry As Boolean = False
|
||||||
|
If Page = 0 Then
|
||||||
|
playCry = True
|
||||||
|
End If
|
||||||
|
LoadPokemonData(-1, newPokemon, playCry)
|
||||||
|
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
UpdateIntro()
|
UpdateIntro()
|
||||||
|
|
||||||
If mLineLength = 100 Then
|
If mLineLength = 100 Then
|
||||||
|
@ -1832,7 +1927,8 @@ Public Class PokedexViewScreen
|
||||||
fadeMainImage = 255
|
fadeMainImage = 255
|
||||||
If playedCry = False Then
|
If playedCry = False Then
|
||||||
playedCry = True
|
playedCry = True
|
||||||
SoundManager.PlayPokemonCry(Pokemon.Number)
|
Dim crySuffix As String = PokemonForms.GetCrySuffix(Me.Pokemon)
|
||||||
|
SoundManager.PlayPokemonCry(Pokemon.Number, crySuffix)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
|
|
Loading…
Reference in New Issue