mirror of
https://github.com/yairm210/Unciv.git
synced 2025-10-02 08:22:08 -04:00
More tile configurations are enabled (e.g. "baseTile+resource+improvement")
This commit is contained in:
parent
a9660bba44
commit
02d2e29700
@ -147,13 +147,13 @@ 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 shouldShowImprovement = tileInfo.improvement != null && UncivGame.Current.settings.showPixelImprovements
|
||||||
val shouldShowResource = UncivGame.Current.settings.showPixelImprovements
|
val shouldShowResource = UncivGame.Current.settings.showPixelImprovements
|
||||||
&& tileInfo.resource!=null &&
|
&& tileInfo.resource != null &&
|
||||||
(showEntireMap || viewingCiv==null || tileInfo.hasViewableResource(viewingCiv))
|
(showEntireMap || viewingCiv == null || tileInfo.hasViewableResource(viewingCiv))
|
||||||
val baseTerrainTileLocation = tileSetStrings.getTile(tileInfo.baseTerrain) // e.g. Grassland
|
val baseTerrainTileLocation = tileSetStrings.getTile(tileInfo.baseTerrain) // e.g. Grassland
|
||||||
|
|
||||||
|
|
||||||
@ -175,8 +175,7 @@ open class TileGroup(var tileInfo: TileInfo, var tileSetStrings:TileSetStrings)
|
|||||||
return listOf(tileSetStrings.cityTile)
|
return listOf(tileSetStrings.cityTile)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tileInfo.isNaturalWonder())
|
if (tileInfo.isNaturalWonder()) {
|
||||||
{
|
|
||||||
val naturalWonder = tileSetStrings.getTile(tileInfo.naturalWonder!!)
|
val naturalWonder = tileSetStrings.getTile(tileInfo.naturalWonder!!)
|
||||||
if (ImageGetter.imageExists(naturalWonder))
|
if (ImageGetter.imageExists(naturalWonder))
|
||||||
return listOf(naturalWonder)
|
return listOf(naturalWonder)
|
||||||
@ -186,20 +185,20 @@ open class TileGroup(var tileInfo: TileInfo, var tileSetStrings:TileSetStrings)
|
|||||||
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}"
|
||||||
if(shouldShowImprovement && shouldShowResource){
|
if (shouldShowImprovement && shouldShowResource) {
|
||||||
// e.g. Grassland+Forest+Deer+Camp
|
// e.g. Grassland+Forest+Deer+Camp
|
||||||
val baseFeatureImprovementAndResourceLocation =
|
val baseFeatureImprovementAndResourceLocation =
|
||||||
"$baseTerrainAndFeatureTileLocation+${tileInfo.improvement}+${tileInfo.resource}"
|
"$baseTerrainAndFeatureTileLocation+${tileInfo.improvement}+${tileInfo.resource}"
|
||||||
if (ImageGetter.imageExists(baseFeatureImprovementAndResourceLocation))
|
if (ImageGetter.imageExists(baseFeatureImprovementAndResourceLocation))
|
||||||
return listOf(baseFeatureImprovementAndResourceLocation)
|
return listOf(baseFeatureImprovementAndResourceLocation)
|
||||||
}
|
}
|
||||||
if(shouldShowImprovement){
|
if (shouldShowImprovement) {
|
||||||
// e.g. Grassland+Forest+Lumber mill
|
// e.g. Grassland+Forest+Lumber mill
|
||||||
val baseFeatureAndImprovementTileLocation = "$baseTerrainAndFeatureTileLocation+${tileInfo.improvement}"
|
val baseFeatureAndImprovementTileLocation = "$baseTerrainAndFeatureTileLocation+${tileInfo.improvement}"
|
||||||
if (ImageGetter.imageExists(baseFeatureAndImprovementTileLocation))
|
if (ImageGetter.imageExists(baseFeatureAndImprovementTileLocation))
|
||||||
return listOf(baseFeatureAndImprovementTileLocation)
|
return listOf(baseFeatureAndImprovementTileLocation)
|
||||||
}
|
}
|
||||||
if(shouldShowResource){
|
if (shouldShowResource) {
|
||||||
// e.g. Grassland+Forest+Silver
|
// e.g. Grassland+Forest+Silver
|
||||||
val baseTerrainFeatureAndResourceLocation = "$baseTerrainAndFeatureTileLocation+${tileInfo.resource}"
|
val baseTerrainFeatureAndResourceLocation = "$baseTerrainAndFeatureTileLocation+${tileInfo.resource}"
|
||||||
if (ImageGetter.imageExists(baseTerrainFeatureAndResourceLocation))
|
if (ImageGetter.imageExists(baseTerrainFeatureAndResourceLocation))
|
||||||
@ -207,10 +206,10 @@ open class TileGroup(var tileInfo: TileInfo, var tileSetStrings:TileSetStrings)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ImageGetter.imageExists(baseTerrainAndFeatureTileLocation)) {
|
if (ImageGetter.imageExists(baseTerrainAndFeatureTileLocation)) {
|
||||||
if(shouldShowImprovement){
|
if (shouldShowImprovement) {
|
||||||
val improvementImageLocation = tileSetStrings.getTile(tileInfo.improvement!!)
|
val improvementImageLocation = tileSetStrings.getTile(tileInfo.improvement!!)
|
||||||
// E.g. (Desert+Flood plains, Moai)
|
// E.g. (Desert+Flood plains, Moai)
|
||||||
if(ImageGetter.imageExists(improvementImageLocation))
|
if (ImageGetter.imageExists(improvementImageLocation))
|
||||||
return listOf(baseTerrainAndFeatureTileLocation, improvementImageLocation)
|
return listOf(baseTerrainAndFeatureTileLocation, improvementImageLocation)
|
||||||
}
|
}
|
||||||
return listOf(baseTerrainAndFeatureTileLocation)
|
return listOf(baseTerrainAndFeatureTileLocation)
|
||||||
@ -218,28 +217,43 @@ open class TileGroup(var tileInfo: TileInfo, var tileSetStrings:TileSetStrings)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// No terrain feature
|
// No terrain feature
|
||||||
if(shouldShowImprovement){
|
if (shouldShowImprovement) {
|
||||||
// E.g. Grassland+Farm
|
if (shouldShowImprovement && shouldShowResource) {
|
||||||
val baseTerrainAndImprovement = "$baseTerrainTileLocation+${tileInfo.improvement}"
|
// e.g. Desert+Farm+Wheat
|
||||||
if (ImageGetter.imageExists(baseTerrainAndImprovement))
|
val baseImprovementAndResourceLocation =
|
||||||
return listOf(baseTerrainAndImprovement)
|
"$baseTerrainTileLocation+${tileInfo.improvement}+${tileInfo.resource}"
|
||||||
|
if (ImageGetter.imageExists(baseImprovementAndResourceLocation))
|
||||||
|
return listOf(baseImprovementAndResourceLocation)
|
||||||
|
}
|
||||||
|
if (shouldShowImprovement) {
|
||||||
|
// e.g. Desert+Farm
|
||||||
|
val baseTerrainAndImprovementLocation = "$baseTerrainTileLocation+${tileInfo.improvement}"
|
||||||
|
if (ImageGetter.imageExists(baseTerrainAndImprovementLocation))
|
||||||
|
return listOf(baseTerrainAndImprovementLocation)
|
||||||
|
}
|
||||||
|
if (shouldShowResource) {
|
||||||
|
// e.g. Desert+Wheat
|
||||||
|
val baseTerrainAndResourceLocation = "$baseTerrainTileLocation+${tileInfo.resource}"
|
||||||
|
if (ImageGetter.imageExists(baseTerrainAndResourceLocation))
|
||||||
|
return listOf(baseTerrainAndResourceLocation)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImageGetter.imageExists(baseTerrainTileLocation)){
|
if (ImageGetter.imageExists(baseTerrainTileLocation)) {
|
||||||
if(shouldShowImprovement){
|
if (shouldShowImprovement) {
|
||||||
val improvementImageLocation = tileSetStrings.getTile(tileInfo.improvement!!)
|
val improvementImageLocation = tileSetStrings.getTile(tileInfo.improvement!!)
|
||||||
if(shouldShowResource){
|
if (shouldShowResource) {
|
||||||
// E.g. (Grassland, Plantation+Spices)
|
// E.g. (Grassland, Plantation+Spices)
|
||||||
val improvementAndResourceImageLocation = improvementImageLocation+"+${tileInfo.resource}"
|
val improvementAndResourceImageLocation = improvementImageLocation + "+${tileInfo.resource}"
|
||||||
if(ImageGetter.imageExists(improvementAndResourceImageLocation))
|
if (ImageGetter.imageExists(improvementAndResourceImageLocation))
|
||||||
return listOf(baseTerrainTileLocation,improvementAndResourceImageLocation)
|
return listOf(baseTerrainTileLocation, improvementAndResourceImageLocation)
|
||||||
}
|
}
|
||||||
// E.g. (Desert, Mine)
|
// E.g. (Desert, Mine)
|
||||||
if(ImageGetter.imageExists(improvementImageLocation))
|
if (ImageGetter.imageExists(improvementImageLocation))
|
||||||
return listOf(baseTerrainTileLocation, improvementImageLocation)
|
return listOf(baseTerrainTileLocation, improvementImageLocation)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(shouldShowResource){
|
if (shouldShowResource) {
|
||||||
// e.g. (Plains, Gems)
|
// e.g. (Plains, Gems)
|
||||||
val resourceImageLocation = tileSetStrings.getTile(tileInfo.resource!!)
|
val resourceImageLocation = tileSetStrings.getTile(tileInfo.resource!!)
|
||||||
if (ImageGetter.imageExists(resourceImageLocation))
|
if (ImageGetter.imageExists(resourceImageLocation))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user