diff --git a/android/build.gradle b/android/build.gradle index dfd1b80dc3..e99672ff0f 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -21,8 +21,8 @@ android { applicationId "com.unciv.app" minSdkVersion 14 targetSdkVersion 29 - versionCode 306 - versionName "3.1.4" + versionCode 307 + versionName "3.1.4-patch1" } // Had to add this crap for Travis to build, it wanted to sign the app diff --git a/core/src/com/unciv/ui/worldscreen/optionstable/PopupTable.kt b/core/src/com/unciv/ui/worldscreen/optionstable/PopupTable.kt index c907ca60cb..ce8a301c58 100644 --- a/core/src/com/unciv/ui/worldscreen/optionstable/PopupTable.kt +++ b/core/src/com/unciv/ui/worldscreen/optionstable/PopupTable.kt @@ -1,6 +1,7 @@ package com.unciv.ui.worldscreen.optionstable import com.badlogic.gdx.graphics.Color +import com.badlogic.gdx.scenes.scene2d.Touchable import com.badlogic.gdx.scenes.scene2d.ui.Cell import com.badlogic.gdx.scenes.scene2d.ui.Label import com.badlogic.gdx.scenes.scene2d.ui.Table @@ -39,6 +40,14 @@ open class PopupTable(val screen: CameraStageBaseScreen): Table(CameraStageBaseS return add(button).apply { row() } } + fun addSquareButton(text:String, action:()->Unit): Cell { + val button = Table() + button.add(text.toLabel()) + button.onClick(action) + button.touchable=Touchable.enabled + return add(button).apply { row() } + } + fun addCloseButton() = addButton("Close"){close()} } diff --git a/core/src/com/unciv/ui/worldscreen/optionstable/WorldScreenMenuTable.kt b/core/src/com/unciv/ui/worldscreen/optionstable/WorldScreenMenuTable.kt index 3c5b156628..77349428cc 100644 --- a/core/src/com/unciv/ui/worldscreen/optionstable/WorldScreenMenuTable.kt +++ b/core/src/com/unciv/ui/worldscreen/optionstable/WorldScreenMenuTable.kt @@ -11,6 +11,7 @@ import com.unciv.ui.mapeditor.MapEditorScreen import com.unciv.ui.newgamescreen.NewGameScreen import com.unciv.ui.saves.LoadGameScreen import com.unciv.ui.saves.SaveGameScreen +import com.unciv.ui.utils.addSeparator import com.unciv.ui.utils.disable import com.unciv.ui.utils.setFontColor import com.unciv.ui.utils.toLabel @@ -21,7 +22,9 @@ import kotlin.collections.ArrayList class WorldScreenMenuTable(val worldScreen: WorldScreen) : PopupTable(worldScreen) { init { - addButton("Map editor".tr()){ + val width = 200f + val height = 30f + addSquareButton("Map editor".tr()){ val tileMapClone = worldScreen.gameInfo.tileMap.clone() for(tile in tileMapClone.values){ tile.militaryUnit=null @@ -34,46 +37,58 @@ class WorldScreenMenuTable(val worldScreen: WorldScreen) : PopupTable(worldScree } UnCivGame.Current.screen = MapEditorScreen(tileMapClone) remove() - } + }.size(width,height) + addSeparator() - addButton("Civilopedia".tr()){ + addSquareButton("Civilopedia".tr()){ UnCivGame.Current.screen = CivilopediaScreen() remove() - } + }.size(width,height) + addSeparator() - addButton("Load game".tr()){ + addSquareButton("Load game".tr()){ UnCivGame.Current.screen = LoadGameScreen() remove() - } + }.size(width,height) + addSeparator() - addButton("Save game".tr()) { + addSquareButton("Save game".tr()) { UnCivGame.Current.screen = SaveGameScreen() remove() - } + }.size(width,height) + addSeparator() - addButton("Start new game".tr()){ UnCivGame.Current.screen = NewGameScreen() } + addSquareButton("Start new game".tr()){ UnCivGame.Current.screen = NewGameScreen() }.size(width,height) + addSeparator() - addButton("Multiplayer".tr()) { openMultiplayerPopup() } + addSquareButton("Multiplayer".tr()) { openMultiplayerPopup() }.size(width,height) + addSeparator() - addButton("Victory status".tr()) { UnCivGame.Current.screen = VictoryScreen() } + addSquareButton("Victory status".tr()) { UnCivGame.Current.screen = VictoryScreen() }.size(width,height) + addSeparator() - addButton("Options".tr()){ + addSquareButton("Options".tr()){ UnCivGame.Current.worldScreen.stage.addActor(WorldScreenOptionsTable(worldScreen)) remove() - } + }.size(width,height) + addSeparator() - addButton("Community"){ + addSquareButton("Community"){ WorldScreenCommunityTable(worldScreen) remove() - } + }.size(width,height) + addSeparator() - addCloseButton() + addSquareButton("Close"){ + close() + }.size(width,height) open() } + fun openMultiplayerPopup(){ close()