Skip to content

Commit

Permalink
move xray to the layer of turrets
Browse files Browse the repository at this point in the history
  • Loading branch information
xzxADIxzx committed Mar 1, 2025
1 parent 8c54793 commit 288ff71
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/java/schema/tools/Overlay.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import arc.util.*;
import mindustry.graphics.*;
import mindustry.world.*;
import mindustry.world.meta.*;
import schema.input.*;

import static arc.Core.*;
Expand All @@ -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 -> {
Expand Down Expand Up @@ -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 -> {
Expand Down Expand Up @@ -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(); }
Expand Down

0 comments on commit 288ff71

Please sign in to comment.