mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 14:24:43 -04: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() {
|
fun selectUnit() {
|
||||||
|
|
||||||
//Make unit icons fully opaque when units are selected
|
//Make unit icon background colors fully opaque when units are selected
|
||||||
unitBaseImage.color.a = 1f
|
|
||||||
background?.color?.a = 1f
|
background?.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
|
actionGroup?.color?.a = 1f
|
||||||
|
}
|
||||||
|
|
||||||
val whiteHalo = getBackgroundImageForUnit()
|
val whiteHalo = getBackgroundImageForUnit()
|
||||||
val whiteHaloSize = 30f
|
val whiteHaloSize = 30f
|
||||||
|
Loading…
x
Reference in New Issue
Block a user