mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-08-06 13:18:27 +02:00
Automatically reset game setting's value if it has the same value as global's
This commit is contained in:
@@ -63,7 +63,7 @@ export class BaseSettingsStorage<T extends AnyPref> {
|
||||
return this.definitions[key];
|
||||
}
|
||||
|
||||
hasSetting<K extends keyof PrefTypeMap<K>>(key: K): boolean {
|
||||
hasSetting(key: T): boolean {
|
||||
return key in this.settings;
|
||||
}
|
||||
|
||||
@@ -196,4 +196,15 @@ export class BaseSettingsStorage<T extends AnyPref> {
|
||||
|
||||
return value.toString();
|
||||
}
|
||||
|
||||
deleteSetting(pref: T) {
|
||||
if (this.hasSetting(pref)) {
|
||||
delete this.settings[pref];
|
||||
this.saveSettings();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user