diff --git a/src/net/torvald/terrarum/App.java b/src/net/torvald/terrarum/App.java index b8b4b95fe..76ec1f1f0 100644 --- a/src/net/torvald/terrarum/App.java +++ b/src/net/torvald/terrarum/App.java @@ -366,6 +366,7 @@ public class App implements ApplicationListener { CommonResourcePool.INSTANCE.addToLoadingList("blockmarkings_common", () -> new TextureRegionPack(Gdx.files.internal("assets/graphics/blocks/block_markings_common.tga"), 16, 16, 0, 0, 0, 0, false)); CommonResourcePool.INSTANCE.addToLoadingList("blockmarking_actor", () -> new BlockMarkerActor()); + CommonResourcePool.INSTANCE.addToLoadingList("loading_circle_64", () -> new TextureRegionPack(Gdx.files.internal("assets/graphics/gui/loading_circle_64.tga"), 64, 64, 0, 0, 0, 0, false)); newTempFile("wenquanyi.tga"); // temp file required by the font diff --git a/src/net/torvald/terrarum/TitleScreen.kt b/src/net/torvald/terrarum/TitleScreen.kt index 79e9efb04..52424fb0c 100644 --- a/src/net/torvald/terrarum/TitleScreen.kt +++ b/src/net/torvald/terrarum/TitleScreen.kt @@ -189,7 +189,7 @@ class TitleScreen(batch: SpriteBatch) : IngameInstance(batch) { uiContainer.add(uiFakeBlurOverlay) - uiMenu = UIRemoCon(this, UITitleRemoConYaml())//UITitleRemoConRoot() + uiMenu = UIRemoCon(this, UITitleRemoConYaml(App.savegames.isNotEmpty())) uiMenu.setPosition(0, 0) uiMenu.setAsOpen() diff --git a/src/net/torvald/terrarum/modulebasegame/ui/UITitleRemoConYaml.kt b/src/net/torvald/terrarum/modulebasegame/ui/UITitleRemoConYaml.kt index 23775413d..41a9d147a 100644 --- a/src/net/torvald/terrarum/modulebasegame/ui/UITitleRemoConYaml.kt +++ b/src/net/torvald/terrarum/modulebasegame/ui/UITitleRemoConYaml.kt @@ -1,6 +1,5 @@ package net.torvald.terrarum.modulebasegame.ui -import net.torvald.terrarum.App import net.torvald.terrarum.Yaml @@ -12,38 +11,37 @@ object UITitleRemoConYaml { * * The class must be the UICanvas */ - val menus = """ - - MENU_LABEL_CONTINUE : net.torvald.terrarum.modulebasegame.ui.UIProxyLoadLatestSave - - MENU_LABEL_NEW_GAME : net.torvald.terrarum.modulebasegame.ui.UIProxyNewRandomGame - - MENU_IO_LOAD : net.torvald.terrarum.modulebasegame.ui.UILoadDemoSavefiles - - MENU_LABEL_RETURN - - MENU_OPTIONS - - MENU_OPTIONS_GRAPHICS - - MENU_OPTIONS_CONTROLS - - MENU_CONTROLS_KEYBOARD - - MENU_CONTROLS_GAMEPAD - - MENU_LABEL_RETURN - - MENU_OPTIONS_SOUND - - MENU_LABEL_LANGUAGE : net.torvald.terrarum.modulebasegame.ui.UITitleLanguage - - MENU_MODULES : net.torvald.terrarum.ModOptionsHost - - MENU_LABEL_RETURN - - MENU_LABEL_CREDITS : net.torvald.terrarum.modulebasegame.ui.UITitleCredits - - MENU_LABEL_CREDITS : net.torvald.terrarum.modulebasegame.ui.UITitleCredits - - MENU_CREDIT_GPL_DNT : net.torvald.terrarum.modulebasegame.ui.UITitleGPL3 - - MENU_LABEL_RETURN - - MENU_LABEL_QUIT - """.trimIndent() + private val menuBase = """ +- MENU_OPTIONS + - MENU_OPTIONS_GRAPHICS + - MENU_OPTIONS_CONTROLS + - MENU_CONTROLS_KEYBOARD + - MENU_CONTROLS_GAMEPAD + - MENU_LABEL_RETURN + - MENU_OPTIONS_SOUND + - MENU_LABEL_LANGUAGE : net.torvald.terrarum.modulebasegame.ui.UITitleLanguage + - MENU_MODULES : net.torvald.terrarum.ModOptionsHost + - MENU_LABEL_RETURN +- MENU_LABEL_CREDITS : net.torvald.terrarum.modulebasegame.ui.UITitleCredits + - MENU_LABEL_CREDITS : net.torvald.terrarum.modulebasegame.ui.UITitleCredits + - MENU_CREDIT_GPL_DNT : net.torvald.terrarum.modulebasegame.ui.UITitleGPL3 + - MENU_LABEL_RETURN +- MENU_LABEL_QUIT +""" - val debugTools = "" /*""" - - Development Tools $ - - Building Maker : net.torvald.terrarum.modulebasegame.ui.UIProxyNewBuildingMaker - - Start New Random Game : net.torvald.terrarum.modulebasegame.ui.UIProxyNewRandomGame - - MENU_LABEL_RETURN - """.trimIndent()*/ + private val menuWithSavefile = """ +- MENU_LABEL_CONTINUE : net.torvald.terrarum.modulebasegame.ui.UIProxyLoadLatestSave +- MENU_LABEL_NEW_GAME : net.torvald.terrarum.modulebasegame.ui.UIProxyNewRandomGame +- MENU_IO_LOAD : net.torvald.terrarum.modulebasegame.ui.UILoadDemoSavefiles + - MENU_LABEL_RETURN +""" - operator fun invoke() = if (App.IS_DEVELOPMENT_BUILD) - Yaml(menus + "\n" + debugTools).parse() - else - Yaml(menus).parse() + private val menuNewGame = """ +- MENU_LABEL_NEW_GAME : net.torvald.terrarum.modulebasegame.ui.UIProxyNewRandomGame +""" + + + operator fun invoke(hasSave: Boolean) = + Yaml((if (hasSave) menuWithSavefile else menuNewGame) + menuBase).parse() }