From 5e5838a8c1ef9f3c12d4a9e00d66e54494e0aed7 Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 18 Oct 2018 16:04:40 -0400 Subject: [PATCH] let me make this PAINFULLY CLEAR --- core/assets/bundles/bundle.properties | 3 ++- core/src/io/anuke/mindustry/core/Control.java | 11 +++++++---- core/src/io/anuke/mindustry/core/UI.java | 11 +++++++++++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 395c63cf3b..c08507a21a 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -426,7 +426,8 @@ mode.waves.name=waves mode.waves.description=the normal mode. limited resources and automatic incoming waves. mode.sandbox.name=sandbox mode.sandbox.description=infinite resources and no timer for waves. -mode.custom.warning=Note that blocks unlocked in custom games are not carried over to sectors.\n\n[LIGHT_GRAY]In sandbox, only blocks unlocked with sector play can be used. +mode.custom.warning=[scarlet]UNLOCKS IN CUSTOM GAMES OR SERVERS ARE NOT SAVED.[]\n\nPlay in sectors to unlock things. +mode.custom.warning.read=Just to make sure you've read it:\n[scarlet]UNLOCKS IN CUSTOM GAMES DO NOT CARRY OVER TO SECTORS OR OTHER MODES!\n\n[LIGHT_GRAY](I wish this wasn't necessary, but apparently it is) mode.freebuild.name=freebuild mode.freebuild.description=limited resources and no timer for waves. mode.pvp.name=PvP diff --git a/core/src/io/anuke/mindustry/core/Control.java b/core/src/io/anuke/mindustry/core/Control.java index bc30c48359..1222bde0da 100644 --- a/core/src/io/anuke/mindustry/core/Control.java +++ b/core/src/io/anuke/mindustry/core/Control.java @@ -114,10 +114,13 @@ public class Control extends Module{ state.set(State.playing); - if(world.getSector() == null && !Settings.getBool("custom-warning", false)){ - threads.runGraphics(() -> ui.showInfo("$mode.custom.warning")); - Settings.putBool("custom-warning", true); - Settings.save(); + if(world.getSector() == null && !Settings.getBool("custom-warning-for-real-1", false)){ + threads.runGraphics(() -> ui.showInfo("$mode.custom.warning", () -> + ui.showInfo("$mode.custom.warning.read", () -> { + Settings.putBool("custom-warning-for-real-1", true); + Settings.save(); + }))); + } }); diff --git a/core/src/io/anuke/mindustry/core/UI.java b/core/src/io/anuke/mindustry/core/UI.java index e880e6d609..62b93730ad 100644 --- a/core/src/io/anuke/mindustry/core/UI.java +++ b/core/src/io/anuke/mindustry/core/UI.java @@ -244,6 +244,17 @@ public class UI extends SceneModule{ }}.show(); } + public void showInfo(String info, Runnable clicked){ + new Dialog("$text.info.title", "dialog"){{ + getCell(content()).growX(); + content().margin(15).add(info).width(400f).wrap().get().setAlignment(Align.center, Align.center); + buttons().addButton("$text.ok", () -> { + clicked.run(); + hide(); + }).size(90, 50).pad(4); + }}.show(); + } + public void showError(String text){ new Dialog("$text.error.title", "dialog"){{ content().margin(15).add(text).width(400f).wrap().get().setAlignment(Align.center, Align.center);