From 9cbdee4b1253e6da1393e5d37608bb7aa4272eca Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Wed, 23 May 2018 21:45:43 +0300 Subject: [PATCH] White halo around selected unit is now shield-shaped iff the unit is fortified --- core/src/com/unciv/ui/tilegroups/WorldTileGroup.kt | 13 +++++++------ core/src/com/unciv/ui/worldscreen/TileMapHolder.kt | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/core/src/com/unciv/ui/tilegroups/WorldTileGroup.kt b/core/src/com/unciv/ui/tilegroups/WorldTileGroup.kt index 1c676091..86677396 100644 --- a/core/src/com/unciv/ui/tilegroups/WorldTileGroup.kt +++ b/core/src/com/unciv/ui/tilegroups/WorldTileGroup.kt @@ -18,12 +18,13 @@ import com.unciv.ui.utils.center class WorldTileGroup(tileInfo: TileInfo) : TileGroup(tileInfo) { var cityButton: Table? = null - fun addWhiteCircleAroundUnit(){ - val whiteCircle = ImageGetter.getImage("UnitIcons/Circle.png") - whiteCircle.setSize(25f,25f) - whiteCircle.center(unitImage!!) - unitImage!!.addActor(whiteCircle) - whiteCircle.toBack() + fun addWhiteHaloAroundUnit(){ + val whiteHalo = if(tileInfo.unit!!.isFortified()) ImageGetter.getImage("UnitIcons/Shield.png") + else ImageGetter.getImage("UnitIcons/Circle.png") + whiteHalo.setSize(25f,25f) + whiteHalo.center(unitImage!!) + unitImage!!.addActor(whiteHalo) + whiteHalo.toBack() } diff --git a/core/src/com/unciv/ui/worldscreen/TileMapHolder.kt b/core/src/com/unciv/ui/worldscreen/TileMapHolder.kt index 885a1b5e..a98e0e1d 100644 --- a/core/src/com/unciv/ui/worldscreen/TileMapHolder.kt +++ b/core/src/com/unciv/ui/worldscreen/TileMapHolder.kt @@ -100,7 +100,7 @@ class TileMapHolder(internal val worldScreen: WorldScreen, internal val tileMap: if(worldScreen.bottomBar.unitTable.selectedUnit!=null){ val unit = worldScreen.bottomBar.unitTable.selectedUnit!! - tileGroups[unit.getTile()]!!.addWhiteCircleAroundUnit() + tileGroups[unit.getTile()]!!.addWhiteHaloAroundUnit() val attackableTiles:List when(unit.getBaseUnit().unitType){ UnitType.Civilian -> return