MCPcopy Index your code
hub / github.com/Monogatari/Monogatari / script

Method script

src/monogatari.ts:1307–1334  ·  view source on GitHub ↗
(object: string | Record<string, unknown> | null = null)

Source from the content-addressed store, hash-verified

1305 }
1306
1307 static script (object: string | Record<string, unknown> | null = null): unknown {
1308 const language = this.preference ('Language') as string;
1309
1310 if (typeof object === 'object' && object !== null) {
1311 this._script = Object.assign ({}, this._script, object);
1312 } else {
1313 let script: Record<string, unknown> = this._script;
1314
1315 if (this.setting ('MultiLanguage') === true) {
1316 if (!Object.keys (script).includes (language)) {
1317 // First check if the label exists in the current script
1318 FancyError.show ('engine:script:language_not_found', {
1319 language: language,
1320 multiLanguageSetting: 'The Multilanguage Setting is set to '+ this.setting ('MultiLanguage'),
1321 availableLanguages: Object.keys (script)
1322 });
1323 } else {
1324 script = script[language] as Record<string, unknown>;
1325 }
1326 }
1327
1328 if (typeof object === 'string') {
1329 script = script[object] as Record<string, unknown>;
1330 }
1331
1332 return script;
1333 }
1334 }
1335
1336 static label (): unknown[];
1337 static label (key: string): unknown;

Callers 15

labelMethod · 0.95
willApplyMethod · 0.80
displayInitialScreenFunction · 0.80
clear.spec.jsFile · 0.80
stop.spec.jsFile · 0.80
preload.spec.jsFile · 0.80
play.spec.jsFile · 0.80
functions.spec.jsFile · 0.80

Calls 4

preferenceMethod · 0.95
settingMethod · 0.95
keysMethod · 0.65
showMethod · 0.45

Tested by

no test coverage detected