diff --git a/core/src/mindustry/content/StatusEffects.java b/core/src/mindustry/content/StatusEffects.java index 121994ed2a..8f0a3cd60f 100644 --- a/core/src/mindustry/content/StatusEffects.java +++ b/core/src/mindustry/content/StatusEffects.java @@ -51,7 +51,7 @@ public class StatusEffects{ unmoving = new StatusEffect("unmoving"){{ color = Pal.gray; - speedMultiplier = 0.001f; + speedMultiplier = 0f; }}; slow = new StatusEffect("slow"){{ diff --git a/core/src/mindustry/ctype/UnlockableContent.java b/core/src/mindustry/ctype/UnlockableContent.java index 5fbc8e3aca..4471f7552c 100644 --- a/core/src/mindustry/ctype/UnlockableContent.java +++ b/core/src/mindustry/ctype/UnlockableContent.java @@ -100,16 +100,19 @@ public abstract class UnlockableContent extends MappableContent{ if(region instanceof AtlasRegion at && region.found()){ String name = at.name; if(!makeNew || !packer.has(name + "-outline")){ - PixmapRegion base = Core.atlas.getPixmap(region); - var result = Pixmaps.outline(base, outlineColor, outlineRadius); - Drawf.checkBleed(result); - packer.add(page, name + (makeNew ? "-outline" : ""), result); + String regName = name + (makeNew ? "-outline" : ""); + if(packer.registerOutlined(regName)){ + PixmapRegion base = Core.atlas.getPixmap(region); + var result = Pixmaps.outline(base, outlineColor, outlineRadius); + Drawf.checkBleed(result); + packer.add(page, regName, result); + } } } } protected void makeOutline(MultiPacker packer, TextureRegion region, String name, Color outlineColor, int outlineRadius){ - if(region.found()){ + if(region.found() && packer.registerOutlined(name)){ PixmapRegion base = Core.atlas.getPixmap(region); var result = Pixmaps.outline(base, outlineColor, outlineRadius); Drawf.checkBleed(result); diff --git a/core/src/mindustry/graphics/MultiPacker.java b/core/src/mindustry/graphics/MultiPacker.java index 71c80100e4..e28d2f35cb 100644 --- a/core/src/mindustry/graphics/MultiPacker.java +++ b/core/src/mindustry/graphics/MultiPacker.java @@ -3,12 +3,14 @@ package mindustry.graphics; import arc.graphics.*; import arc.graphics.Texture.*; import arc.graphics.g2d.*; +import arc.struct.*; import arc.util.*; import arc.util.Log.*; import mindustry.*; public class MultiPacker implements Disposable{ private PixmapPacker[] packers = new PixmapPacker[PageType.all.length]; + private ObjectSet outlined = new ObjectSet<>(); public MultiPacker(){ for(int i = 0; i < packers.length; i++){ @@ -48,6 +50,15 @@ public class MultiPacker implements Disposable{ } } + /** @return whether this image was not already outlined. */ + public boolean registerOutlined(String named){ + return outlined.add(named); + } + + public boolean isOutlined(String name){ + return outlined.contains(name); + } + public PixmapPacker getPacker(PageType type){ return packers[type.ordinal()]; } diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index 9a8b8beec3..908af3167f 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -883,6 +883,12 @@ public class UnitType extends UnlockableContent{ makeOutline(PageType.main, packer, outlineTarget, alwaysCreateOutline && region == outlineTarget, outlineColor, outlineRadius); } + if(sample instanceof Crawlc){ + for(int i = 0; i < segments; i++){ + makeOutline(packer, segmentRegions[i], name + "-segment-outline" + i, outlineColor, outlineRadius); + } + } + for(Weapon weapon : weapons){ if(!weapon.name.isEmpty()){ //TODO makeNew isn't really necessary here is it