From 5749fbe7eb1ad3ae073b4339c1be3f5408811c5c Mon Sep 17 00:00:00 2001 From: Exund Date: Sat, 12 Sep 2020 02:43:42 +0200 Subject: [PATCH] Add a setting to disable picking the miner when on a resource patch --- src/js/game/hud/parts/building_placer_logic.js | 2 +- src/js/profile/application_settings.js | 10 ++++++++-- translations/base-en.yaml | 5 +++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/js/game/hud/parts/building_placer_logic.js b/src/js/game/hud/parts/building_placer_logic.js index 686e6d1c..6031e555 100644 --- a/src/js/game/hud/parts/building_placer_logic.js +++ b/src/js/game/hud/parts/building_placer_logic.js @@ -327,7 +327,7 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart { 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) { + if (tileBelow && this.root.app.settings.getAllSettings().pickMinerOnPatch) { this.currentMetaBuilding.set(gMetaBuildingRegistry.findByClass(MetaMinerBuilding)); // Select chained miner if available, since thats always desired once unlocked diff --git a/src/js/profile/application_settings.js b/src/js/profile/application_settings.js index c9e8c1e0..74e6535d 100644 --- a/src/js/profile/application_settings.js +++ b/src/js/profile/application_settings.js @@ -277,6 +277,7 @@ export const allApplicationSettings = [ new BoolSetting("disableCutDeleteWarnings", enumCategories.advanced, (app, value) => {}), new BoolSetting("rotationByBuilding", enumCategories.advanced, (app, value) => {}), new BoolSetting("displayChunkBorders", enumCategories.advanced, (app, value) => {}), + new BoolSetting("pickMinerOnPatch", enumCategories.advanced, (app, value) => {}), new EnumSetting("refreshRate", { options: refreshRateOptions, @@ -323,6 +324,7 @@ class SettingsStorage { this.rotationByBuilding = true; this.clearCursorOnDeleteWhilePlacing = true; this.displayChunkBorders = false; + this.pickMinerOnPatch = true; this.enableColorBlindHelper = false; @@ -529,7 +531,7 @@ export class ApplicationSettings extends ReadWriteProxy { } getCurrentVersion() { - return 24; + return 25; } /** @param {{settings: SettingsStorage, version: number}} data */ @@ -636,7 +638,11 @@ export class ApplicationSettings extends ReadWriteProxy { data.settings.musicVolume = 1.0; data.settings.soundVolume = 1.0; data.settings.refreshRate = "60"; - data.version = 24; + } + + if(data.version < 25) { + data.settings.pickMinerOnPatch = true; + data.version = 25; } return ExplainedResult.good(); diff --git a/translations/base-en.yaml b/translations/base-en.yaml index d6acd7ea..4abedaed 100644 --- a/translations/base-en.yaml +++ b/translations/base-en.yaml @@ -885,6 +885,11 @@ settings: description: >- The game is divided into chunks of 16x16 tiles, if this setting is enabled the borders of each chunk are displayed. + pickMinerOnPatch: + title: Pick miner on resource patch + description: >- + Enabled by default, selects the miner if you use the pipette when hovering a resource patch. + keybindings: title: Keybindings hint: >-