Skip to content

Commit

Permalink
Add option to always show enemy spawn
Browse files Browse the repository at this point in the history
  • Loading branch information
BalaM314 committed Dec 18, 2023
1 parent b9c2190 commit 4d28cd7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/src/mindustry/graphics/OverlayRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,11 @@ public void drawTop(){

if(state.hasSpawns()){
Core.camera.bounds(Tmp.r1);
boolean isBuilding = input.isBreaking() || input.isPlacing() || input.selectPlans.any() || Core.settings.getBool("alwaysshowdropzone", true);
int r = state.rules.dropZoneRadius;
for(Tile tile : spawner.getSpawns()){
if(tile.within(player.x, player.y, state.rules.dropZoneRadius + spawnerMargin) || (input.isBreaking() || input.isPlacing() || input.selectPlans.any()) && Tmp.r1.overlaps(tile.getX() - state.rules.dropZoneRadius, tile.getY() - state.rules.dropZoneRadius, state.rules.dropZoneRadius * 2, state.rules.dropZoneRadius * 2)){
Draw.alpha(input.isBreaking() || input.isPlacing() || input.selectPlans.any() ? 1 : Mathf.clamp(1f - (player.dst(tile) - state.rules.dropZoneRadius) / spawnerMargin));
if(tile.within(player.x, player.y, r + spawnerMargin) || (Tmp.r1.overlaps(tile.getX() - r, tile.getY() - r, r * 2, r * 2) && isBuilding)){
Draw.alpha(building ? 1 : Mathf.clamp(1f - (player.dst(tile) - state.rules.dropZoneRadius) / spawnerMargin));
Lines.dashCircle(tile.worldx(), tile.worldy(), state.rules.dropZoneRadius);
}
}
Expand Down

0 comments on commit 4d28cd7

Please sign in to comment.