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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user