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

Method displayCenteredDialog

src/actions/Dialog.ts:261–286  ·  view source on GitHub ↗
(dialog: string, clearDialog: string, character: string, animation: boolean)

Source from the content-addressed store, hash-verified

259 }
260
261 async displayCenteredDialog(dialog: string, clearDialog: string, character: string, animation: boolean): Promise<void> {
262 const element = document.createElement('centered-dialog') as any;
263 const gameScreen = this.engine.element().find('[data-screen="game"]');
264 const textBox = this.engine.element().find('[data-component="text-box"]');
265 const writer = textBox.find('type-writer').get(0) as TypeWriter | undefined;
266
267 this._handleCustomClasses(element);
268
269 // If the text-box's typewriter exists, set it to ignore
270 // (in NVL mode, there might not be a type-writer element)
271 if (writer) {
272 writer.setState({ ignore: true, strings: [] });
273 }
274
275 textBox.hide();
276 gameScreen.append(element);
277
278 element.ready(() => {
279 const wrapper = element.content('wrapper');
280 const wrapperElement = wrapper?.get(0) as TypeWriter | undefined;
281
282 if (wrapperElement) {
283 wrapperElement.setContent(dialog, animation);
284 }
285 });
286 }
287
288 displayNvlDialog(dialog: string, clearDialog: string, character: string, animation: boolean): void {
289 const textBox = this.engine.element().find('[data-component="text-box"]').get(0) as any;

Callers 1

applyMethod · 0.95

Calls 5

_handleCustomClassesMethod · 0.95
setContentMethod · 0.80
getMethod · 0.65
elementMethod · 0.45
contentMethod · 0.45

Tested by

no test coverage detected