MCPcopy Create free account
hub / github.com/Monogatari/Monogatari / preferences

Method preferences

src/monogatari.ts:1241–1258  ·  view source on GitHub ↗
(object: Partial<PlayerPreferences> | null = null, save = false)

Source from the content-addressed store, hash-verified

1239 }
1240
1241 static preferences (object: Partial<PlayerPreferences> | null = null, save = false): PlayerPreferences {
1242 if (object !== null) {
1243
1244 this._preferences = merge (this._preferences, object);
1245
1246 const storageConfig = this.Storage.configuration ();
1247
1248 if (!storageConfig || storageConfig.name === '') {
1249 this.setupStorage ();
1250 }
1251
1252 if (save === true) {
1253 this.Storage.update ('Settings', this._preferences);
1254 }
1255 }
1256
1257 return this._preferences;
1258 }
1259
1260 /**
1261 * Get or set the configuration.

Callers 1

bindMethod · 0.80

Calls 3

setupStorageMethod · 0.95
configurationMethod · 0.65
updateMethod · 0.65

Tested by

no test coverage detected