mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-12-12 17:51:50 +00:00
added Multi Layer Copying
This commit is contained in:
parent
d33a72202a
commit
129c2baec7
@ -243,8 +243,9 @@ export class HUDMassSelector extends BaseHUDPart {
|
||||
|
||||
for(let x = realTileStart.x; x <= realTileEnd.x; ++x) {
|
||||
for(let y = realTileStart.y; y <= realTileEnd.y; ++y) {
|
||||
const contents = this.root.map.getLayerContentXY(x, y, this.root.currentLayer);
|
||||
if (contents && this.root.logic.canDeleteBuilding(contents)) {
|
||||
|
||||
for(let contents of this.root.map.getLayersContentsMultipleXY(x, y)){
|
||||
if(this.root.logic.canDeleteBuilding(contents))
|
||||
this.selectedUids.add(contents.uid);
|
||||
}
|
||||
}
|
||||
@ -294,16 +295,18 @@ export class HUDMassSelector extends BaseHUDPart {
|
||||
|
||||
for(let x = realTileStart.x; x <= realTileEnd.x; ++x) {
|
||||
for(let y = realTileStart.y; y <= realTileEnd.y; ++y) {
|
||||
const contents = this.root.map.getLayerContentXY(x, y, this.root.currentLayer);
|
||||
if (contents && this.root.logic.canDeleteBuilding(contents)) {
|
||||
|
||||
for(let component of this.root.map.getLayersContentsMultipleXY(x, y)) {
|
||||
|
||||
if(component && this.root.logic.canDeleteBuilding(component)) {
|
||||
// Prevent rendering the overlay twice
|
||||
const uid = contents.uid;
|
||||
const uid = component.uid;
|
||||
if(renderedUids.has(uid)) {
|
||||
continue;
|
||||
}
|
||||
renderedUids.add(uid);
|
||||
|
||||
const staticComp = contents.components.StaticMapEntity;
|
||||
const staticComp = component.components.StaticMapEntity;
|
||||
const bounds = staticComp.getTileSpaceBounds();
|
||||
parameters.context.beginRoundedRect(
|
||||
bounds.x * globalConfig.tileSize + boundsBorder,
|
||||
@ -317,6 +320,7 @@ export class HUDMassSelector extends BaseHUDPart {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
parameters.context.fillStyle = THEME.map.selectionOverlay;
|
||||
this.selectedUids.forEach(uid => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user