1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-06-13 13:04:03 +00:00

Added a new setting that allows deleting while a building is selected.

This commit is contained in:
David Triphon 2020-07-20 13:05:05 -07:00
parent 958797d7c0
commit 0ca897bf86
3 changed files with 18 additions and 3 deletions

View File

@ -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);
}
}

View File

@ -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;
}

View File

@ -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