diff --git a/src/java/schema/tools/Overlay.java b/src/java/schema/tools/Overlay.java index 532e3cd..e074a6b 100644 --- a/src/java/schema/tools/Overlay.java +++ b/src/java/schema/tools/Overlay.java @@ -6,6 +6,7 @@ import arc.util.*; import mindustry.graphics.*; import mindustry.world.*; +import mindustry.world.meta.*; import schema.input.*; import static arc.Core.*; @@ -28,6 +29,12 @@ public class Overlay { /** Whether certain overlay elements should be drawn or not. */ public boolean ruler, borderless; + public Overlay() { + renderer.addEnvRenderer(Env.none, () -> Draw.draw(Layer.turret + 1f, () -> { + if (Keybind.display_xray.down()) drawXray(); + })); + } + /** Draws the elements of both vanilla and schema overlay */ public void draw() { state.rules.objectives.eachRunning(o -> { @@ -103,7 +110,6 @@ public void draw() { /** Draws floors above buildings to display ores under them. */ public void drawXray() { - if (!Keybind.display_xray.down()) return; if (tiles == null) tiles = Reflect.get(renderer.blocks, "tileview"); tiles.each(t -> { @@ -145,7 +151,7 @@ public void render() { public class Agent extends OverlayRenderer { @Override - public void drawBottom() { insys.drawPlans(); drawXray(); } + public void drawBottom() { insys.drawPlans(); } @Override public void drawTop() { draw(); }