mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 08:20:50 +00:00
Fix WebGPU settings accessors
This commit is contained in:
@@ -4,7 +4,8 @@
|
||||
*/
|
||||
|
||||
const shaderSources = import.meta.glob("../shaders/**/*.wgsl", {
|
||||
as: "raw",
|
||||
query: "?raw",
|
||||
import: "default",
|
||||
eager: true,
|
||||
}) as Record<string, string>;
|
||||
|
||||
|
||||
@@ -110,7 +110,15 @@ export class UserSettings {
|
||||
this.setCached(key, value);
|
||||
}
|
||||
|
||||
private getFloat(key: string, defaultValue: number): number {
|
||||
get(key: string, defaultValue: boolean): boolean {
|
||||
return this.getBool(key, defaultValue);
|
||||
}
|
||||
|
||||
set(key: string, value: boolean): void {
|
||||
this.setBool(key, value);
|
||||
}
|
||||
|
||||
getFloat(key: string, defaultValue: number): number {
|
||||
const value = this.getCached(key);
|
||||
if (!value) return defaultValue;
|
||||
|
||||
@@ -119,7 +127,7 @@ export class UserSettings {
|
||||
return floatValue;
|
||||
}
|
||||
|
||||
private setFloat(key: string, value: number) {
|
||||
setFloat(key: string, value: number) {
|
||||
this.setCached(key, value.toString());
|
||||
}
|
||||
|
||||
@@ -185,6 +193,10 @@ export class UserSettings {
|
||||
return this.getBool("settings.attackingTroopsOverlay", true);
|
||||
}
|
||||
|
||||
territoryBorderMode(): number {
|
||||
return this.getInt("settings.territoryBorderMode", 1);
|
||||
}
|
||||
|
||||
toggleAttackingTroopsOverlay() {
|
||||
this.setBool(
|
||||
"settings.attackingTroopsOverlay",
|
||||
|
||||
Reference in New Issue
Block a user