mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-25 22:59:12 +07:00
Update UnitGroup.kt (#7375)
Handle unitBaseImage and actionGroup layers of unit icons properly if unit is idle
This commit is contained in:
parent
99367c2212
commit
f3e043cd8f
@ -71,10 +71,17 @@ class UnitGroup(val unit: MapUnit, val size: Float): Group() {
|
||||
|
||||
fun selectUnit() {
|
||||
|
||||
//Make unit icons fully opaque when units are selected
|
||||
unitBaseImage.color.a = 1f
|
||||
//Make unit icon background colors fully opaque when units are selected
|
||||
background?.color?.a = 1f
|
||||
actionGroup?.color?.a = 1f
|
||||
|
||||
//If unit is idle, leave unitBaseImage and actionGroup at 50% opacity when selected
|
||||
if (!unit.isIdle()) {
|
||||
unitBaseImage.color.a = 0.5f
|
||||
actionGroup?.color?.a = 0.5f
|
||||
} else { //Else set to 100% opacity when selected
|
||||
unitBaseImage.color.a = 1f
|
||||
actionGroup?.color?.a = 1f
|
||||
}
|
||||
|
||||
val whiteHalo = getBackgroundImageForUnit()
|
||||
val whiteHaloSize = 30f
|
||||
|
Loading…
Reference in New Issue
Block a user