Resolved #1177 - Great Improvements now provide Strategic resources

APK no longer bundles maps in assets
This commit is contained in:
Yair Morgenstern 2019-10-10 14:48:09 +03:00
parent bde11941c5
commit 8d58702d80
3 changed files with 16 additions and 12 deletions

View File

@ -41,7 +41,7 @@ android {
release { release {
// Don't add local save files and fonts to release, obviously // Don't add local save files and fonts to release, obviously
aaptOptions { aaptOptions {
ignoreAssetsPattern "!SaveFiles:!fonts" ignoreAssetsPattern "!SaveFiles:!fonts:!maps"
} }
minifyEnabled false minifyEnabled false
@ -51,7 +51,7 @@ android {
debug { debug {
// Don't add local save files and fonts to release, obviously // Don't add local save files and fonts to release, obviously
aaptOptions { aaptOptions {
ignoreAssetsPattern "!SaveFiles:!fonts" ignoreAssetsPattern "!SaveFiles:!fonts:!maps"
} }
} }
} }

View File

@ -126,7 +126,9 @@ class CityInfo {
for (tileInfo in getTiles().filter { it.resource != null }) { for (tileInfo in getTiles().filter { it.resource != null }) {
val resource = tileInfo.getTileResource() val resource = tileInfo.getTileResource()
if(resource.revealedBy!=null && !civInfo.tech.isResearched(resource.revealedBy!!)) continue 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 var amountToAdd = 1
if(resource.resourceType == ResourceType.Strategic){ if(resource.resourceType == ResourceType.Strategic){
amountToAdd = 2 amountToAdd = 2

View File

@ -10,7 +10,7 @@ import com.badlogic.gdx.utils.Align
import com.unciv.models.gamebasics.tr import com.unciv.models.gamebasics.tr
import com.unciv.ui.utils.* import com.unciv.ui.utils.*
open class PopupTable(val screen: CameraStageBaseScreen): Table(CameraStageBaseScreen.skin){ open class PopupTable(val screen: CameraStageBaseScreen): Table(CameraStageBaseScreen.skin) {
init { init {
val tileTableBackground = ImageGetter.getBackground(ImageGetter.getBlue().lerp(Color.BLACK, 0.5f)) val tileTableBackground = ImageGetter.getBackground(ImageGetter.getBlue().lerp(Color.BLACK, 0.5f))
background = tileTableBackground background = tileTableBackground
@ -19,35 +19,37 @@ open class PopupTable(val screen: CameraStageBaseScreen): Table(CameraStageBaseS
this.defaults().pad(5f) this.defaults().pad(5f)
} }
fun open(){ fun open() {
pack() pack()
center(screen.stage) center(screen.stage)
screen.stage.addActor(this) screen.stage.addActor(this)
} }
open fun close(){ remove() } open fun close() {
remove()
}
fun addGoodSizedLabel(text: String): Cell<Label> { fun addGoodSizedLabel(text: String): Cell<Label> {
val label = text.toLabel() val label = text.toLabel()
label.setWrap(true) label.setWrap(true)
label.setAlignment(Align.center) label.setAlignment(Align.center)
return add(label).width(screen.stage.width/2) return add(label).width(screen.stage.width / 2)
} }
fun addButton(text:String, action:()->Unit): Cell<TextButton> { fun addButton(text: String, action: () -> Unit): Cell<TextButton> {
val button = TextButton(text.tr(), skin).apply { color= ImageGetter.getBlue() } val button = TextButton(text.tr(), skin).apply { color = ImageGetter.getBlue() }
button.onClick(action) button.onClick(action)
return add(button).apply { row() } return add(button).apply { row() }
} }
fun addSquareButton(text:String, action:()->Unit): Cell<Table> { fun addSquareButton(text: String, action: () -> Unit): Cell<Table> {
val button = Table() val button = Table()
button.add(text.toLabel()) button.add(text.toLabel())
button.onClick(action) button.onClick(action)
button.touchable=Touchable.enabled button.touchable = Touchable.enabled
return add(button).apply { row() } return add(button).apply { row() }
} }
fun addCloseButton() = addButton("Close"){close()} fun addCloseButton() = addButton("Close") { close() }
} }