From e62791ca05c80957ca85348579e66be561812ac8 Mon Sep 17 00:00:00 2001 From: JappaWakka Date: Wed, 12 Feb 2025 15:51:12 +0100 Subject: [PATCH] =?UTF-8?q?Did=20the=20Pok=C3=A9dex=20entries=20and=20spec?= =?UTF-8?q?ies=20the=20right=20way?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- P3D/Screens/Inventory/PokegearScreen.vb | 25 ++------ P3D/Screens/Pokedex/PokedexScreen.vb | 58 ++++++++----------- .../V2/ScriptConstructs/DoPokedex.vb | 7 ++- 3 files changed, 34 insertions(+), 56 deletions(-) diff --git a/P3D/Screens/Inventory/PokegearScreen.vb b/P3D/Screens/Inventory/PokegearScreen.vb index 2e7bdfec7..68a9bdf42 100644 --- a/P3D/Screens/Inventory/PokegearScreen.vb +++ b/P3D/Screens/Inventory/PokegearScreen.vb @@ -1935,26 +1935,13 @@ Dim DexEntryText As String = p.PokedexEntry.Text Dim DexEntrySpecies As String = p.PokedexEntry.Species - If Localization.LanguageSuffix <> "en" Then - Dim dexID As String = PokemonForms.GetPokemonDataFileName(p.Number, p.AdditionalData, True) - Dim dexEntryID As String = dexID - Dim idValue As Integer = CInt(dexID.GetSplit(0, ",").GetSplit(0, "_").GetSplit(0, ";")) - Dim adValue As String = "" - If dexID.Contains(";") Then - If Pokemon.PokemonDataExists(dexEntryID) = False Then - dexEntryID = dexEntryID.GetSplit(0, ";") - End If - adValue = dexID.GetSplit(1, ";") - ElseIf dexID.Contains("_") Then - adValue = PokemonForms.GetAdditionalValueFromDataFile(dexID) - End If - If Localization.TokenExists("pokemon_desc_" & dexID) = True Then - DexEntryText = Localization.GetString("pokemon_desc_" & dexID, p.PokedexEntry.Text) - End If - If Localization.TokenExists("pokemon_species_" & dexID) = True Then - DexEntrySpecies = Localization.GetString("pokemon_species_" & dexID, p.PokedexEntry.Species) - End If + Dim FormName As String = PokemonForms.GetFormName(p) + If Localization.TokenExists("pokemon_desc_" & FormName) = True Then + DexEntryText = Localization.GetString("pokemon_desc_" & FormName, p.PokedexEntry.Text) + End If + If Localization.TokenExists("pokemon_species_" & FormName) = True Then + DexEntrySpecies = Localization.GetString("pokemon_species_" & FormName, p.PokedexEntry.Species) End If output = "Welcome to the Pokédex Show! Today, we are going to look at the entry of " & p.GetName(True) & "! Its entry reads:~""" & DexEntryText & """~Wow, that is interesting! Also, " & p.GetName(True) & " is " & p.PokedexEntry.Height & "m high and weighs " & p.PokedexEntry.Weight & "kg.~Isn't that amazing?~" & p.GetName(True) & " is part of the " & DexEntrySpecies & " species.~That's all the information we have. Tune in next time!" diff --git a/P3D/Screens/Pokedex/PokedexScreen.vb b/P3D/Screens/Pokedex/PokedexScreen.vb index 4f7cd17f5..83483b8c9 100644 --- a/P3D/Screens/Pokedex/PokedexScreen.vb +++ b/P3D/Screens/Pokedex/PokedexScreen.vb @@ -751,8 +751,10 @@ Public Class PokedexScreen If entryType > 1 Then Dim DexEntrySpecies As String = p.PokedexEntry.Species - If Localization.LanguageSuffix <> "en" AndAlso Localization.TokenExists("pokemon_species_" & dexID) = True Then - DexEntrySpecies = Localization.GetString("pokemon_species_" & dexID, p.PokedexEntry.Species) + Dim FormName As String = PokemonForms.GetFormName(p) + + If Localization.TokenExists("pokemon_species_" & FormName) = True Then + DexEntrySpecies = Localization.GetString("pokemon_species_" & FormName, p.PokedexEntry.Species) End If Core.SpriteBatch.DrawString(FontManager.MainFont, DexEntrySpecies, New Vector2(850, 310), Color.Black) @@ -767,21 +769,8 @@ Public Class PokedexScreen Dim DexEntryText As String = p.PokedexEntry.Text - If Localization.LanguageSuffix <> "en" Then - Dim dexEntryID As String = dexID - Dim idValue As Integer = CInt(dexID.GetSplit(0, ",").GetSplit(0, "_").GetSplit(0, ";")) - Dim adValue As String = "" - If dexID.Contains(";") Then - If Pokemon.PokemonDataExists(dexEntryID) = False Then - dexEntryID = dexEntryID.GetSplit(0, ";") - End If - adValue = dexID.GetSplit(1, ";") - ElseIf dexID.Contains("_") Then - adValue = PokemonForms.GetAdditionalValueFromDataFile(dexID) - End If - If Localization.TokenExists("pokemon_desc_" & dexID) = True Then - DexEntryText = Localization.GetString("pokemon_desc_" & dexID, p.PokedexEntry.Text) - End If + If Localization.TokenExists("pokemon_desc_" & FormName) = True Then + DexEntryText = Localization.GetString("pokemon_desc_" & FormName, p.PokedexEntry.Text) End If Core.SpriteBatch.DrawString(FontManager.MainFont, DexEntryText.CropStringToWidth(FontManager.MainFont, 448), New Vector2(688, 490), Color.Black) @@ -1779,25 +1768,24 @@ Public Class PokedexViewScreen If EntryType > 1 Then Dim DexEntryText As String = Pokemon.PokedexEntry.Text Dim DexEntrySpecies As String = Pokemon.PokedexEntry.Species - If Localization.LanguageSuffix <> "en" Then - Dim dexID As String = PokemonForms.GetPokemonDataFileName(Pokemon.Number, Pokemon.AdditionalData, True) - Dim dexEntryID As String = dexID - Dim idValue As Integer = CInt(dexID.GetSplit(0, ",").GetSplit(0, "_").GetSplit(0, ";")) - Dim adValue As String = "" - If dexID.Contains(";") Then - If Pokemon.PokemonDataExists(dexEntryID) = False Then - dexEntryID = dexEntryID.GetSplit(0, ";") - End If - adValue = dexID.GetSplit(1, ";") - ElseIf dexID.Contains("_") Then - adValue = PokemonForms.GetAdditionalValueFromDataFile(dexID) - End If - If Localization.TokenExists("pokemon_desc_" & dexID) = True Then - DexEntryText = Localization.GetString("pokemon_desc_" & dexID, Pokemon.PokedexEntry.Text) - End If - If Localization.LanguageSuffix <> "en" AndAlso Localization.TokenExists("pokemon_species_" & dexID) = True Then - DexEntrySpecies = Localization.GetString("pokemon_species_" & dexID, Pokemon.PokedexEntry.Species) + + Dim dexID As String = PokemonForms.GetPokemonDataFileName(Pokemon.Number, Pokemon.AdditionalData, True) + Dim dexEntryID As String = dexID + Dim idValue As Integer = CInt(dexID.GetSplit(0, ",").GetSplit(0, "_").GetSplit(0, ";")) + Dim adValue As String = "" + If dexID.Contains(";") Then + If Pokemon.PokemonDataExists(dexEntryID) = False Then + dexEntryID = dexEntryID.GetSplit(0, ";") End If + adValue = dexID.GetSplit(1, ";") + ElseIf dexID.Contains("_") Then + adValue = PokemonForms.GetAdditionalValueFromDataFile(dexID) + End If + If Localization.TokenExists("pokemon_desc_" & dexID) = True Then + DexEntryText = Localization.GetString("pokemon_desc_" & dexID, Pokemon.PokedexEntry.Text) + End If + If Localization.TokenExists("pokemon_species_" & dexID) = True Then + DexEntrySpecies = Localization.GetString("pokemon_species_" & dexID, Pokemon.PokedexEntry.Species) End If Core.SpriteBatch.DrawString(FontManager.MainFont, Pokemon.PokedexEntry.Height & " m", New Vector2(CInt(mV.X + 250), CInt(mV.Y - 152)), Color.Black) diff --git a/P3D/World/ActionScript/V2/ScriptConstructs/DoPokedex.vb b/P3D/World/ActionScript/V2/ScriptConstructs/DoPokedex.vb index b6664338e..483dd7bed 100644 --- a/P3D/World/ActionScript/V2/ScriptConstructs/DoPokedex.vb +++ b/P3D/World/ActionScript/V2/ScriptConstructs/DoPokedex.vb @@ -69,8 +69,11 @@ End If If Pokemon.PokemonDataExists(dexID) Then - If Localization.LanguageSuffix <> "en" AndAlso Localization.TokenExists("pokemon_desc_" & dexID) = True Then - Return Localization.GetString("pokemon_desc_" & dexID, Pokemon.GetPokemonByID(id, ad).PokedexEntry.Text) + Dim p As Pokemon = Pokemon.GetPokemonByID(id, ad) + Dim FormName As String = PokemonForms.GetFormName(p) + + If Localization.LanguageSuffix <> "en" AndAlso Localization.TokenExists("pokemon_desc_" & FormName) = True Then + Return Localization.GetString("pokemon_desc_" & FormName, Pokemon.GetPokemonByID(id, ad).PokedexEntry.Text) Else Return Pokemon.GetPokemonByID(id, ad).PokedexEntry.Text End If