diff --git a/core/src/com/unciv/MenuScreen.kt b/core/src/com/unciv/MainMenuScreen.kt similarity index 91% rename from core/src/com/unciv/MenuScreen.kt rename to core/src/com/unciv/MainMenuScreen.kt index 4b6dc4fc..8437ba92 100644 --- a/core/src/com/unciv/MenuScreen.kt +++ b/core/src/com/unciv/MainMenuScreen.kt @@ -4,11 +4,8 @@ import com.badlogic.gdx.Gdx import com.badlogic.gdx.graphics.Color import com.badlogic.gdx.scenes.scene2d.Touchable import com.badlogic.gdx.scenes.scene2d.actions.Actions -import com.badlogic.gdx.scenes.scene2d.ui.Image import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane import com.badlogic.gdx.scenes.scene2d.ui.Table -import com.badlogic.gdx.scenes.scene2d.utils.TiledDrawable -import com.badlogic.gdx.utils.Align import com.unciv.logic.GameSaver import com.unciv.logic.GameStarter import com.unciv.logic.map.MapGenerator @@ -17,9 +14,7 @@ import com.unciv.logic.map.MapSize import com.unciv.logic.map.MapType import com.unciv.models.metadata.GameParameters import com.unciv.models.ruleset.RulesetCache -import com.unciv.models.translations.tr import com.unciv.ui.MultiplayerScreen -import com.unciv.ui.map.TileGroupMap import com.unciv.ui.mapeditor.EditorMapHolder import com.unciv.ui.mapeditor.LoadMapScreen import com.unciv.ui.mapeditor.MapEditorScreen @@ -27,17 +22,15 @@ import com.unciv.ui.mapeditor.NewMapScreen import com.unciv.ui.newgamescreen.NewGameScreen import com.unciv.ui.saves.LoadGameScreen import com.unciv.ui.utils.* -import com.unciv.ui.worldscreen.WorldMapHolder import kotlin.concurrent.thread -import kotlin.concurrent.timer -class MenuScreen: CameraStageBaseScreen() { +class MainMenuScreen: CameraStageBaseScreen() { val autosave = "Autosave" val backgroundTable = Table().apply { background=ImageGetter.getBackground(Color.WHITE) } private fun getTableBlock(text: String, icon: String, function: () -> Unit): Table { val table = Table().pad(30f) - table.background = ImageGetter.getBackground(colorFromRGB(11, 135, 133)) + table.background = ImageGetter.getBackground(ImageGetter.getBlue()) table.add(ImageGetter.getImage(icon)).size(50f).padRight(30f) table.add(text.toLabel().setFontSize(30).apply { /* setAlignment(Align.center) */ }).width(200f) table.touchable= Touchable.enabled @@ -62,7 +55,7 @@ class MenuScreen: CameraStageBaseScreen() { addTiles(30f) touchable = Touchable.disabled setScale(1f) - center(this@MenuScreen.stage) + center(this@MainMenuScreen.stage) layout() } backgroundTable.add(mapHolder).size(stage.width, stage.height) @@ -126,7 +119,7 @@ class MenuScreen: CameraStageBaseScreen() { val loadMapScreen = LoadMapScreen(null) loadMapScreen.closeButton.isVisible = true loadMapScreen.closeButton.onClick { - game.setScreen(MenuScreen()) + game.setScreen(MainMenuScreen()) loadMapScreen.dispose() } game.setScreen(loadMapScreen) diff --git a/core/src/com/unciv/UncivGame.kt b/core/src/com/unciv/UncivGame.kt index 494988b4..d42c5c30 100644 --- a/core/src/com/unciv/UncivGame.kt +++ b/core/src/com/unciv/UncivGame.kt @@ -90,7 +90,7 @@ class UncivGame( if (settings.isFreshlyCreated) { setScreen(LanguagePickerScreen()) - } else { setScreen(MenuScreen()) } + } else { setScreen(MainMenuScreen()) } isInitialized = true } } @@ -147,7 +147,7 @@ class UncivGame( if (!isInitialized) return // The stuff from Create() is still happening, so the main screen will load eventually ImageGetter.refreshAtlas() - setScreen(MenuScreen()) + setScreen(MainMenuScreen()) } // Maybe this will solve the resume error on chrome OS, issue 322? Worth a shot diff --git a/core/src/com/unciv/ui/LanguagePickerScreen.kt b/core/src/com/unciv/ui/LanguagePickerScreen.kt index 22efdf03..c04caf55 100644 --- a/core/src/com/unciv/ui/LanguagePickerScreen.kt +++ b/core/src/com/unciv/ui/LanguagePickerScreen.kt @@ -3,7 +3,7 @@ package com.unciv.ui import com.badlogic.gdx.graphics.Color import com.badlogic.gdx.scenes.scene2d.Touchable import com.badlogic.gdx.scenes.scene2d.ui.Table -import com.unciv.MenuScreen +import com.unciv.MainMenuScreen import com.unciv.UncivGame import com.unciv.models.translations.tr import com.unciv.ui.pickerscreens.PickerScreen @@ -81,7 +81,7 @@ class LanguagePickerScreen(): PickerScreen(){ game.translations.tryReadTranslationForCurrentLanguage() resetFonts() - game.setScreen(MenuScreen()) + game.setScreen(MainMenuScreen()) dispose() } } \ No newline at end of file diff --git a/core/src/com/unciv/ui/mapeditor/MapEditorMenuPopup.kt b/core/src/com/unciv/ui/mapeditor/MapEditorMenuPopup.kt index 8348fef9..b745adb3 100644 --- a/core/src/com/unciv/ui/mapeditor/MapEditorMenuPopup.kt +++ b/core/src/com/unciv/ui/mapeditor/MapEditorMenuPopup.kt @@ -1,16 +1,14 @@ package com.unciv.ui.mapeditor import com.badlogic.gdx.Gdx -import com.badlogic.gdx.scenes.scene2d.ui.TextButton import com.badlogic.gdx.scenes.scene2d.ui.TextField import com.badlogic.gdx.utils.Json import com.unciv.Constants -import com.unciv.MenuScreen +import com.unciv.MainMenuScreen import com.unciv.UncivGame import com.unciv.logic.MapSaver import com.unciv.logic.map.MapType import com.unciv.logic.map.RoadStatus -import com.unciv.models.translations.tr import com.unciv.ui.saves.Gzip import com.unciv.ui.utils.* import com.unciv.ui.worldscreen.mainmenu.DropBox @@ -116,7 +114,7 @@ class MapEditorMenuPopup(mapEditorScreen: MapEditorScreen): Popup(mapEditorScree val exitMapEditorButton = "Exit map editor".toTextButton() add(exitMapEditorButton ).row() - exitMapEditorButton.onClick { mapEditorScreen.game.setScreen(MenuScreen()); mapEditorScreen.dispose() } + exitMapEditorButton.onClick { mapEditorScreen.game.setScreen(MainMenuScreen()); mapEditorScreen.dispose() } val closeOptionsButton = Constants.close.toTextButton() closeOptionsButton.onClick { close() } diff --git a/core/src/com/unciv/ui/mapeditor/NewMapScreen.kt b/core/src/com/unciv/ui/mapeditor/NewMapScreen.kt index 73856e53..397753f2 100644 --- a/core/src/com/unciv/ui/mapeditor/NewMapScreen.kt +++ b/core/src/com/unciv/ui/mapeditor/NewMapScreen.kt @@ -3,7 +3,7 @@ package com.unciv.ui.mapeditor import com.unciv.ui.utils.AutoScrollPane as ScrollPane import com.badlogic.gdx.Gdx import com.badlogic.gdx.scenes.scene2d.ui.Table -import com.unciv.MenuScreen +import com.unciv.MainMenuScreen import com.unciv.UncivGame import com.unciv.logic.map.MapGenerator import com.unciv.logic.map.MapParameters @@ -22,7 +22,7 @@ class NewMapScreen : PickerScreen() { private var generatedMap: TileMap? = null init { - setDefaultCloseAction(MenuScreen()) + setDefaultCloseAction(MainMenuScreen()) val newMapScreenOptionsTable = Table(skin).apply { pad(10f) diff --git a/core/src/com/unciv/ui/worldscreen/mainmenu/WorldScreenMenuPopup.kt b/core/src/com/unciv/ui/worldscreen/mainmenu/WorldScreenMenuPopup.kt index 75b516da..df1561c8 100644 --- a/core/src/com/unciv/ui/worldscreen/mainmenu/WorldScreenMenuPopup.kt +++ b/core/src/com/unciv/ui/worldscreen/mainmenu/WorldScreenMenuPopup.kt @@ -2,19 +2,13 @@ package com.unciv.ui.worldscreen.mainmenu import com.badlogic.gdx.Gdx import com.unciv.Constants -import com.unciv.MenuScreen -import com.unciv.UncivGame +import com.unciv.MainMenuScreen import com.unciv.models.translations.tr import com.unciv.ui.CivilopediaScreen -import com.unciv.ui.MultiplayerScreen -import com.unciv.ui.mapeditor.LoadMapScreen -import com.unciv.ui.mapeditor.NewMapScreen import com.unciv.ui.newgamescreen.NewGameScreen -import com.unciv.ui.saves.LoadGameScreen import com.unciv.ui.saves.SaveGameScreen import com.unciv.ui.utils.Popup import com.unciv.ui.utils.addSeparator -import com.unciv.ui.utils.onClick import com.unciv.ui.victoryscreen.VictoryScreen import com.unciv.ui.worldscreen.WorldScreen @@ -24,7 +18,7 @@ class WorldScreenMenuPopup(val worldScreen: WorldScreen) : Popup(worldScreen) { val width = 200f val height = 30f addSquareButton("Main menu".tr()){ - worldScreen.game.setScreen(MenuScreen()) + worldScreen.game.setScreen(MainMenuScreen()) close() }.size(width,height) addSeparator()