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

Add setting to make deleting not clear the cursor.

This commit is contained in:
hexagonhexagon 2020-05-29 20:55:12 -04:00
parent 02fb6d53b5
commit 58ce3bcff3
3 changed files with 25 additions and 4 deletions

View File

@ -128,11 +128,17 @@ export class HUDBuildingPlacer extends BaseHUDPart {
}
// Deletion
if (button === enumMouseButton.right && !this.currentMetaBuilding.get()) {
if (
button === enumMouseButton.right &&
(!this.currentMetaBuilding.get() ||
this.root.app.settings.getSetting("deletingDoesntClearCursor"))
) {
this.currentlyDragging = true;
this.currentlyDeleting = true;
this.lastDragTile = this.root.camera.screenToWorld(pos).toTileSpace();
this.currentMetaBuilding.set(null);
if (!this.root.app.settings.getSetting("deletingDoesntClearCursor")) {
this.currentMetaBuilding.set(null);
}
return STOP_PROPAGATION;
}
}
@ -435,7 +441,10 @@ export class HUDBuildingPlacer extends BaseHUDPart {
*/
onCanvasClick(mousePos, cancelAction = false) {
if (cancelAction) {
if (this.currentMetaBuilding.get()) {
if (
this.currentMetaBuilding.get() &&
!this.root.app.settings.getSetting("deletingDoesntClearCursor")
) {
this.currentMetaBuilding.set(null);
} else {
this.deleteBelowCursor();

View File

@ -116,6 +116,7 @@ export const allApplicationSettings = [
}),
new BoolSetting("alwaysMultiplace", categoryGame, (app, value) => {}),
new BoolSetting("deletingDoesntClearCursor", categoryGame, (app, value) => {}),
new BoolSetting("offerHints", categoryGame, (app, value) => {}),
];
@ -134,6 +135,7 @@ class SettingsStorage {
this.refreshRate = "60";
this.alwaysMultiplace = false;
this.deletingDoesntClearCursor = false;
this.offerHints = true;
/**
@ -293,7 +295,7 @@ export class ApplicationSettings extends ReadWriteProxy {
}
getCurrentVersion() {
return 7;
return 8;
}
/** @param {{settings: SettingsStorage, version: number}} data */
@ -315,6 +317,11 @@ export class ApplicationSettings extends ReadWriteProxy {
data.version = 7;
}
if (data.version < 8) {
data.settings.deletingDoesntClearCursor = false;
data.version = 8;
}
return ExplainedResult.good();
}
}

View File

@ -542,6 +542,11 @@ settings:
description: >-
If enabled, all buildings will stay selected after placement until you cancel it. This is equivalent to holding SHIFT permanently.
deletingDoesntClearCursor:
title: Deleting doesn't clear cursor
description: >-
If enabled, buildings will stay selected when you are deleting objects, until you manually cancel it.
offerHints:
title: Hints & Tutorials
description: >-