From fff8f567d0b39bab265c2b294a1f563fa0eb75b3 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 1 Apr 2023 17:30:05 -0400 Subject: [PATCH] Hide weapon sprites for certain units --- core/src/mindustry/content/UnitTypes.java | 2 ++ core/src/mindustry/type/Weapon.java | 2 ++ core/src/mindustry/world/meta/StatValues.java | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index fced520ba1..ffd418a857 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -2948,6 +2948,7 @@ public class UnitTypes{ weapons.add(new Weapon("merui-weapon"){{ shootSound = Sounds.missile; mirror = false; + showStatSprite = false; x = 0f; y = 1f; shootY = 4f; @@ -3151,6 +3152,7 @@ public class UnitTypes{ x = 29f / 4f; y = -11f / 4f; shootY = 1.5f; + showStatSprite = false; reload = 130f; layerOffset = 0.01f; heatColor = Color.red; diff --git a/core/src/mindustry/type/Weapon.java b/core/src/mindustry/type/Weapon.java index ccc82ecbc0..5b56d1c9fb 100644 --- a/core/src/mindustry/type/Weapon.java +++ b/core/src/mindustry/type/Weapon.java @@ -43,6 +43,8 @@ public class Weapon implements Cloneable{ public boolean alternate = true; /** whether to rotate toward the target independently of unit */ public boolean rotate = false; + /** Whether to show the sprite of the weapon in the database. */ + public boolean showStatSprite = true; /** rotation at which this weapon starts at. TODO buggy!*/ public float baseRotation = 0f; /** whether to draw the outline on top. */ diff --git a/core/src/mindustry/world/meta/StatValues.java b/core/src/mindustry/world/meta/StatValues.java index a840d62d53..04b162941c 100644 --- a/core/src/mindustry/world/meta/StatValues.java +++ b/core/src/mindustry/world/meta/StatValues.java @@ -296,7 +296,7 @@ public class StatValues{ table.table(Styles.grayPanel, w -> { w.left().top().defaults().padRight(3).left(); - if(region != null && region.found()) w.image(region).size(60).scaling(Scaling.bounded).left().top(); + if(region != null && region.found() && weapon.showStatSprite) w.image(region).size(60).scaling(Scaling.bounded).left().top(); w.row(); weapon.addStats(unit, w);