summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--assets/i18n/en_us.json5
-rw-r--r--assets/i18n/ru_ru.json5
-rw-r--r--assets/sprites/gui/ui.skin18
-rw-r--r--build.gradle3
-rw-r--r--core/src/kz/ilotterytea/maxon/MaxonGame.java7
-rw-r--r--core/src/kz/ilotterytea/maxon/screens/MenuScreen.java41
6 files changed, 35 insertions, 44 deletions
diff --git a/assets/i18n/en_us.json b/assets/i18n/en_us.json
index 239169c..9be139d 100644
--- a/assets/i18n/en_us.json
+++ b/assets/i18n/en_us.json
@@ -1,8 +1,5 @@
{
- "updater.title": "You're playing an outdated version...",
- "updater.message": "There's a new update out! Want to see it?",
- "updater.no": "n-no",
- "updater.yes": "YES!!",
+ "updater.info": "A new update is available!",
"debug.version": "%s (LibGDX %s, Java %s)",
"debug.c_fps": "%s FPS",
diff --git a/assets/i18n/ru_ru.json b/assets/i18n/ru_ru.json
index 7451d97..ff70cd3 100644
--- a/assets/i18n/ru_ru.json
+++ b/assets/i18n/ru_ru.json
@@ -1,8 +1,5 @@
{
- "updater.title": "Ты играешь в устаревшую версию...",
- "updater.message": "Вышло новое обновление! Хочешь посмотреть?",
- "updater.no": "н-нет",
- "updater.yes": "ДААА!!",
+ "updater.info": "Доступно новое обновление!",
"debug.version": "%s (LibGDX %s, Java %s)",
"debug.c_fps": "%s FPS",
diff --git a/assets/sprites/gui/ui.skin b/assets/sprites/gui/ui.skin
index 979a0f1..2004b30 100644
--- a/assets/sprites/gui/ui.skin
+++ b/assets/sprites/gui/ui.skin
@@ -5,7 +5,10 @@
store_item_hover: { hex: "#ffffffff" },
store_item_disabled: { hex: "#888888ff" },
store_item_price_available: { hex: "#00ff00ff" },
- store_item_price_disabled: { hex: "#ff0000ff" }
+ store_item_price_disabled: { hex: "#ff0000ff" },
+
+ orange: {hex: "#ffa300ff" },
+ yellow: {hex: "#ffec27ff" },
},
com.badlogic.gdx.scenes.scene2d.ui.Skin$TintedDrawable: {
button_pressed: { color: { hex: "#ad6235ff" }, name: pressed },
@@ -32,6 +35,10 @@
file: fnt/FontText.fnt,
scaledSize: 24
},
+ small: {
+ file: fnt/FontText.fnt,
+ scaledSize: 18
+ },
store_item_name: {
file: fnt/FontText.fnt,
scaledSize: 19
@@ -65,7 +72,14 @@
store_control: {
parent: default,
font: store_control
- }
+ },
+ link: {
+ font: small,
+ fontColor: yellow,
+ overFontColor: orange,
+ focusedFontColor: orange,
+ downFontColor: orange
+ },
},
com.badlogic.gdx.scenes.scene2d.ui.Label$LabelStyle: {
default: {
diff --git a/build.gradle b/build.gradle
index d1f997e..c6c5f92 100644
--- a/build.gradle
+++ b/build.gradle
@@ -66,7 +66,6 @@ project(":desktop") {
api "com.badlogicgames.gdx-controllers:gdx-controllers-desktop:$gdxControllersVersion"
api "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop"
api "de.golfgl.gdxgamesvcs:gdx-gamesvcs-core-gamejolt:1.1.0"
- api "de.tomgrill.gdxdialogs:gdx-dialogs-desktop:1.3.0"
}
}
@@ -85,7 +84,6 @@ project(":android") {
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64"
api "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
- implementation "de.tomgrill.gdxdialogs:gdx-dialogs-android:1.3.0"
}
}
@@ -101,7 +99,6 @@ project(":core") {
api "com.badlogicgames.gdx:gdx-ai:$aiVersion"
api "com.badlogicgames.ashley:ashley:$ashleyVersion"
api "de.golfgl.gdxgamesvcs:gdx-gamesvcs-core:1.1.0"
- api "de.tomgrill.gdxdialogs:gdx-dialogs-core:1.3.0"
api "com.rafaskoberg.gdx:typing-label:$typingLabelVersion"
api "com.github.mgsx-dev.gdx-gltf:gltf:$gltfVersion"
implementation 'com.google.code.gson:gson:2.9.1'
diff --git a/core/src/kz/ilotterytea/maxon/MaxonGame.java b/core/src/kz/ilotterytea/maxon/MaxonGame.java
index 67b4a0e..a220163 100644
--- a/core/src/kz/ilotterytea/maxon/MaxonGame.java
+++ b/core/src/kz/ilotterytea/maxon/MaxonGame.java
@@ -22,8 +22,6 @@ public class MaxonGame extends Game {
private PetManager petManager;
- private GDXDialogs dialogWindows;
-
private static MaxonGame instance;
public static MaxonGame getInstance() {
@@ -37,10 +35,6 @@ public class MaxonGame extends Game {
return petManager;
}
- public GDXDialogs getDialogWindows() {
- return dialogWindows;
- }
-
@Override
public void create () {
// Check the latest version
@@ -60,7 +54,6 @@ public class MaxonGame extends Game {
assetManager = new AssetManager();
petManager = new PetManager(assetManager);
- dialogWindows = GDXDialogsSystem.install();
this.setScreen(new SplashScreen());
}
diff --git a/core/src/kz/ilotterytea/maxon/screens/MenuScreen.java b/core/src/kz/ilotterytea/maxon/screens/MenuScreen.java
index 1e15032..1154b25 100644
--- a/core/src/kz/ilotterytea/maxon/screens/MenuScreen.java
+++ b/core/src/kz/ilotterytea/maxon/screens/MenuScreen.java
@@ -14,13 +14,11 @@ import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.actions.Actions;
import com.badlogic.gdx.scenes.scene2d.actions.RepeatAction;
import com.badlogic.gdx.scenes.scene2d.ui.*;
-import com.badlogic.gdx.scenes.scene2d.ui.Button;
import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
import com.badlogic.gdx.utils.Align;
import com.badlogic.gdx.utils.Timer;
import com.badlogic.gdx.utils.viewport.ScreenViewport;
-import de.tomgrill.gdxdialogs.core.dialogs.GDXButtonDialog;
import kz.ilotterytea.maxon.MaxonConstants;
import kz.ilotterytea.maxon.MaxonGame;
import kz.ilotterytea.maxon.player.Savegame;
@@ -53,31 +51,9 @@ public class MenuScreen implements Screen {
private final ArrayList<Timer.Task> tasks = new ArrayList<>();
private Sound clickSound;
- private static boolean suggestedUpdate = false;
-
public MenuScreen() {
this.game = MaxonGame.getInstance();
- // Suggest an update
- if (!GameUpdater.CLIENT_IS_ON_LATEST_VERSION && !suggestedUpdate) {
- GDXButtonDialog bDialog = game.getDialogWindows().newDialog(GDXButtonDialog.class);
-
- bDialog.setTitle(game.locale.TranslatableText("updater.title"));
- bDialog.setMessage(game.locale.TranslatableText("updater.message"));
-
- bDialog.setClickListener(button -> {
- if (button == 1) {
- Gdx.net.openURI(MaxonConstants.GAME_APP_URL);
- }
- });
-
- bDialog.addButton(game.locale.TranslatableText("updater.no"));
- bDialog.addButton(game.locale.TranslatableText("updater.yes"));
-
- bDialog.build().show();
- suggestedUpdate = true;
- }
-
// Stage and skin:
this.stage = new Stage(new ScreenViewport());
this.stage.addAction(Actions.sequence(Actions.alpha(0.0f), Actions.alpha(1.0f, 1f)));
@@ -354,6 +330,23 @@ public class MenuScreen implements Screen {
savegameTable.add(info).minSize(640f, 240f);
}
+ // Suggest an update
+ if (!GameUpdater.CLIENT_IS_ON_LATEST_VERSION && OsUtils.isPC) {
+ TextButton updateButton = new TextButton(game.locale.TranslatableText("updater.info"), uiSkin, "link");
+
+ updateButton.setPosition(8f, stage.getHeight() - 32f);
+
+ updateButton.addListener(new ClickListener() {
+ @Override
+ public void clicked(InputEvent event, float x, float y) {
+ super.clicked(event, x, y);
+ Gdx.net.openURI(MaxonConstants.GAME_APP_URL);
+ }
+ });
+
+ menuTable.add(updateButton).pad(6f).left().row();
+ }
+
// Adding tables into the main UI table
menuTable.add(brandTable).grow().row();
menuTable.add(savegameTable).grow().row();