Era-specific city tiles for Ancient, Classical and Medieval

This commit is contained in:
Yair Morgenstern
2020-10-06 12:22:55 +03:00
parent bb5eff5250
commit fa59d4888a
7 changed files with 522 additions and 501 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 547 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 500 KiB

After

Width:  |  Height:  |  Size: 500 KiB

View File

@ -138,16 +138,22 @@ open class TileGroup(var tileInfo: TileInfo, var tileSetStrings:TileSetStrings)
fun getTileBaseImageLocations(viewingCiv: CivilizationInfo?): List<String>{ fun getTileBaseImageLocations(viewingCiv: CivilizationInfo?): List<String>{
if (viewingCiv==null && !showEntireMap) return listOf(tileSetStrings.hexagon) if (viewingCiv==null && !showEntireMap) return listOf(tileSetStrings.hexagon)
val shouldShowImprovement = tileInfo.improvement!=null && UncivGame.Current.settings.showPixelImprovements
val shouldShowResource = UncivGame.Current.settings.showPixelImprovements
&& tileInfo.resource!=null &&
(showEntireMap || viewingCiv==null || tileInfo.hasViewableResource(viewingCiv))
val baseTerrainTileLocation = tileSetStrings.getTile(tileInfo.baseTerrain) // e.g. Grassland
if (tileInfo.isCityCenter()) { if (tileInfo.isCityCenter()) {
// Temporarily disabled until we can see the rivers behind the era cities =) val era = tileInfo.getOwner()!!.getEra()
// val era = tileInfo.getOwner()!!.getEra() val terrainAndCityWithEra = tileSetStrings.getCityTile(tileInfo.baseTerrain, era)
// val terrainAndCityWithEra = tileSetStrings.getCityTile(tileInfo.baseTerrain, era) if (ImageGetter.imageExists(terrainAndCityWithEra))
// if (ImageGetter.imageExists(terrainAndCityWithEra)) return listOf(terrainAndCityWithEra)
// return listOf(terrainAndCityWithEra)
// val cityWithEra = tileSetStrings.getCityTile(null, era)
// val cityWithEra = tileSetStrings.getCityTile(null, era) if (ImageGetter.imageExists(cityWithEra))
// if (ImageGetter.imageExists(cityWithEra)) return listOf(baseTerrainTileLocation, cityWithEra)
// return listOf(cityWithEra)
val terrainAndCity = tileSetStrings.getCityTile(tileInfo.baseTerrain, null) val terrainAndCity = tileSetStrings.getCityTile(tileInfo.baseTerrain, null)
if (ImageGetter.imageExists(terrainAndCity)) if (ImageGetter.imageExists(terrainAndCity))
@ -166,12 +172,6 @@ open class TileGroup(var tileInfo: TileInfo, var tileSetStrings:TileSetStrings)
} }
val shouldShowImprovement = tileInfo.improvement!=null && UncivGame.Current.settings.showPixelImprovements
val shouldShowResource = UncivGame.Current.settings.showPixelImprovements
&& tileInfo.resource!=null &&
(showEntireMap || viewingCiv==null || tileInfo.hasViewableResource(viewingCiv))
val baseTerrainTileLocation = tileSetStrings.getTile(tileInfo.baseTerrain) // e.g. Grassland
if (tileInfo.terrainFeature != null) { if (tileInfo.terrainFeature != null) {
// e.g. Grassland+Forest // e.g. Grassland+Forest
val baseTerrainAndFeatureTileLocation = "$baseTerrainTileLocation+${tileInfo.terrainFeature}" val baseTerrainAndFeatureTileLocation = "$baseTerrainTileLocation+${tileInfo.terrainFeature}"

View File

@ -54,7 +54,7 @@ class TileSetStrings {
fun getTerrainFeatureOverlay(terrainFeature: String) = getString(tileSetLocation, terrainFeature, overlay) fun getTerrainFeatureOverlay(terrainFeature: String) = getString(tileSetLocation, terrainFeature, overlay)
fun getCityTile(baseTerrain: String?, era: String?): String { fun getCityTile(baseTerrain: String?, era: String?): String {
if (baseTerrain != null && era != null) getString(tilesLocation, baseTerrain, city, tag, era) if (baseTerrain != null && era != null) return getString(tilesLocation, baseTerrain, city, tag, era)
if (era != null) return getString(tilesLocation, city, tag, era) if (era != null) return getString(tilesLocation, city, tag, era)
if (baseTerrain != null) return getString(tilesLocation, baseTerrain, "+", city) if (baseTerrain != null) return getString(tilesLocation, baseTerrain, "+", city)
else return cityTile else return cityTile