diff --git a/android/build.gradle b/android/build.gradle index 0156c5a0e0..dc708f9a6e 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -21,8 +21,8 @@ android { applicationId "com.unciv.app" minSdkVersion 14 targetSdkVersion 28 - versionCode 203 - versionName "2.13.3" + versionCode 204 + versionName "2.13.4" } // Had to add this crap for Travis to build, it wanted to sign the app diff --git a/core/src/com/unciv/ui/worldscreen/WorldScreen.kt b/core/src/com/unciv/ui/worldscreen/WorldScreen.kt index 8719ff9c87..3ab5a5f5e2 100644 --- a/core/src/com/unciv/ui/worldscreen/WorldScreen.kt +++ b/core/src/com/unciv/ui/worldscreen/WorldScreen.kt @@ -22,6 +22,7 @@ import com.unciv.ui.pickerscreens.TechButton import com.unciv.ui.pickerscreens.TechPickerScreen import com.unciv.ui.trade.DiplomacyScreen import com.unciv.ui.utils.* +import com.unciv.ui.worldscreen.bottombar.BattleTable import com.unciv.ui.worldscreen.bottombar.WorldScreenBottomBar import com.unciv.ui.worldscreen.optionstable.PopupTable import com.unciv.ui.worldscreen.unit.UnitActionsTable @@ -35,6 +36,7 @@ class WorldScreen : CameraStageBaseScreen() { private val topBar = WorldScreenTopBar(this) val bottomBar = WorldScreenBottomBar(this) + val battleTable = BattleTable(this) val unitActionsTable = UnitActionsTable(this) private val techButton = Table() @@ -74,6 +76,11 @@ class WorldScreen : CameraStageBaseScreen() { bottomBar.width = stage.width stage.addActor(bottomBar) + + battleTable.width = stage.width/3 + battleTable.x = stage.width/3 + stage.addActor(battleTable) + stage.addActor(unitActionsTable) displayTutorials("NewGame") @@ -139,6 +146,8 @@ class WorldScreen : CameraStageBaseScreen() { updateDiplomacyButton(cloneCivilization) bottomBar.update(tileMapHolder.selectedTile) // has to come before tilemapholder update because the tilemapholder actions depend on the selected unit! + battleTable.update() + minimapWrapper.update(cloneCivilization) minimapWrapper.y = bottomBar.height // couldn't be bothered to create a separate val for minimap wrapper diff --git a/core/src/com/unciv/ui/worldscreen/bottombar/BattleTable.kt b/core/src/com/unciv/ui/worldscreen/bottombar/BattleTable.kt index dd95412fde..21af698822 100644 --- a/core/src/com/unciv/ui/worldscreen/bottombar/BattleTable.kt +++ b/core/src/com/unciv/ui/worldscreen/bottombar/BattleTable.kt @@ -24,6 +24,7 @@ class BattleTable(val worldScreen: WorldScreen): Table() { fun hide(){ clear() + pack() } fun update() { @@ -35,6 +36,7 @@ class BattleTable(val worldScreen: WorldScreen): Table() { } else if (unitTable.selectedCity != null) { attacker = CityCombatant(unitTable.selectedCity!!) } else { + hide() return // no attacker } diff --git a/core/src/com/unciv/ui/worldscreen/bottombar/TileInfoTable.kt b/core/src/com/unciv/ui/worldscreen/bottombar/TileInfoTable.kt index 9dc6db8f83..7f80928e09 100644 --- a/core/src/com/unciv/ui/worldscreen/bottombar/TileInfoTable.kt +++ b/core/src/com/unciv/ui/worldscreen/bottombar/TileInfoTable.kt @@ -1,5 +1,6 @@ package com.unciv.ui.worldscreen.bottombar +import com.badlogic.gdx.graphics.Color import com.badlogic.gdx.scenes.scene2d.ui.Label import com.badlogic.gdx.scenes.scene2d.ui.Table import com.badlogic.gdx.utils.Align @@ -10,9 +11,9 @@ import com.unciv.ui.utils.ImageGetter import com.unciv.ui.utils.toLabel import com.unciv.ui.worldscreen.WorldScreen -class TileInfoTable(private val worldScreen: WorldScreen) : Table() { +class TileInfoTable(private val worldScreen: WorldScreen) : Table(CameraStageBaseScreen.skin) { init{ - skin = CameraStageBaseScreen.skin + background = ImageGetter.getBackground(ImageGetter.getBlue().lerp(Color.BLACK, 0.5f)) } internal fun updateTileTable(tile: TileInfo) { @@ -42,5 +43,4 @@ class TileInfoTable(private val worldScreen: WorldScreen) : Table() { } return table } -} - +} \ No newline at end of file diff --git a/core/src/com/unciv/ui/worldscreen/bottombar/WorldScreenBottomBar.kt b/core/src/com/unciv/ui/worldscreen/bottombar/WorldScreenBottomBar.kt index fdc0e78b00..5e40e966e3 100644 --- a/core/src/com/unciv/ui/worldscreen/bottombar/WorldScreenBottomBar.kt +++ b/core/src/com/unciv/ui/worldscreen/bottombar/WorldScreenBottomBar.kt @@ -1,35 +1,26 @@ package com.unciv.ui.worldscreen.bottombar -import com.badlogic.gdx.graphics.Color import com.badlogic.gdx.scenes.scene2d.Touchable import com.badlogic.gdx.scenes.scene2d.ui.Table import com.unciv.logic.map.TileInfo -import com.unciv.ui.utils.ImageGetter import com.unciv.ui.worldscreen.WorldScreen import com.unciv.ui.worldscreen.unit.UnitTable class WorldScreenBottomBar(val worldScreen: WorldScreen) : Table(){ val unitTable = UnitTable(worldScreen) - val battleTable = BattleTable(worldScreen) val tileInfoTable = TileInfoTable(worldScreen) init { touchable= Touchable.enabled add(unitTable).width(worldScreen.stage.width/3).fill() - add(battleTable).width(worldScreen.stage.width/3).fill() // so that background fills entire middle third + add().width(worldScreen.stage.width/3) // empty space for the battle table add(tileInfoTable).width(worldScreen.stage.width/3).fill() - val tileTableBackground = ImageGetter.getBackground(ImageGetter.getBlue().lerp(Color.BLACK, 0.5f)) - tileTableBackground.minHeight = 0f - tileTableBackground.minWidth = 0f - background = tileTableBackground - pack() } fun update(selectedTile: TileInfo?){ unitTable.update() - battleTable.update() if(selectedTile!=null) tileInfoTable.updateTileTable(selectedTile) pack() } diff --git a/core/src/com/unciv/ui/worldscreen/unit/UnitTable.kt b/core/src/com/unciv/ui/worldscreen/unit/UnitTable.kt index d7ea2262d5..165ae2cafd 100644 --- a/core/src/com/unciv/ui/worldscreen/unit/UnitTable.kt +++ b/core/src/com/unciv/ui/worldscreen/unit/UnitTable.kt @@ -33,6 +33,7 @@ class UnitTable(val worldScreen: WorldScreen) : Table(){ init { pad(5f) + background = ImageGetter.getBackground(ImageGetter.getBlue().lerp(Color.BLACK, 0.5f)) add(Table().apply { add(prevIdleUnitButton)