mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-23 03:23:17 -04:00
Fix selection opacity for non-full-opaque flags. (#8670)
Co-authored-by: vegeta1k95 <vfylfhby>
This commit is contained in:
parent
cc2d1bf6f2
commit
7b8a404fd6
@ -65,12 +65,12 @@ class TileLayerUnitFlag(tileGroup: TileGroup, size: Float) : TileLayer(tileGroup
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Fade out action indicator for own non-idle units
|
// Fade out action indicator for own non-idle units
|
||||||
if (unit.civ == viewingCiv && !unit.isIdle())
|
if (unit.civ == viewingCiv && !unit.isIdle() && UncivGame.Current.settings.unitIconOpacity == 1f)
|
||||||
newIcon.actionGroup?.color?.a = 0.5f * UncivGame.Current.settings.unitIconOpacity
|
newIcon.actionGroup?.color?.a = 0.5f
|
||||||
|
|
||||||
// Fade out flag for own out-of-moves units
|
// Fade out flag for own out-of-moves units
|
||||||
if (unit.civ == viewingCiv && unit.currentMovement == 0f)
|
if (unit.civ == viewingCiv && unit.currentMovement == 0f && UncivGame.Current.settings.unitIconOpacity == 1f)
|
||||||
newIcon.color.a = 0.5f * UncivGame.Current.settings.unitIconOpacity
|
newIcon.color.a = 0.5f
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -191,7 +191,7 @@ class UnitGroup(val unit: MapUnit, val size: Float): Group() {
|
|||||||
|
|
||||||
fun selectUnit() {
|
fun selectUnit() {
|
||||||
|
|
||||||
val opacity = UncivGame.Current.settings.unitIconOpacity
|
val opacity = 1f
|
||||||
|
|
||||||
color.a = opacity
|
color.a = opacity
|
||||||
|
|
||||||
@ -205,7 +205,7 @@ class UnitGroup(val unit: MapUnit, val size: Float): Group() {
|
|||||||
// Unit base icon is faded out only if out of moves
|
// Unit base icon is faded out only if out of moves
|
||||||
// Foreign unit icons are never faded!
|
// Foreign unit icons are never faded!
|
||||||
val shouldBeFaded = (unit.owner == UncivGame.Current.worldScreen?.viewingCiv?.civName
|
val shouldBeFaded = (unit.owner == UncivGame.Current.worldScreen?.viewingCiv?.civName
|
||||||
&& unit.currentMovement == 0f)
|
&& unit.currentMovement == 0f && UncivGame.Current.settings.unitIconOpacity == 1f)
|
||||||
val alpha = if (shouldBeFaded) opacity * 0.5f else opacity
|
val alpha = if (shouldBeFaded) opacity * 0.5f else opacity
|
||||||
flagIcon.color.a = alpha
|
flagIcon.color.a = alpha
|
||||||
flagBg.color.a = alpha
|
flagBg.color.a = alpha
|
||||||
|
Loading…
x
Reference in New Issue
Block a user