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

Major performance improvements

This commit is contained in:
tobspr
2020-05-18 17:40:20 +02:00
parent 260ba892c8
commit 2c48cb72aa
18 changed files with 194 additions and 60 deletions

View File

@@ -102,6 +102,19 @@ export const allApplicationSettings = [
document.body.setAttribute("data-theme", id);
},
}),
new EnumSetting("refreshRate", {
options: ["60", "100", "144", "165"],
valueGetter: rate => rate,
textGetter: rate => rate + " Hz",
category: categoryGame,
restartRequired: false,
changeCb:
/**
* @param {Application} app
*/
(app, id) => {},
}),
];
export function getApplicationSettingById(id) {
@@ -116,6 +129,7 @@ class SettingsStorage {
this.soundsMuted = false;
this.musicMuted = false;
this.theme = "light";
this.refreshRate = "60";
}
}
@@ -168,6 +182,10 @@ export class ApplicationSettings extends ReadWriteProxy {
return this.getAllSettings().uiScale;
}
getDesiredFps() {
return parseInt(this.getAllSettings().refreshRate);
}
getInterfaceScaleValue() {
const id = this.getInterfaceScaleId();
for (let i = 0; i < uiScales.length; ++i) {
@@ -234,7 +252,7 @@ export class ApplicationSettings extends ReadWriteProxy {
}
getCurrentVersion() {
return 3;
return 4;
}
migrate(data) {