1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-03-02 03:39:21 +00:00

Allow configuring map resources scale

This commit is contained in:
tobspr
2020-10-08 09:13:53 +02:00
parent 21c9c3cee6
commit 5a96e76151
7 changed files with 51 additions and 3 deletions

View File

@@ -267,6 +267,7 @@ export const allApplicationSettings = [
new BoolSetting("rotationByBuilding", enumCategories.advanced, (app, value) => {}),
new BoolSetting("displayChunkBorders", enumCategories.advanced, (app, value) => {}),
new BoolSetting("pickMinerOnPatch", enumCategories.advanced, (app, value) => {}),
new RangeSetting("mapResourcesScale", enumCategories.advanced, () => null),
new EnumSetting("refreshRate", {
options: refreshRateOptions,
@@ -324,6 +325,7 @@ class SettingsStorage {
this.lowQualityTextures = false;
this.simplifiedBelts = false;
this.zoomToCursor = true;
this.mapResourcesScale = 0.5;
/**
* @type {Object.<string, number>}
@@ -534,7 +536,7 @@ export class ApplicationSettings extends ReadWriteProxy {
}
getCurrentVersion() {
return 29;
return 30;
}
/** @param {{settings: SettingsStorage, version: number}} data */
@@ -672,6 +674,11 @@ export class ApplicationSettings extends ReadWriteProxy {
data.version = 29;
}
if (data.version < 30) {
data.settings.mapResourcesScale = 0.5;
data.version = 30;
}
return ExplainedResult.good();
}
}

View File

@@ -7,6 +7,17 @@ import { T } from "../translations";
const logger = createLogger("setting_types");
/*
* ***************************************************
*
* LEGACY CODE WARNING
*
* This is old code from yorg3.io and needs to be refactored
* @TODO
*
* ***************************************************
*/
export class BaseSetting {
/**
*