From 667fab564f532b440d6121830734b4ae9e76f9da Mon Sep 17 00:00:00 2001 From: JappaWakka Date: Thu, 22 May 2025 19:12:36 +0200 Subject: [PATCH] Make GameMode Names & Desc's Translatable --- P3D/Content/Localization/Tokens_de.dat | 2 ++ P3D/Content/Localization/Tokens_en.dat | 2 ++ P3D/Content/Localization/Tokens_es.dat | 2 ++ P3D/Content/Localization/Tokens_fr.dat | 2 ++ P3D/Content/Localization/Tokens_nl.dat | 2 ++ P3D/Content/Localization/Tokens_pl.dat | 2 ++ P3D/Content/Localization/Tokens_ptbr.dat | 2 ++ P3D/Resources/GameModeManager.vb | 4 +-- P3D/Screens/MainMenu/PressStartScreen.vb | 35 +++++++++++++++++++++--- 9 files changed, 47 insertions(+), 6 deletions(-) diff --git a/P3D/Content/Localization/Tokens_de.dat b/P3D/Content/Localization/Tokens_de.dat index 8c8c68e43..85c5f3347 100644 --- a/P3D/Content/Localization/Tokens_de.dat +++ b/P3D/Content/Localization/Tokens_de.dat @@ -243,6 +243,8 @@ gamemode_menu_author,Entwickler gamemode_menu_contentpath,ContentPath gamemode_menu_create,Create gamemode_menu_back,Back +gamemode_name_Kolben,Pokémon 3D +gamemode_desc_Kolben,The normal GameMode. --- JoinServerScreen: join_server_screen_title,Trete einem Server bei: diff --git a/P3D/Content/Localization/Tokens_en.dat b/P3D/Content/Localization/Tokens_en.dat index 1ec520122..f89198009 100644 --- a/P3D/Content/Localization/Tokens_en.dat +++ b/P3D/Content/Localization/Tokens_en.dat @@ -244,6 +244,8 @@ gamemode_menu_author,Author gamemode_menu_contentpath,ContentPath gamemode_menu_create,Create gamemode_menu_back,Back +gamemode_name_Kolben,Pokémon 3D +gamemode_desc_Kolben,The normal GameMode. --- JoinServerScreen: join_server_screen_title,Join a server: diff --git a/P3D/Content/Localization/Tokens_es.dat b/P3D/Content/Localization/Tokens_es.dat index 0f2814a31..e6ef168c8 100644 --- a/P3D/Content/Localization/Tokens_es.dat +++ b/P3D/Content/Localization/Tokens_es.dat @@ -245,6 +245,8 @@ gamemode_menu_author,Autor gamemode_menu_contentpath,Ruta de contenido gamemode_menu_create,Crear gamemode_menu_back,Volver +gamemode_name_Kolben,Pokémon 3D +gamemode_desc_Kolben,The normal GameMode. --- JoinServerScreen: join_server_screen_title,Join a server: diff --git a/P3D/Content/Localization/Tokens_fr.dat b/P3D/Content/Localization/Tokens_fr.dat index 9f50c6293..117baca4e 100644 --- a/P3D/Content/Localization/Tokens_fr.dat +++ b/P3D/Content/Localization/Tokens_fr.dat @@ -242,6 +242,8 @@ gamemode_menu_author,Autheur gamemode_menu_contentpath,ContentPath gamemode_menu_create,Créer gamemode_menu_back,Retour +gamemode_name_Kolben,Pokémon 3D +gamemode_desc_Kolben,The normal GameMode. --- JoinServerScreen: join_server_screen_title,Serveurs: diff --git a/P3D/Content/Localization/Tokens_nl.dat b/P3D/Content/Localization/Tokens_nl.dat index 727af5142..828651399 100644 --- a/P3D/Content/Localization/Tokens_nl.dat +++ b/P3D/Content/Localization/Tokens_nl.dat @@ -232,6 +232,8 @@ gamemode_menu_author,Auteur gamemode_menu_contentpath,Inhoudspad gamemode_menu_create,Creëer gamemode_menu_back,Terug +gamemode_name_Kolben,Pokémon 3D +gamemode_desc_Kolben,De gebruikelijke SpelModus. --- JoinServerScreen: join_server_screen_title,Verbind met een server: diff --git a/P3D/Content/Localization/Tokens_pl.dat b/P3D/Content/Localization/Tokens_pl.dat index 06979e854..a6c8e6f6c 100644 --- a/P3D/Content/Localization/Tokens_pl.dat +++ b/P3D/Content/Localization/Tokens_pl.dat @@ -244,6 +244,8 @@ gamemode_menu_author,Autor gamemode_menu_contentpath,Ścieżka do treści gamemode_menu_create,Utwórz gamemode_menu_back,Wróć +gamemode_name_Kolben,Pokémon 3D +gamemode_desc_Kolben,The normal GameMode. --- JoinServerScreen: join_server_screen_title,Join a server: diff --git a/P3D/Content/Localization/Tokens_ptbr.dat b/P3D/Content/Localization/Tokens_ptbr.dat index bb6d121f2..60b1ed1ba 100644 --- a/P3D/Content/Localization/Tokens_ptbr.dat +++ b/P3D/Content/Localization/Tokens_ptbr.dat @@ -242,6 +242,8 @@ gamemode_menu_author,Autor gamemode_menu_contentpath,Local do Conteúdo gamemode_menu_create,Criar gamemode_menu_back,Voltar +gamemode_name_Kolben,Pokémon 3D +gamemode_desc_Kolben,The normal GameMode. --- JoinServerScreen: join_server_screen_title,Entre em um Servidor: diff --git a/P3D/Resources/GameModeManager.vb b/P3D/Resources/GameModeManager.vb index d45aa5a45..dcf4115eb 100644 --- a/P3D/Resources/GameModeManager.vb +++ b/P3D/Resources/GameModeManager.vb @@ -621,7 +621,7 @@ Public Class GameMode End Sub ''' - ''' Returns the default Kolben Game Mode. + ''' Returns the default Kolben GameMode. ''' Public Shared Function GetKolbenGameMode() As GameMode Dim SkinColors As List(Of Color) = {New Color(248, 176, 32), New Color(248, 216, 88), New Color(56, 88, 200), New Color(216, 96, 112), New Color(56, 88, 152), New Color(239, 90, 156)}.ToList() @@ -629,7 +629,7 @@ Public Class GameMode Dim SkinNames As List(Of String) = {"Ethan", "Lyra", "Nate", "Rosa", "Hilbert", "Hilda"}.ToList() Dim SkinGenders As List(Of String) = {"Male", "Female", "Male", "Female", "Male", "Female"}.ToList() - Dim gameMode As New GameMode("Kolben", "The normal game mode.", GameController.GAMEVERSION, "Kolben Games", "\Content\Data\maps\", "\Content\Data\Scripts\", "\Content\Data\maps\poke\", "\Content\Pokemon\Data\", "\Content\", "\Content\Localization\", New List(Of GameRule), New List(Of GameRule), New List(Of GameRule), + Dim gameMode As New GameMode("Kolben", "The normal GameMode.", GameController.GAMEVERSION, "Kolben Games", "\Content\Data\maps\", "\Content\Data\Scripts\", "\Content\Data\maps\poke\", "\Content\Pokemon\Data\", "\Content\", "\Content\Localization\", New List(Of GameRule), New List(Of GameRule), New List(Of GameRule), "newgame\intro0.dat", New Vector3(1.0F, 0.1F, 3.0F), MathHelper.PiOver2, "Your Room", "", New Color(59, 123, 165), "0", "welcome", "1", SkinColors, SkinFiles, SkinNames, SkinGenders, 8) gameMode.StartScript = "startscript\main" diff --git a/P3D/Screens/MainMenu/PressStartScreen.vb b/P3D/Screens/MainMenu/PressStartScreen.vb index d12f03576..3eae10619 100644 --- a/P3D/Screens/MainMenu/PressStartScreen.vb +++ b/P3D/Screens/MainMenu/PressStartScreen.vb @@ -985,14 +985,26 @@ Public Class NewMainMenuScreen For i = 0 To tmpProfile.PokemonTextures.Count - 1 SpriteBatch.Draw(tmpProfile.PokemonTextures(i), New Rectangle(displayRect.X + 30 + i * 70, displayRect.Y + 70, 64, 64), Color.White) Next + Dim GameModeNameString As String = GameModeManager.GetGameMode(tmpProfile.GameMode).Name + If Localization.TokenExists("gamemode_name_" & GameModeManager.GetGameMode(tmpProfile.GameMode).DirectoryName) = True Then + GameModeNameString = Localization.GetString("gamemode_name_" & GameModeManager.GetGameMode(tmpProfile.GameMode).DirectoryName) + ElseIf Localization.TokenExists(("gamemode_name_" & GameModeManager.GetGameMode(tmpProfile.GameMode).DirectoryName).ToLower) = True Then + GameModeNameString = Localization.GetString(("gamemode_name_" & GameModeManager.GetGameMode(tmpProfile.GameMode).DirectoryName).ToLower) + End If GetFontRenderer().DrawString(FontManager.InGameFont, Localization.GetString("global_player_name", "Player Name") & ": " & tmpProfile.Name & Environment.NewLine & - Localization.GetString("global_gamemode", "GameMode") & ": " & GameModeManager.GetGameMode(tmpProfile.GameMode).Name, New Vector2(displayRect.X + 30, displayRect.Y + 20), Color.White, 0F, Vector2.Zero, 1.0F, SpriteEffects.None, 0F) + Localization.GetString("global_gamemode", "GameMode") & ": " & Localization.GetString(GameModeNameString), New Vector2(displayRect.X + 30, displayRect.Y + 20), Color.White, 0F, Vector2.Zero, 1.0F, SpriteEffects.None, 0F) GetFontRenderer().DrawString(FontManager.InGameFont, Localization.GetString("global_badges", "Badges") & ": " & tmpProfile.Badges.ToString() & Environment.NewLine & Localization.GetString("global_play_time", "Play Time") & ": " & tmpProfile.TimePlayed & Environment.NewLine & Localization.GetString("global_location", "Location") & ": " & Localization.GetString("Places_" & tmpProfile.Location, tmpProfile.Location), New Vector2(displayRect.X + 30, displayRect.Y + 150), Color.White, 0F, Vector2.Zero, 1.0F, SpriteEffects.None, 0F) Else + Dim GameModeNameString As String = tmpProfile.GameMode + If Localization.TokenExists("gamemode_name_" & tmpProfile.GameMode) = True Then + GameModeNameString = Localization.GetString("gamemode_name_" & tmpProfile.GameMode) + ElseIf Localization.TokenExists(("gamemode_name_" & tmpProfile.GameMode).ToLower) = True Then + GameModeNameString = Localization.GetString(("gamemode_name_" & tmpProfile.GameMode).ToLower) + End If GetFontRenderer().DrawString(FontManager.InGameFont, Localization.GetString("global_player_name", "Player Name") & ": " & tmpProfile.Name & Environment.NewLine & - Localization.GetString("global_gamemode", "GameMode") & ": " & tmpProfile.GameMode, New Vector2(displayRect.X + 30, displayRect.Y + 20), Color.White, 0F, Vector2.Zero, 1.0F, SpriteEffects.None, 0F) + Localization.GetString("global_gamemode", "GameMode") & ": " & Localization.GetString(GameModeNameString), New Vector2(displayRect.X + 30, displayRect.Y + 20), Color.White, 0F, Vector2.Zero, 1.0F, SpriteEffects.None, 0F) SpriteBatch.Draw(_menuTexture, New Rectangle(displayRect.X + 30, displayRect.Y + 70, 32, 32), New Rectangle(0, 32, 32, 32), Color.White) Dim errorText As String @@ -1684,11 +1696,26 @@ Public Class GameModeSelectionScreen If tempGameModesDisplay = "" Then Dim GameMode As GameMode = GameModeManager.GetGameMode(_gameModes(_index).DirectoryName) - Dim dispName As String = GameMode.Name + Dim GameModeNameString As String = GameMode.Name + If Localization.TokenExists("gamemode_name_" & GameMode.DirectoryName) = True Then + GameModeNameString = Localization.GetString("gamemode_name_" & GameMode.DirectoryName) + ElseIf Localization.TokenExists(("gamemode_name_" & GameMode.DirectoryName).ToLower) = True Then + GameModeNameString = Localization.GetString(("gamemode_name_" & GameMode.DirectoryName).ToLower) + End If + + Dim dispName As String = GameModeNameString If dispName = "Kolben" Then dispName = "Pokémon 3D" End If - Dim dispDescription As String = GameMode.Description.Replace("~", Environment.NewLine).Replace("*", Environment.NewLine) + + Dim GameModeDescriptionString As String = GameMode.Description + If Localization.TokenExists("gamemode_desc_" & GameMode.DirectoryName) = True Then + GameModeDescriptionString = Localization.GetString("gamemode_desc_" & GameMode.DirectoryName) + ElseIf Localization.TokenExists(("gamemode_desc_" & GameMode.DirectoryName).ToLower) = True Then + GameModeDescriptionString = Localization.GetString(("gamemode_desc_" & GameMode.DirectoryName).ToLower) + End If + + Dim dispDescription As String = GameModeDescriptionString.Replace("~", Environment.NewLine).Replace("*", Environment.NewLine) Dim dispVersion As String = GameMode.Version Dim dispAuthor As String = GameMode.Author