mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-02-12 19:09:21 +00:00
add miner pipette
This commit is contained in:
parent
bc3f785d1b
commit
9dfc03ab63
@ -206,6 +206,14 @@ export class HUDBuildingsToolbar extends BaseHUDPart {
|
|||||||
|
|
||||||
const entity = this.root.map.getTileContent(worldTile);
|
const entity = this.root.map.getTileContent(worldTile);
|
||||||
if (!entity) {
|
if (!entity) {
|
||||||
|
const tileBelow = this.root.map.getLowerLayerContentXY(worldTile.x, worldTile.y);
|
||||||
|
if (tileBelow) {
|
||||||
|
let miner = gMetaBuildingRegistry.findByClass(MetaMinerBuilding);
|
||||||
|
let variants = miner.getAvailableVariants(this.root);
|
||||||
|
this.selectBuildingForPlacement(miner);
|
||||||
|
this.root.hud.parts.buildingPlacer.currentVariant.set(variants.pop());
|
||||||
|
}
|
||||||
|
// TODO: play error sound
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -217,6 +225,7 @@ export class HUDBuildingsToolbar extends BaseHUDPart {
|
|||||||
this.root.hud.parts.buildingPlacer.currentBaseRotation =
|
this.root.hud.parts.buildingPlacer.currentBaseRotation =
|
||||||
(Math.round(entity.components.StaticMapEntity.originalRotation / 90) * 90 + 360) % 360;
|
(Math.round(entity.components.StaticMapEntity.originalRotation / 90) * 90 + 360) % 360;
|
||||||
}
|
}
|
||||||
|
// TODO: play error sound
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user