From b038e926a4f3661d9093045bcb69e56aeffad52b Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Sun, 15 Sep 2019 18:15:57 +0300 Subject: [PATCH] Idle units are much more visible on the map Technically, nstead of fading out the entire unit with its background, we just fade out its central icon, that way it remains much more visible on the map --- core/src/com/unciv/ui/tilegroups/TileGroup.kt | 5 ++++- core/src/com/unciv/ui/utils/UnitGroup.kt | 4 ++-- core/src/com/unciv/ui/worldscreen/WorldScreen.kt | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/core/src/com/unciv/ui/tilegroups/TileGroup.kt b/core/src/com/unciv/ui/tilegroups/TileGroup.kt index d37880d3b0..5552682dd2 100644 --- a/core/src/com/unciv/ui/tilegroups/TileGroup.kt +++ b/core/src/com/unciv/ui/tilegroups/TileGroup.kt @@ -451,7 +451,10 @@ open class TileGroup(var tileInfo: TileInfo, var tileSetStrings:TileSetStrings) newImage.center(this) newImage.y += yFromCenter - if (!unit.isIdle() && unit.civInfo.isPlayerCivilization()) newImage.color.a = 0.5f + // Instead of fading out the entire unit with its background, we just fade out its central icon, + // that way it remains much more visible on the map + if (!unit.isIdle() && unit.civInfo.isPlayerCivilization()) + newImage.unitBaseImage.color.a = 0.5f } return newImage } diff --git a/core/src/com/unciv/ui/utils/UnitGroup.kt b/core/src/com/unciv/ui/utils/UnitGroup.kt index be1d2ae8b8..c1bf96c732 100644 --- a/core/src/com/unciv/ui/utils/UnitGroup.kt +++ b/core/src/com/unciv/ui/utils/UnitGroup.kt @@ -9,10 +9,10 @@ import com.unciv.logic.map.MapUnit class UnitGroup(val unit: MapUnit, val size: Float): Group() { var blackSpinningCircle:Image?=null + val unitBaseImage = ImageGetter.getUnitIcon(unit.name, unit.civInfo.nation.getInnerColor()) + .apply { setSize(size * 0.75f, size * 0.75f) } init { - val unitBaseImage = ImageGetter.getUnitIcon(unit.name, unit.civInfo.nation.getInnerColor()) - .apply { setSize(size * 0.75f, size * 0.75f) } val background = getBackgroundImageForUnit(unit) background.apply { diff --git a/core/src/com/unciv/ui/worldscreen/WorldScreen.kt b/core/src/com/unciv/ui/worldscreen/WorldScreen.kt index 23a763a175..e2ad6671e8 100644 --- a/core/src/com/unciv/ui/worldscreen/WorldScreen.kt +++ b/core/src/com/unciv/ui/worldscreen/WorldScreen.kt @@ -253,8 +253,8 @@ class WorldScreen(val viewingCiv:CivilizationInfo) : CameraStageBaseScreen() { val buttonPic = Table() buttonPic.background = ImageGetter.getDrawable("OtherIcons/civTableBackground") .tint(colorFromRGB(7, 46, 43)) - buttonPic.defaults().pad(10f) - buttonPic.add("{Pick a tech}!".toLabel().setFontColor(Color.WHITE).setFontSize(22)) + buttonPic.defaults().pad(20f) + buttonPic.add("{Pick a tech}!".toLabel().setFontColor(Color.WHITE).setFontSize(24)) techButtonHolder.add(buttonPic) } else {