Highlight all linked inventories on core selection (#4256)
* Highlight all linked inventories on core selection * Loop cores instead of storage blocks
This commit is contained in:
committed by
GitHub
parent
42fb6ffa0d
commit
fdf08ed51d
@@ -296,17 +296,17 @@ public class CoreBlock extends StorageBlock{
|
|||||||
@Override
|
@Override
|
||||||
public void drawSelect(){
|
public void drawSelect(){
|
||||||
Lines.stroke(1f, Pal.accent);
|
Lines.stroke(1f, Pal.accent);
|
||||||
Cons<Building> outline = t -> {
|
Cons<Building> outline = b -> {
|
||||||
for(int i = 0; i < 4; i++){
|
for(int i = 0; i < 4; i++){
|
||||||
Point2 p = Geometry.d8edge[i];
|
Point2 p = Geometry.d8edge[i];
|
||||||
float offset = -Math.max(t.block.size - 1, 0) / 2f * tilesize;
|
float offset = -Math.max(b.block.size - 1, 0) / 2f * tilesize;
|
||||||
Draw.rect("block-select", t.x + offset * p.x, t.y + offset * p.y, i * 90);
|
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)){
|
team.cores().each(core -> {
|
||||||
outline.get(this);
|
outline.get(core);
|
||||||
}
|
core.proximity.each(storage -> storage.items == items, outline);
|
||||||
proximity.each(e -> owns(e) && e.items == items, outline);
|
});
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user