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;
}
if (!metaBuilding.getStayInPlacementMode() && !this.root.app.inputMgr.shiftIsDown) {
if (
!metaBuilding.getStayInPlacementMode() &&
!this.root.app.inputMgr.shiftIsDown &&
!this.root.app.settings.getAllSettings().alwaysMultiplace
) {
// Stop placement
this.currentMetaBuilding.set(null);
}

View File

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

View File

@ -472,6 +472,11 @@ settings:
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.
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:
title: Keybindings
hint: >-