Hidden tiles no longer visible from inside the city screen - kudos flecheapolinienne!

This commit is contained in:
Yair Morgenstern 2018-12-10 11:40:34 +02:00
parent 41df61c92e
commit 6dbf6232e9
2 changed files with 9 additions and 4 deletions

View file

@ -2,6 +2,7 @@ package com.unciv.ui.cityscreen
import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.utils.Align
import com.unciv.UnCivGame
import com.unciv.logic.city.CityInfo
import com.unciv.logic.map.TileInfo
import com.unciv.ui.tilegroups.TileGroup
@ -20,7 +21,10 @@ class CityTileGroup(private val city: CityInfo, tileInfo: TileInfo) : TileGroup(
}
fun update() {
super.update(true,true)
val canSeeTile = UnCivGame.Current.viewEntireMapForDebug
|| city.civInfo.viewableTiles.contains(tileInfo)
super.update(canSeeTile,true)
updatePopulationImage()
if (improvementImage != null) improvementImage!!.setColor(1f, 1f, 1f, 0.5f)

View file

@ -185,10 +185,11 @@ class TileMapHolder(internal val worldScreen: WorldScreen, internal val tileMap:
cityButtonOverlays.clear()
for (tileGroup in tileGroups.values){
tileGroup.update(playerViewableTilePositions.contains(tileGroup.tileInfo.position))
val canSeeTile = UnCivGame.Current.viewEntireMapForDebug
|| playerViewableTilePositions.contains(tileGroup.tileInfo.position)
tileGroup.update(canSeeTile)
val unitsInTile = tileGroup.tileInfo.getUnits()
if((UnCivGame.Current.viewEntireMapForDebug || playerViewableTilePositions.contains(tileGroup.tileInfo.position))
&& unitsInTile.isNotEmpty() && !unitsInTile.first().civInfo.isPlayerCivilization())
if(canSeeTile && unitsInTile.isNotEmpty() && !unitsInTile.first().civInfo.isPlayerCivilization())
tileGroup.showCircle(Color.RED) // Display ALL viewable enemies with a red circle so that users don't need to go "hunting" for enemy units
}