diff --git a/android/build.gradle b/android/build.gradle index cda421a70e..ec69b7e0d8 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -21,8 +21,8 @@ android { applicationId "com.unciv.game" minSdkVersion 14 targetSdkVersion 26 - versionCode 95 - versionName "2.5.9" + versionCode 96 + versionName "2.5.10" } buildTypes { release { diff --git a/core/src/com/unciv/logic/GameInfo.kt b/core/src/com/unciv/logic/GameInfo.kt index fccb7b18b5..17c6d6d2c2 100644 --- a/core/src/com/unciv/logic/GameInfo.kt +++ b/core/src/com/unciv/logic/GameInfo.kt @@ -38,7 +38,7 @@ class GameInfo { // We need to update the stats after ALL the cities are done updating because // maybe one of them has a wonder that affects the stats of all the rest of the cities - for (civInfo in civilizations.filterNot { it==player }){ + for (civInfo in civilizations.filterNot { it==player || it.isDefeated() }){ civInfo.startTurn() Automation().automateCivMoves(civInfo) } diff --git a/core/src/com/unciv/logic/battle/Battle.kt b/core/src/com/unciv/logic/battle/Battle.kt index f49a91777c..98ca01394e 100644 --- a/core/src/com/unciv/logic/battle/Battle.kt +++ b/core/src/com/unciv/logic/battle/Battle.kt @@ -118,9 +118,10 @@ class Battle(val gameInfo:GameInfo=UnCivGame.Current.gameInfo) { if(city.cityConstructions.isBuilt("Palace")){ city.cityConstructions.builtBuildings.remove("Palace") - if(enemyCiv.cities.isEmpty()) { + if(enemyCiv.isDefeated()) { gameInfo.getPlayerCivilization() .addNotification("The civilization of [${enemyCiv.civName}] has been destroyed!", null, Color.RED) + enemyCiv.getCivUnits().forEach { it.removeFromTile() } } else{ enemyCiv.cities.first().cityConstructions.builtBuildings.add("Palace") // relocate palace diff --git a/core/src/com/unciv/ui/TradeScreen.kt b/core/src/com/unciv/ui/TradeScreen.kt index f924f45211..c9e00a348c 100644 --- a/core/src/com/unciv/ui/TradeScreen.kt +++ b/core/src/com/unciv/ui/TradeScreen.kt @@ -45,6 +45,7 @@ class TradeScreen(val otherCivilization: CivilizationInfo) : CameraStageBaseScre val table = Table(skin) val tradeText = Label("What do you have in mind?",skin) + val offerButton = TextButton("Offer trade",skin) init { val closeButton = TextButton("Close".tr(), skin) @@ -55,12 +56,18 @@ class TradeScreen(val otherCivilization: CivilizationInfo) : CameraStageBaseScre val lowerTable = Table().apply { defaults().pad(10f) } - lowerTable.add(tradeText).row() - val offerButton = TextButton("Offer trade",skin) + lowerTable.add(tradeText).colspan(2).row() + offerButton.addClickListener { - if(isTradeAcceptable(currentTrade)) tradeText.setText("That is acceptable.") - else tradeText.setText("I think not.") + if(offerButton.text.toString() == "Offer trade") { + if (isTradeAcceptable(currentTrade)){ + tradeText.setText("That is acceptable.") + offerButton.setText("Accept") + } + else tradeText.setText("I think not.") + } } + lowerTable.add(offerButton) lowerTable.pack() @@ -97,14 +104,16 @@ class TradeScreen(val otherCivilization: CivilizationInfo) : CameraStageBaseScre val amountPerClick = if(offer.key.type==TradeType.Gold) 50 else 1 - if(offer.value>0) // for instance we have negative gold + if(offer.value>0) tb.addClickListener { val amountTransfered = min(amountPerClick, offer.value) offers.add(offer.key,-amountTransfered) correspondingOffers.add(offer.key,amountTransfered) + offerButton.setText("Offer trade") + tradeText.setText("What do you have in mind?") update() } - else tb.disable() + else tb.disable() // for instance we have negative gold table.add(tb).row() } return table diff --git a/core/src/com/unciv/ui/worldscreen/WorldScreen.kt b/core/src/com/unciv/ui/worldscreen/WorldScreen.kt index 1d55f82204..ba4ec0672f 100644 --- a/core/src/com/unciv/ui/worldscreen/WorldScreen.kt +++ b/core/src/com/unciv/ui/worldscreen/WorldScreen.kt @@ -59,13 +59,14 @@ class WorldScreen : CameraStageBaseScreen() { tradeButtons.defaults().pad(5f) - for(civ in gameInfo.civilizations.filterNot { it.isPlayerCivilization()||it.isBarbarianCivilization() }){ + for(civ in gameInfo.civilizations.filterNot { it.isPlayerCivilization() || it.isBarbarianCivilization() }){ val tb = TextButton(civ.civName,skin) tb.addClickListener { UnCivGame.Current.screen = TradeScreen(civ) } tradeButtons.add(tb) } tradeButtons.pack() stage.addActor(tradeButtons) + tradeButtons.isVisible=false bottomBar.width = stage.width stage.addActor(bottomBar)