From e0c455bca8ada8073efaa330c3d98aa5b90e9e40 Mon Sep 17 00:00:00 2001 From: Mythril382 <77225817+Mythril382@users.noreply.github.com> Date: Sat, 3 Aug 2024 12:53:45 +0800 Subject: [PATCH] Allow Mods To Modify RegionPart's Heat Light Region (#10048) * actually work * betterize i think --- core/src/mindustry/entities/part/RegionPart.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/entities/part/RegionPart.java b/core/src/mindustry/entities/part/RegionPart.java index 0088e46f34..4323f5f9aa 100644 --- a/core/src/mindustry/entities/part/RegionPart.java +++ b/core/src/mindustry/entities/part/RegionPart.java @@ -15,7 +15,7 @@ public class RegionPart extends DrawPart{ public String suffix = ""; /** Overrides suffix if set. */ public @Nullable String name; - public TextureRegion heat; + public TextureRegion heat, light; public TextureRegion[] regions = {}; public TextureRegion[] outlines = {}; @@ -133,7 +133,7 @@ public class RegionPart extends DrawPart{ float hprog = heatProgress.getClamp(params); heatColor.write(Tmp.c1).a(hprog * heatColor.a); Drawf.additive(heat, Tmp.c1, rx, ry, rot, turretShading ? turretHeatLayer : Draw.z() + heatLayerOffset); - if(heatLight) Drawf.light(rx, ry, heat, rot, Tmp.c1, heatLightOpacity * hprog); + if(heatLight) Drawf.light(rx, ry, light.found() ? light : heat, rot, Tmp.c1, heatLightOpacity * hprog); } Draw.xscl *= sign; @@ -187,6 +187,7 @@ public class RegionPart extends DrawPart{ } heat = Core.atlas.find(realName + "-heat"); + light = Core.atlas.find(realName + "-light"); for(var child : children){ child.turretShading = turretShading; child.load(name);