From 354e2876e93bf45ca6b748e9eb23093fe9bffaa6 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Fri, 25 Oct 2024 12:16:44 +0500 Subject: feat: LocalizationManager + removed unused lines and classes --- core/src/kz/ilotterytea/maxon/MaxonGame.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'core/src/kz/ilotterytea/maxon/MaxonGame.java') diff --git a/core/src/kz/ilotterytea/maxon/MaxonGame.java b/core/src/kz/ilotterytea/maxon/MaxonGame.java index f457270..2dbe324 100644 --- a/core/src/kz/ilotterytea/maxon/MaxonGame.java +++ b/core/src/kz/ilotterytea/maxon/MaxonGame.java @@ -6,18 +6,18 @@ import com.badlogic.gdx.Preferences; import com.badlogic.gdx.assets.AssetManager; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.glutils.ShapeRenderer; +import kz.ilotterytea.maxon.localization.LocalizationManager; import kz.ilotterytea.maxon.pets.PetManager; import kz.ilotterytea.maxon.screens.SplashScreen; import kz.ilotterytea.maxon.utils.GameUpdater; -import kz.ilotterytea.maxon.utils.I18N; public class MaxonGame extends Game { public SpriteBatch batch; public ShapeRenderer shapeRenderer; public AssetManager assetManager; public Preferences prefs; - public I18N locale; + private LocalizationManager locale; private PetManager petManager; private static MaxonGame instance; @@ -33,6 +33,14 @@ public class MaxonGame extends Game { return petManager; } + public LocalizationManager getLocale() { + return locale; + } + + public void setLocale(LocalizationManager locale) { + this.locale = locale; + } + @Override public void create () { // Check the latest version @@ -41,7 +49,7 @@ public class MaxonGame extends Game { batch = new SpriteBatch(); shapeRenderer = new ShapeRenderer(); prefs = Gdx.app.getPreferences(MaxonConstants.GAME_APP_PACKAGE); - locale = new I18N(Gdx.files.internal("i18n/" + prefs.getString("lang", "en_us") + ".json")); + locale = new LocalizationManager(Gdx.files.internal("i18n/" + prefs.getString("lang", "en_us") + ".json")); Gdx.graphics.setVSync(prefs.getBoolean("vsync", true)); -- cgit v1.2.3