1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-03-02 03:39:21 +00:00

Allow clicking 'Q' over a shape or color patch to automatically select the miner building

This commit is contained in:
tobspr
2020-06-24 21:06:35 +02:00
parent a17316b1d7
commit c0e5595a3f
2 changed files with 6 additions and 1 deletions

View File

@@ -289,10 +289,14 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart {
const contents = this.root.map.getTileContent(tile);
if (!contents) {
const tileBelow = this.root.map.getLowerLayerContentXY(tile.x, tile.y);
// Check if there's a shape or color item below, if so select the miner
if (tileBelow) {
this.currentMetaBuilding.set(gMetaBuildingRegistry.findByClass(MetaMinerBuilding));
// Select chained miner if available, since thats always desired once unlocked
if (this.root.hubGoals.isRewardUnlocked(enumHubGoalRewards.reward_miner_chainable)) {
return this.currentVariant.set(enumMinerVariants.chainable);
this.currentVariant.set(enumMinerVariants.chainable);
}
} else {
this.currentMetaBuilding.set(null);