From 477afa142bf819b1f96cb29509e89d7a3e07aecf Mon Sep 17 00:00:00 2001 From: Bas Antonius de Jong <49651652+BAFGdeJong@users.noreply.github.com> Date: Thu, 2 Oct 2025 19:25:21 +0200 Subject: [PATCH 1/4] UI (#106) * added localization options //todo add all the strings * broken push * merge to UI * broken push * Alpha rebase complete, added asset loader for UI branch * merge to UI * UI now uses assetmanager * added NL and EN for all strings currently in UI * fix small merge error * Removed no more needed files. * JDK25 * Removed files no longer in use * Removed need for manual typecast * Added ability to load in BundledResource for localization * Docs and easy font loading. Added interfaces for PreloadResource's * added German, French, Spanish, Italian and Mandarin Chinese --------- Co-authored-by: Ticho Hidding Co-authored-by: ramollia <@> --- .idea/misc.xml | 2 +- .idea/resourceBundles.xml | 15 ++++++++++ app/src/main/java/org/toop/app/App.java | 1 - .../main/java/org/toop/app/menu/MainMenu.java | 3 +- .../main/resources/Localization.properties | 17 ----------- .../main/resources/Localization_nl.properties | 17 ----------- .../localization/localization.properties | 4 +-- .../localization/localization_de.properties | 17 +++++++++++ .../localization/localization_es.properties | 17 +++++++++++ .../localization/localization_fr.properties | 17 +++++++++++ .../localization/localization_it.properties | 17 +++++++++++ .../localization/localization_zh.properties | 30 +++++++++++++++++++ .../org/toop/framework/asset/AssetLoader.java | 3 +- .../toop/framework/asset/AssetManager.java | 2 +- 14 files changed, 121 insertions(+), 41 deletions(-) create mode 100644 .idea/resourceBundles.xml delete mode 100644 app/src/main/resources/Localization.properties delete mode 100644 app/src/main/resources/Localization_nl.properties create mode 100644 app/src/main/resources/assets/localization/localization_de.properties create mode 100644 app/src/main/resources/assets/localization/localization_es.properties create mode 100644 app/src/main/resources/assets/localization/localization_fr.properties create mode 100644 app/src/main/resources/assets/localization/localization_it.properties create mode 100644 app/src/main/resources/assets/localization/localization_zh.properties diff --git a/.idea/misc.xml b/.idea/misc.xml index 72be14a..64c32f6 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -13,7 +13,7 @@ - + \ No newline at end of file diff --git a/.idea/resourceBundles.xml b/.idea/resourceBundles.xml new file mode 100644 index 0000000..362dcdf --- /dev/null +++ b/.idea/resourceBundles.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + localization + + + \ No newline at end of file diff --git a/app/src/main/java/org/toop/app/App.java b/app/src/main/java/org/toop/app/App.java index 051cdfc..0602577 100644 --- a/app/src/main/java/org/toop/app/App.java +++ b/app/src/main/java/org/toop/app/App.java @@ -10,7 +10,6 @@ import javafx.scene.Scene; import javafx.stage.Stage; import org.toop.framework.asset.AssetManager; import org.toop.framework.asset.resources.LocalizationAsset; -import org.toop.framework.audio.SoundManager; import org.toop.framework.audio.events.AudioEvents; import org.toop.framework.eventbus.EventFlow; import org.toop.local.AppContext; diff --git a/app/src/main/java/org/toop/app/menu/MainMenu.java b/app/src/main/java/org/toop/app/menu/MainMenu.java index 7d1d2d0..68f58a6 100644 --- a/app/src/main/java/org/toop/app/menu/MainMenu.java +++ b/app/src/main/java/org/toop/app/menu/MainMenu.java @@ -12,9 +12,10 @@ import java.util.Locale; import org.toop.framework.asset.AssetManager; import org.toop.framework.asset.resources.CssAsset; import org.toop.framework.asset.resources.ImageAsset; +import org.toop.local.AppContext; public final class MainMenu extends Menu { - private final Locale currentLocale = Locale.of("nl"); + private final Locale currentLocale = AppContext.getLocale(); private final LocalizationAsset loc = AssetManager.get("localization.properties"); public MainMenu() { diff --git a/app/src/main/resources/Localization.properties b/app/src/main/resources/Localization.properties deleted file mode 100644 index 9718bf0..0000000 --- a/app/src/main/resources/Localization.properties +++ /dev/null @@ -1,17 +0,0 @@ -# Window title -windowTitle=ISY Games Selector - -# Main Menu buttons -mainMenuSelectTicTacToe=Tic Tac Toe -mainMenuSelectReversi=Reversi -mainMenuSelectSudoku=Sudoku -mainMenuSelectBattleship=Battleship -mainMenuSelectOther=Other -mainMenuSelectCredits=Credits -mainMenuSelectOptions=Options -mainMenuSelectQuit=Quit - -# Quit Menu text and buttons -quitMenuTextSure=Are you sure? -quitMenuButtonYes=Yes -quitMenuButtonNo=No \ No newline at end of file diff --git a/app/src/main/resources/Localization_nl.properties b/app/src/main/resources/Localization_nl.properties deleted file mode 100644 index 4c3eb30..0000000 --- a/app/src/main/resources/Localization_nl.properties +++ /dev/null @@ -1,17 +0,0 @@ -# Window title -windowTitle=ISY Spellen Kiezer - -# Main Menu buttons -mainMenuSelectTicTacToe=Boter Kaas En Eieren -mainMenuSelectReversi=Reversi -mainMenuSelectSudoku=Sudoku -mainMenuSelectBattleship=Zeeslag -mainMenuSelectOther=Anders -mainMenuSelectCredits=Credits -mainMenuSelectOptions=Opties -mainMenuSelectQuit=Afsluiten - -# Quit Menu text and buttons -quitMenuTextSure=Weet je het zeker? -quitMenuButtonYes=Ja -quitMenuButtonNo=Nee \ No newline at end of file diff --git a/app/src/main/resources/assets/localization/localization.properties b/app/src/main/resources/assets/localization/localization.properties index 9718bf0..fcbc8ac 100644 --- a/app/src/main/resources/assets/localization/localization.properties +++ b/app/src/main/resources/assets/localization/localization.properties @@ -2,8 +2,8 @@ windowTitle=ISY Games Selector # Main Menu buttons -mainMenuSelectTicTacToe=Tic Tac Toe -mainMenuSelectReversi=Reversi +mainMenuSelectTicTacToe=Tic Tac Toe\u5426 +mainMenuSelectReversi=Reversi\u5426 mainMenuSelectSudoku=Sudoku mainMenuSelectBattleship=Battleship mainMenuSelectOther=Other diff --git a/app/src/main/resources/assets/localization/localization_de.properties b/app/src/main/resources/assets/localization/localization_de.properties new file mode 100644 index 0000000..dc46278 --- /dev/null +++ b/app/src/main/resources/assets/localization/localization_de.properties @@ -0,0 +1,17 @@ +# Window title +windowTitle=ISY Spiele-Auswahl + +# Main Menu buttons +mainMenuSelectTicTacToe=Tic Tac Toe +mainMenuSelectReversi=Reversi +mainMenuSelectSudoku=Sudoku +mainMenuSelectBattleship=Flottenman\u00F6ver +mainMenuSelectOther=Andere +mainMenuSelectCredits=Credits +mainMenuSelectOptions=Optionen +mainMenuSelectQuit=Beenden + +# Quit Menu text and buttons +quitMenuTextSure=Bist du sicher? +quitMenuButtonYes=Ja +quitMenuButtonNo=Nein \ No newline at end of file diff --git a/app/src/main/resources/assets/localization/localization_es.properties b/app/src/main/resources/assets/localization/localization_es.properties new file mode 100644 index 0000000..60439ab --- /dev/null +++ b/app/src/main/resources/assets/localization/localization_es.properties @@ -0,0 +1,17 @@ +# Window title +windowTitle=Selector de juegos ISY + +# Main Menu buttons +mainMenuSelectTicTacToe=Tres en raya +mainMenuSelectReversi=Reversi +mainMenuSelectSudoku=Sudoku +mainMenuSelectBattleship=Batalla naval +mainMenuSelectOther=Otros +mainMenuSelectCredits=Cr\u00E9ditos +mainMenuSelectOptions=Opciones +mainMenuSelectQuit=Salir + +# Quit Menu text and buttons +quitMenuTextSure=\u00BFEst\u00E1s seguro? +quitMenuButtonYes=S\u00ED +quitMenuButtonNo=No \ No newline at end of file diff --git a/app/src/main/resources/assets/localization/localization_fr.properties b/app/src/main/resources/assets/localization/localization_fr.properties new file mode 100644 index 0000000..75d9f4a --- /dev/null +++ b/app/src/main/resources/assets/localization/localization_fr.properties @@ -0,0 +1,17 @@ +# Window title +windowTitle=S\u00E9lecteur de jeux ISY + +# Main Menu buttons +mainMenuSelectTicTacToe=Morpion +mainMenuSelectReversi=Reversi +mainMenuSelectSudoku=Sudoku +mainMenuSelectBattleship=Bataille navale +mainMenuSelectOther=Autres +mainMenuSelectCredits=Cr\u00E9dits +mainMenuSelectOptions=Options +mainMenuSelectQuit=Quitter + +# Quit Menu text and buttons +quitMenuTextSure=\u00CAtes-vous s\u00FBr? +quitMenuButtonYes=Oui +quitMenuButtonNo=Non \ No newline at end of file diff --git a/app/src/main/resources/assets/localization/localization_it.properties b/app/src/main/resources/assets/localization/localization_it.properties new file mode 100644 index 0000000..75a8896 --- /dev/null +++ b/app/src/main/resources/assets/localization/localization_it.properties @@ -0,0 +1,17 @@ +# Window title +windowTitle=Selettore giochi ISY + +# Main Menu buttons +mainMenuSelectTicTacToe=Tris +mainMenuSelectReversi=Reversi +mainMenuSelectSudoku=Sudoku +mainMenuSelectBattleship=Battaglia navale +mainMenuSelectOther=Altro +mainMenuSelectCredits=Crediti +mainMenuSelectOptions=Opzioni +mainMenuSelectQuit=Esci + +# Quit Menu text and buttons +quitMenuTextSure=Sei sicuro? +quitMenuButtonYes=S\u00EC +quitMenuButtonNo=No \ No newline at end of file diff --git a/app/src/main/resources/assets/localization/localization_zh.properties b/app/src/main/resources/assets/localization/localization_zh.properties new file mode 100644 index 0000000..f703670 --- /dev/null +++ b/app/src/main/resources/assets/localization/localization_zh.properties @@ -0,0 +1,30 @@ +# suppress inspection "LossyEncoding" for whole file +# Window title +windowTitle=ISY \u6E38\u620F\u9009\u62E9\u5668 +# ????? + +# Main Menu buttons +mainMenuSelectTicTacToe=\u4E95\u5B57\u68CB +# ??? +mainMenuSelectReversi=\u9ED1\u767D\u68CB +# ??? +mainMenuSelectSudoku=\u6570\u72EC +# ?? +mainMenuSelectBattleship=\u6D77\u6218\u68CB +# ??? +mainMenuSelectOther=\u5176\u4ED6 +# ?? +mainMenuSelectCredits=\u5236\u4F5C\u4EBA\u5458 +# ???? +mainMenuSelectOptions=\u9009\u9879 +# ?? +mainMenuSelectQuit=\u9000\u51FA +# ?? + +# Quit Menu text and buttons +quitMenuTextSure=\u4F60\u786E\u5B9A\u5417\uFF1F +# ????? +quitMenuButtonYes=\u662F +# ? +quitMenuButtonNo=\u5426 +# ? \ No newline at end of file diff --git a/framework/src/main/java/org/toop/framework/asset/AssetLoader.java b/framework/src/main/java/org/toop/framework/asset/AssetLoader.java index bec2c97..93ac189 100644 --- a/framework/src/main/java/org/toop/framework/asset/AssetLoader.java +++ b/framework/src/main/java/org/toop/framework/asset/AssetLoader.java @@ -144,6 +144,7 @@ public class AssetLoader { "File " + file.getName() + " is not of type " + type.getSimpleName() ); } + return type.cast(resource); } @@ -242,4 +243,4 @@ public class AssetLoader { int i = name.lastIndexOf('.'); return (i > 0) ? name.substring(i + 1) : ""; } -} \ No newline at end of file +} diff --git a/framework/src/main/java/org/toop/framework/asset/AssetManager.java b/framework/src/main/java/org/toop/framework/asset/AssetManager.java index f10d507..1630ae0 100644 --- a/framework/src/main/java/org/toop/framework/asset/AssetManager.java +++ b/framework/src/main/java/org/toop/framework/asset/AssetManager.java @@ -147,4 +147,4 @@ public class AssetManager { public static void addAsset(Asset asset) { assets.put(asset.getName(), asset); } -} \ No newline at end of file +} From a6bd2495ab9a300ebac6dc7037596d93a01b2132 Mon Sep 17 00:00:00 2001 From: Bas Antonius de Jong <49651652+BAFGdeJong@users.noreply.github.com> Date: Thu, 2 Oct 2025 19:34:10 +0200 Subject: [PATCH 2/4] UI (#107) * added localization options //todo add all the strings * broken push * merge to UI * broken push * Alpha rebase complete, added asset loader for UI branch * merge to UI * UI now uses assetmanager * added NL and EN for all strings currently in UI * fix small merge error * Removed no more needed files. * JDK25 * Removed files no longer in use * Removed need for manual typecast * Added ability to load in BundledResource for localization * Docs and easy font loading. Added interfaces for PreloadResource's * added German, French, Spanish, Italian and Mandarin Chinese --------- Co-authored-by: Ticho Hidding Co-authored-by: ramollia <@> From ef550f353da6093c9d652b692b2680f24e15ca19 Mon Sep 17 00:00:00 2001 From: lieght <49651652+BAFGdeJong@users.noreply.github.com> Date: Thu, 2 Oct 2025 22:07:51 +0200 Subject: [PATCH 3/4] Pom fixes --- app/pom.xml | 3 ++- pom.xml | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/app/pom.xml b/app/pom.xml index 3f06d12..f8a54cf 100644 --- a/app/pom.xml +++ b/app/pom.xml @@ -9,7 +9,7 @@ org.toop.Main 25 25 - + 25 UTF-8 @@ -68,6 +68,7 @@ org.toop.Main + pism diff --git a/pom.xml b/pom.xml index f74eba6..a6c34cf 100644 --- a/pom.xml +++ b/pom.xml @@ -107,18 +107,18 @@ - - org.apache.maven.plugins - maven-compiler-plugin - 3.14.1 - - ${project.build.directory}/custom - 25 - 25 - 25 - UTF-8 - - + + + + + + + + + + + + From e48df5df1595c482457bd828ee8b750d0b8efbb2 Mon Sep 17 00:00:00 2001 From: lieght <49651652+BAFGdeJong@users.noreply.github.com> Date: Fri, 3 Oct 2025 00:58:57 +0200 Subject: [PATCH 4/4] More gitignore --- .gitignore | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b561d9a..592a652 100644 --- a/.gitignore +++ b/.gitignore @@ -47,6 +47,7 @@ shelf/ *.iml *.ipr *.iws +misc.xml ############################## ## Eclipse @@ -101,4 +102,9 @@ build newgamesver-release-V1.jar server.properties gameserver.log.* -gameserver.log \ No newline at end of file +gameserver.log + +############################## +## JPackage +############################## +jpackage-input \ No newline at end of file