From f12085e6196464c385a6d7f7d757bd3e3b7570fb Mon Sep 17 00:00:00 2001 From: hydrophobis <142858559+hydrophobis@users.noreply.github.com> Date: Fri, 25 Oct 2024 19:30:16 -0500 Subject: [PATCH] Add colorable shields for shield generators (#10232) * Add colorable shields for shield generators Just added a shieldColor variable which defaults to team.color if it is not set or is set to Null * Added @Nullable to BaseShield -> shieldColor --- core/src/mindustry/world/blocks/defense/BaseShield.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/world/blocks/defense/BaseShield.java b/core/src/mindustry/world/blocks/defense/BaseShield.java index 32bc077e8f..bb1f0dd6fe 100644 --- a/core/src/mindustry/world/blocks/defense/BaseShield.java +++ b/core/src/mindustry/world/blocks/defense/BaseShield.java @@ -19,6 +19,8 @@ public class BaseShield extends Block{ //TODO game rule? or field? should vary by base. public float radius = 200f; public int sides = 24; + + public @Nullable Color shieldColor; protected static BaseShieldBuild paramBuild; //protected static Effect paramEffect; @@ -125,7 +127,7 @@ public class BaseShield extends Block{ Draw.z(Layer.shields); - Draw.color(team.color, Color.white, Mathf.clamp(hit)); + Draw.color(shieldColor == null ? team.color : shieldColor, Color.white, Mathf.clamp(hit)); if(renderer.animateShields){ Fill.poly(x, y, sides, radius);