1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2024-10-27 20:34:29 +00:00

Add multiplace setting

This commit is contained in:
tobspr 2020-05-23 10:57:02 +02:00
parent 714332a91d
commit 1561246dc4
4 changed files with 24 additions and 9 deletions

Binary file not shown.

View File

@ -468,7 +468,11 @@ export class HUDBuildingPlacer extends BaseHUDPart {
this.currentBaseRotation = (180 + this.currentBaseRotation) % 360; this.currentBaseRotation = (180 + this.currentBaseRotation) % 360;
} }
if (!metaBuilding.getStayInPlacementMode() && !this.root.app.inputMgr.shiftIsDown) { if (
!metaBuilding.getStayInPlacementMode() &&
!this.root.app.inputMgr.shiftIsDown &&
!this.root.app.settings.getAllSettings().alwaysMultiplace
) {
// Stop placement // Stop placement
this.currentMetaBuilding.set(null); this.currentMetaBuilding.set(null);
} }

View File

@ -111,13 +111,11 @@ export const allApplicationSettings = [
textGetter: rate => rate + " Hz", textGetter: rate => rate + " Hz",
category: categoryGame, category: categoryGame,
restartRequired: false, restartRequired: false,
changeCb: changeCb: (app, id) => {},
/**
* @param {Application} app
*/
(app, id) => {},
enabled: !IS_DEMO, enabled: !IS_DEMO,
}), }),
new BoolSetting("alwaysMultiplace", categoryGame, (app, value) => {}),
]; ];
export function getApplicationSettingById(id) { export function getApplicationSettingById(id) {
@ -134,6 +132,8 @@ class SettingsStorage {
this.theme = "light"; this.theme = "light";
this.refreshRate = "60"; this.refreshRate = "60";
this.alwaysMultiplace = false;
/** /**
* @type {Object.<string, number>} * @type {Object.<string, number>}
*/ */
@ -291,14 +291,20 @@ export class ApplicationSettings extends ReadWriteProxy {
} }
getCurrentVersion() { getCurrentVersion() {
return 5; return 6;
} }
migrate(data) { migrate(data) {
// Simply reset // Simply reset before
if (data.version < this.getCurrentVersion()) { if (data.version < 5) {
data.settings = new SettingsStorage(); data.settings = new SettingsStorage();
data.version = this.getCurrentVersion(); data.version = this.getCurrentVersion();
return ExplainedResult.good();
}
if (data.version < 6) {
data.alwaysMultiplace = false;
data.version = 6;
} }
return ExplainedResult.good(); return ExplainedResult.good();

View File

@ -472,6 +472,11 @@ settings:
description: >- description: >-
If you have a 144hz monitor, change the refresh rate here so the game will properly simulate at higher refresh rates. This might actually decrease the FPS if your computer is too slow. If you have a 144hz monitor, change the refresh rate here so the game will properly simulate at higher refresh rates. This might actually decrease the FPS if your computer is too slow.
alwaysMultiplace:
title: Multiplace
description: >-
If enabled, all buildings will stay selected after placement until you cancel it. This is equivalent to holding SHIFT permanently.
keybindings: keybindings:
title: Keybindings title: Keybindings
hint: >- hint: >-