Merge pull request #283 from Gerdon262/feature/ore-q-ing
Allow Q-ing on a ore-/shape-patch
This commit is contained in:
commit
a17316b1d7
|
@ -11,6 +11,8 @@ import { KEYMAPPINGS } from "../../key_action_mapper";
|
||||||
import { defaultBuildingVariant, MetaBuilding } from "../../meta_building";
|
import { defaultBuildingVariant, MetaBuilding } from "../../meta_building";
|
||||||
import { BaseHUDPart } from "../base_hud_part";
|
import { BaseHUDPart } from "../base_hud_part";
|
||||||
import { SOUNDS } from "../../../platform/sound";
|
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
|
* 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 worldPos = this.root.camera.screenToWorld(mousePosition);
|
||||||
const tile = worldPos.toTileSpace();
|
const tile = worldPos.toTileSpace();
|
||||||
const contents = this.root.map.getTileContent(tile);
|
|
||||||
|
|
||||||
|
const contents = this.root.map.getTileContent(tile);
|
||||||
if (!contents) {
|
if (!contents) {
|
||||||
|
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);
|
this.currentMetaBuilding.set(null);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue