mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-19 20:28:56 +07:00
Fix selection opacity for non-full-opaque flags. (#8670)
Co-authored-by: vegeta1k95 <vfylfhby>
This commit is contained in:
@ -65,12 +65,12 @@ class TileLayerUnitFlag(tileGroup: TileGroup, size: Float) : TileLayer(tileGroup
|
||||
}
|
||||
|
||||
// Fade out action indicator for own non-idle units
|
||||
if (unit.civ == viewingCiv && !unit.isIdle())
|
||||
newIcon.actionGroup?.color?.a = 0.5f * UncivGame.Current.settings.unitIconOpacity
|
||||
if (unit.civ == viewingCiv && !unit.isIdle() && UncivGame.Current.settings.unitIconOpacity == 1f)
|
||||
newIcon.actionGroup?.color?.a = 0.5f
|
||||
|
||||
// Fade out flag for own out-of-moves units
|
||||
if (unit.civ == viewingCiv && unit.currentMovement == 0f)
|
||||
newIcon.color.a = 0.5f * UncivGame.Current.settings.unitIconOpacity
|
||||
if (unit.civ == viewingCiv && unit.currentMovement == 0f && UncivGame.Current.settings.unitIconOpacity == 1f)
|
||||
newIcon.color.a = 0.5f
|
||||
|
||||
}
|
||||
|
||||
|
@ -191,7 +191,7 @@ class UnitGroup(val unit: MapUnit, val size: Float): Group() {
|
||||
|
||||
fun selectUnit() {
|
||||
|
||||
val opacity = UncivGame.Current.settings.unitIconOpacity
|
||||
val opacity = 1f
|
||||
|
||||
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
|
||||
// Foreign unit icons are never faded!
|
||||
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
|
||||
flagIcon.color.a = alpha
|
||||
flagBg.color.a = alpha
|
||||
|
Reference in New Issue
Block a user