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

Method willRollback

src/actions/Dialog.ts:51–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49 }
50
51 static override async willRollback(): Promise<void> {
52 const textBox = this.engine.element().find('[data-component="text-box"]').get(0) as TextBoxComponent | undefined;
53
54 this.engine.global('finished_typing', true);
55
56 if (textBox?.show) {
57 textBox.show();
58 }
59
60 const dialogLog = this.engine.component('dialog-log') as { instances?: (callback: (instance: { pop: () => void }) => void) => void } | undefined;
61
62 const centeredDialog = this.engine.element().find('[data-component="centered-dialog"]');
63 if (centeredDialog.isVisible()) {
64 centeredDialog.remove();
65
66 if (textBox?.show) {
67 textBox.show();
68 }
69 }
70
71 this.engine.element().find('[data-ui="who"]').html('');
72
73 if (typeof dialogLog !== 'undefined' && this.engine.global('_dialog_pending_revert') === true && dialogLog.instances) {
74 dialogLog.instances((instance) => instance.pop());
75 this.engine.global('_dialog_pending_revert', false);
76 }
77 }
78
79 static override async setup(): Promise<void> {
80 this.engine.globals({

Callers

nothing calls this directly

Calls 8

globalMethod · 0.80
componentMethod · 0.80
getMethod · 0.65
removeMethod · 0.65
elementMethod · 0.45
showMethod · 0.45
instancesMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected