mirror of
https://github.com/yairm210/Unciv.git
synced 2024-12-22 16:14:24 +07:00
Fix foreign units flags fading (#8352)
Co-authored-by: tunerzinc@gmail.com <vfylfhby>
This commit is contained in:
parent
a507a0c15e
commit
8fa0343568
@ -100,11 +100,11 @@ class TileGroupIcons(val tileGroup: TileGroup) {
|
||||
|
||||
// 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 == viewingCiv) {
|
||||
if (unit.civInfo == viewingCiv && !unit.isIdle()) {
|
||||
newImage.actionGroup?.color?.a = 0.5f * UncivGame.Current.settings.unitIconOpacity
|
||||
}
|
||||
|
||||
if (unit.currentMovement == 0f) {
|
||||
if (unit.civInfo == viewingCiv && unit.currentMovement == 0f) {
|
||||
newImage.flagSelection.color?.apply { a *= 0.5f }
|
||||
newImage.flagBg.children?.forEach { it.color.apply { a *= 0.5f } }
|
||||
newImage.unitBaseImage.color.a *= 0.5f
|
||||
|
@ -145,7 +145,10 @@ class UnitGroup(val unit: MapUnit, val size: Float): Group() {
|
||||
}
|
||||
|
||||
// Unit base icon is faded out only if out of moves
|
||||
val alpha = if (unit.currentMovement == 0f) 0.5f else 1f
|
||||
// Foreign unit icons are never faded!
|
||||
val shouldBeFaded = (unit.owner == UncivGame.Current.worldScreen?.viewingCiv?.civName
|
||||
&& unit.currentMovement == 0f)
|
||||
val alpha = if (shouldBeFaded) 0.5f else 1f
|
||||
unitBaseImage.color.a = alpha
|
||||
flagBg.children.forEach { it.color.a = alpha }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user