From c0e5595a3f2c792f5b6636ae1bc381956087533b Mon Sep 17 00:00:00 2001 From: tobspr Date: Wed, 24 Jun 2020 21:06:35 +0200 Subject: [PATCH] Allow clicking 'Q' over a shape or color patch to automatically select the miner building --- src/js/changelog.js | 1 + src/js/game/hud/parts/building_placer_logic.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/js/changelog.js b/src/js/changelog.js index 3884d397..cfa6acdb 100644 --- a/src/js/changelog.js +++ b/src/js/changelog.js @@ -6,6 +6,7 @@ export const CHANGELOG = [ "Preparations for the wires update", "Update belt placement performance on huge factories (by Phlosioneer)", "Allow clicking on variants to select them", + "Allow clicking 'Q' over a shape or color patch to automatically select the miner building (by Gerdon262)", "Add 'copy key' button to shape viewer", "Add setting (on by default) to store the last used rotation per building instead of globally storing it (by Magos)", "Added chinese (traditional) translation", diff --git a/src/js/game/hud/parts/building_placer_logic.js b/src/js/game/hud/parts/building_placer_logic.js index c4b82f64..179dfc45 100644 --- a/src/js/game/hud/parts/building_placer_logic.js +++ b/src/js/game/hud/parts/building_placer_logic.js @@ -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);