internal static void UpdateIndicators(ActorClassIconElement classIcon, TacticalActorBase actor) { if (classIcon?.MainClassIconMask == null) { return; } if (defaultColor == null) { defaultColor = classIcon.MainClassIconMask.color; locatedColor = toColor(Mod.Config.locatedColor); revealedColor = toColor(Mod.Config.revealedColor); alertedColor = toColor(Mod.Config.alertedColor); } Color color = defaultColor.Value; if (enemyFactions.Contains(actor.TacticalFaction.Vision)) { if (actor.AIActor?.IsAlerted ?? false) { color = alertedColor; } } else if (!actor.IsDead) { if (enemyFactions.Where(facVis => facVis.IsRevealed(actor)).Any()) { color = revealedColor; } else if (enemyFactions.Where(facVis => facVis.IsLocated(actor)).Any()) { color = locatedColor; } } UpdateIndicator(classIcon, color); }
private static void UpdateIndicator(ActorClassIconElement classIcon, Color color) { classIcon.MainClassIcon.color = color; if (classIcon.SecondaryClassIcon != null) { classIcon.SecondaryClassIcon.color = color; } }