diff --git a/src/js/game/hud/parts/building_placer_logic.js b/src/js/game/hud/parts/building_placer_logic.js index c91d7200..ae496790 100644 --- a/src/js/game/hud/parts/building_placer_logic.js +++ b/src/js/game/hud/parts/building_placer_logic.js @@ -706,7 +706,10 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart { } // Deletion - if (button === enumMouseButton.right && !metaBuilding) { + if ( + button === enumMouseButton.right && + (!metaBuilding || this.root.app.settings.getSetting("canDeleteWhileBuilding")) + ) { this.currentlyDragging = true; this.currentlyDeleting = true; this.lastDragTile = this.root.camera.screenToWorld(pos).toTileSpace(); @@ -715,7 +718,11 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart { } // Cancel placement - if (button === enumMouseButton.right && metaBuilding) { + if ( + button === enumMouseButton.right && + metaBuilding && + !this.root.app.settings.getSetting("canDeleteWhileBuilding") + ) { this.currentMetaBuilding.set(null); } } diff --git a/src/js/profile/application_settings.js b/src/js/profile/application_settings.js index 7015087e..e3ff0ee3 100644 --- a/src/js/profile/application_settings.js +++ b/src/js/profile/application_settings.js @@ -253,6 +253,7 @@ export const allApplicationSettings = [ new BoolSetting("disableCutDeleteWarnings", categoryGame, (app, value) => {}), new BoolSetting("rotationByBuilding", categoryGame, (app, value) => {}), new BoolSetting("middleMousePan", categoryGame, (app, value) => {}), + new BoolSetting("canDeleteWhileBuilding", categoryGame, (app, value) => {}), ]; export function getApplicationSettingById(id) { @@ -281,6 +282,7 @@ class SettingsStorage { this.disableCutDeleteWarnings = false; this.rotationByBuilding = true; this.middleMousePan = false; + this.canDeleteWhileBuilding = false; this.enableColorBlindHelper = false; @@ -563,6 +565,7 @@ export class ApplicationSettings extends ReadWriteProxy { if (data.version < 19) { data.settings.middleMousePan = false; + data.settings.canDeleteWhileBuilding = false; data.version = 19; } diff --git a/translations/base-en.yaml b/translations/base-en.yaml index fb5b7abf..8a732442 100644 --- a/translations/base-en.yaml +++ b/translations/base-en.yaml @@ -777,7 +777,12 @@ settings: middleMousePan: title: Pan camera with middle click description: >- - Click with the middle mouse button instead of left click to pan the camera. Allows panning camera while a building is selected. + Click and drag with the middle mouse button instead of the left mouse button to pan the camera. Allows panning camera while a building is selected. + + canDeleteWhileBuilding: + title: Immediate Delete Mode + description: >- + Enabling this will disable deselecting with right click and allow you to immediately delete buildings and structures without deselecting your current building. keybindings: title: Keybindings