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

Merge pull request #245 from hexagonhexagon/disable-warnings

Add option to disable warnings
This commit is contained in:
tobspr 2020-06-22 08:01:11 +02:00 committed by GitHub
commit a14b7c49ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 7 deletions

View File

@ -70,14 +70,17 @@ export class HUDMassSelector extends BaseHUDPart {
} }
confirmDelete() { confirmDelete() {
if (this.selectedUids.size > 100) { if (
!this.root.app.settings.getAllSettings().disableCutDeleteWarnings &&
this.selectedUids.size > 100
) {
const { ok } = this.root.hud.parts.dialogs.showWarning( const { ok } = this.root.hud.parts.dialogs.showWarning(
T.dialogs.massDeleteConfirm.title, T.dialogs.massDeleteConfirm.title,
T.dialogs.massDeleteConfirm.desc.replace( T.dialogs.massDeleteConfirm.desc.replace(
"<count>", "<count>",
"" + formatBigNumberFull(this.selectedUids.size) "" + formatBigNumberFull(this.selectedUids.size)
), ),
["cancel:good", "ok:bad"] ["cancel:good:escape", "ok:bad:enter"]
); );
ok.add(() => this.doDelete()); ok.add(() => this.doDelete());
} else { } else {
@ -120,14 +123,17 @@ export class HUDMassSelector extends BaseHUDPart {
T.dialogs.blueprintsNotUnlocked.title, T.dialogs.blueprintsNotUnlocked.title,
T.dialogs.blueprintsNotUnlocked.desc T.dialogs.blueprintsNotUnlocked.desc
); );
} else if (this.selectedUids.size > 100) { } else if (
!this.root.app.settings.getAllSettings().disableCutDeleteWarnings &&
this.selectedUids.size > 100
) {
const { ok } = this.root.hud.parts.dialogs.showWarning( const { ok } = this.root.hud.parts.dialogs.showWarning(
T.dialogs.massCutConfirm.title, T.dialogs.massCutConfirm.title,
T.dialogs.massCutConfirm.desc.replace( T.dialogs.massCutConfirm.desc.replace(
"<count>", "<count>",
"" + formatBigNumberFull(this.selectedUids.size) "" + formatBigNumberFull(this.selectedUids.size)
), ),
["cancel:good", "ok:bad"] ["cancel:good:escape", "ok:bad:enter"]
); );
ok.add(() => this.doCut()); ok.add(() => this.doCut());
} else { } else {

View File

@ -201,6 +201,7 @@ export const allApplicationSettings = [
new BoolSetting("enableTunnelSmartplace", categoryGame, (app, value) => {}), new BoolSetting("enableTunnelSmartplace", categoryGame, (app, value) => {}),
new BoolSetting("vignette", categoryGame, (app, value) => {}), new BoolSetting("vignette", categoryGame, (app, value) => {}),
new BoolSetting("compactBuildingInfo", categoryGame, (app, value) => {}), new BoolSetting("compactBuildingInfo", categoryGame, (app, value) => {}),
new BoolSetting("disableCutDeleteWarnings", categoryGame, (app, value) => {}),
]; ];
export function getApplicationSettingById(id) { export function getApplicationSettingById(id) {
@ -225,6 +226,7 @@ class SettingsStorage {
this.enableTunnelSmartplace = true; this.enableTunnelSmartplace = true;
this.vignette = true; this.vignette = true;
this.compactBuildingInfo = false; this.compactBuildingInfo = false;
this.disableCutDeleteWarnings = false;
/** /**
* @type {Object.<string, number>} * @type {Object.<string, number>}
@ -414,7 +416,7 @@ export class ApplicationSettings extends ReadWriteProxy {
} }
getCurrentVersion() { getCurrentVersion() {
return 13; return 14;
} }
/** @param {{settings: SettingsStorage, version: number}} data */ /** @param {{settings: SettingsStorage, version: number}} data */
@ -466,6 +468,10 @@ export class ApplicationSettings extends ReadWriteProxy {
data.version = 13; data.version = 13;
} }
if (data.version < 14) {
data.settings.disableCutDeleteWarnings = false;
data.version = 14;
}
return ExplainedResult.good(); return ExplainedResult.good();
} }
} }

View File

@ -281,7 +281,7 @@ ingame:
toggleHud: Toggle HUD toggleHud: Toggle HUD
placeBuilding: Place building placeBuilding: Place building
createMarker: Create Marker createMarker: Create Marker
delete: Destroy delete: Delete
pasteLastBlueprint: Paste last blueprint pasteLastBlueprint: Paste last blueprint
lockBeltDirection: Enable belt planner lockBeltDirection: Enable belt planner
plannerSwitchSide: Flip planner side plannerSwitchSide: Flip planner side
@ -692,6 +692,11 @@ settings:
description: >- description: >-
Shortens info boxes for buildings by only showing their ratios. Otherwise a description and image is shown. Shortens info boxes for buildings by only showing their ratios. Otherwise a description and image is shown.
disableCutDeleteWarnings:
title: Disable Cut/Delete Warnings
description: >-
Disable the warning dialogs brought up when cutting/deleting more than 100 entities.
keybindings: keybindings:
title: Keybindings title: Keybindings
hint: >- hint: >-
@ -744,7 +749,7 @@ keybindings:
rotateInverseModifier: >- rotateInverseModifier: >-
Modifier: Rotate CCW instead Modifier: Rotate CCW instead
cycleBuildingVariants: Cycle Variants cycleBuildingVariants: Cycle Variants
confirmMassDelete: Confirm Mass Delete confirmMassDelete: Delete area
pasteLastBlueprint: Paste last blueprint pasteLastBlueprint: Paste last blueprint
cycleBuildings: Cycle Buildings cycleBuildings: Cycle Buildings
lockBeltDirection: Enable belt planner lockBeltDirection: Enable belt planner