From 8d58702d809024be1df1bd88b8ec4b525a74b643 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Thu, 10 Oct 2019 14:48:09 +0300 Subject: [PATCH] Resolved #1177 - Great Improvements now provide Strategic resources APK no longer bundles maps in assets --- android/build.gradle | 4 ++-- core/src/com/unciv/logic/city/CityInfo.kt | 4 +++- .../ui/worldscreen/optionstable/PopupTable.kt | 20 ++++++++++--------- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index e99672ff0f..bd2a267e57 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -41,7 +41,7 @@ android { release { // Don't add local save files and fonts to release, obviously aaptOptions { - ignoreAssetsPattern "!SaveFiles:!fonts" + ignoreAssetsPattern "!SaveFiles:!fonts:!maps" } minifyEnabled false @@ -51,7 +51,7 @@ android { debug { // Don't add local save files and fonts to release, obviously aaptOptions { - ignoreAssetsPattern "!SaveFiles:!fonts" + ignoreAssetsPattern "!SaveFiles:!fonts:!maps" } } } diff --git a/core/src/com/unciv/logic/city/CityInfo.kt b/core/src/com/unciv/logic/city/CityInfo.kt index a083a0eda1..65d4e60ed2 100644 --- a/core/src/com/unciv/logic/city/CityInfo.kt +++ b/core/src/com/unciv/logic/city/CityInfo.kt @@ -126,7 +126,9 @@ class CityInfo { for (tileInfo in getTiles().filter { it.resource != null }) { val resource = tileInfo.getTileResource() if(resource.revealedBy!=null && !civInfo.tech.isResearched(resource.revealedBy!!)) continue - if (resource.improvement == tileInfo.improvement || tileInfo.isCityCenter()){ + if (resource.improvement == tileInfo.improvement || tileInfo.isCityCenter() + // Per https://gaming.stackexchange.com/questions/53155/do-manufactories-and-customs-houses-sacrifice-the-strategic-or-luxury-resources + || (resource.resourceType==ResourceType.Strategic && tileInfo.containsGreatImprovement())){ var amountToAdd = 1 if(resource.resourceType == ResourceType.Strategic){ amountToAdd = 2 diff --git a/core/src/com/unciv/ui/worldscreen/optionstable/PopupTable.kt b/core/src/com/unciv/ui/worldscreen/optionstable/PopupTable.kt index ce8a301c58..bd40b84a79 100644 --- a/core/src/com/unciv/ui/worldscreen/optionstable/PopupTable.kt +++ b/core/src/com/unciv/ui/worldscreen/optionstable/PopupTable.kt @@ -10,7 +10,7 @@ import com.badlogic.gdx.utils.Align import com.unciv.models.gamebasics.tr import com.unciv.ui.utils.* -open class PopupTable(val screen: CameraStageBaseScreen): Table(CameraStageBaseScreen.skin){ +open class PopupTable(val screen: CameraStageBaseScreen): Table(CameraStageBaseScreen.skin) { init { val tileTableBackground = ImageGetter.getBackground(ImageGetter.getBlue().lerp(Color.BLACK, 0.5f)) background = tileTableBackground @@ -19,35 +19,37 @@ open class PopupTable(val screen: CameraStageBaseScreen): Table(CameraStageBaseS this.defaults().pad(5f) } - fun open(){ + fun open() { pack() center(screen.stage) screen.stage.addActor(this) } - open fun close(){ remove() } + open fun close() { + remove() + } fun addGoodSizedLabel(text: String): Cell