From fdf08ed51d9d589a1e939873b37671d4f5ea30a1 Mon Sep 17 00:00:00 2001 From: Patrick 'Quezler' Mounier Date: Tue, 5 Jan 2021 16:43:36 +0100 Subject: [PATCH] Highlight all linked inventories on core selection (#4256) * Highlight all linked inventories on core selection * Loop cores instead of storage blocks --- .../mindustry/world/blocks/storage/CoreBlock.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/src/mindustry/world/blocks/storage/CoreBlock.java b/core/src/mindustry/world/blocks/storage/CoreBlock.java index 677c3a83b6..13e84e1dd8 100644 --- a/core/src/mindustry/world/blocks/storage/CoreBlock.java +++ b/core/src/mindustry/world/blocks/storage/CoreBlock.java @@ -296,17 +296,17 @@ public class CoreBlock extends StorageBlock{ @Override public void drawSelect(){ Lines.stroke(1f, Pal.accent); - Cons outline = t -> { + Cons outline = b -> { for(int i = 0; i < 4; i++){ Point2 p = Geometry.d8edge[i]; - float offset = -Math.max(t.block.size - 1, 0) / 2f * tilesize; - Draw.rect("block-select", t.x + offset * p.x, t.y + offset * p.y, i * 90); + float offset = -Math.max(b.block.size - 1, 0) / 2f * tilesize; + Draw.rect("block-select", b.x + offset * p.x, b.y + offset * p.y, i * 90); } }; - if(proximity.contains(e -> owns(e) && e.items == items)){ - outline.get(this); - } - proximity.each(e -> owns(e) && e.items == items, outline); + team.cores().each(core -> { + outline.get(core); + core.proximity.each(storage -> storage.items == items, outline); + }); Draw.reset(); }