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

Merge pull request #283 from Gerdon262/feature/ore-q-ing

Allow Q-ing on a ore-/shape-patch
This commit is contained in:
tobspr
2020-06-24 21:04:38 +02:00
committed by GitHub

View File

@@ -11,6 +11,8 @@ import { KEYMAPPINGS } from "../../key_action_mapper";
import { defaultBuildingVariant, MetaBuilding } from "../../meta_building";
import { BaseHUDPart } from "../base_hud_part";
import { SOUNDS } from "../../../platform/sound";
import { MetaMinerBuilding, enumMinerVariants } from "../../buildings/miner";
import { enumHubGoalRewards } from "../../tutorial_goals";
/**
* Contains all logic for the building placer - this doesn't include the rendering
@@ -283,10 +285,18 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart {
const worldPos = this.root.camera.screenToWorld(mousePosition);
const tile = worldPos.toTileSpace();
const contents = this.root.map.getTileContent(tile);
const contents = this.root.map.getTileContent(tile);
if (!contents) {
this.currentMetaBuilding.set(null);
const tileBelow = this.root.map.getLowerLayerContentXY(tile.x, tile.y);
if (tileBelow) {
this.currentMetaBuilding.set(gMetaBuildingRegistry.findByClass(MetaMinerBuilding));
if (this.root.hubGoals.isRewardUnlocked(enumHubGoalRewards.reward_miner_chainable)) {
return this.currentVariant.set(enumMinerVariants.chainable);
}
} else {
this.currentMetaBuilding.set(null);
}
return;
}