From 2dc9973fee9549b1fe85e8db348260c86cca4bef Mon Sep 17 00:00:00 2001 From: ImVeryBad Date: Tue, 10 Feb 2026 13:42:13 +0100 Subject: [PATCH] Add Dialogue callbacks to `Module` and documentation. --- source/funkin/modding/IScriptedClass.hx | 17 ++++++++++++- source/funkin/modding/module/Module.hx | 32 +++++++++++++++++++++---- 2 files changed, 43 insertions(+), 6 deletions(-) diff --git a/source/funkin/modding/IScriptedClass.hx b/source/funkin/modding/IScriptedClass.hx index d1162cf8f00..51efc05136c 100644 --- a/source/funkin/modding/IScriptedClass.hx +++ b/source/funkin/modding/IScriptedClass.hx @@ -239,12 +239,27 @@ interface ICharacterSelectScriptedClass extends IScriptedClass interface IDialogueScriptedClass extends IScriptedClass { /** - * Called as the dialogue starts, and before the first dialogue text is displayed. + * Called when the dialogue starts, and before the first dialogue text is displayed. */ public function onDialogueStart(event:DialogueScriptEvent):Void; + /** + * Called when the dialogue line is completed. + */ public function onDialogueCompleteLine(event:DialogueScriptEvent):Void; + + /** + * Called when the next dialogue line starts. + */ public function onDialogueLine(event:DialogueScriptEvent):Void; + + /** + * Called when the dialogue is skipped. + */ public function onDialogueSkip(event:DialogueScriptEvent):Void; + + /** + * Called when the dialogue is finished. + */ public function onDialogueEnd(event:DialogueScriptEvent):Void; } diff --git a/source/funkin/modding/module/Module.hx b/source/funkin/modding/module/Module.hx index 0d342d565fa..6f583fc7682 100644 --- a/source/funkin/modding/module/Module.hx +++ b/source/funkin/modding/module/Module.hx @@ -1,9 +1,6 @@ package funkin.modding.module; -import funkin.modding.IScriptedClass.IPlayStateScriptedClass; -import funkin.modding.IScriptedClass.IStateChangingScriptedClass; -import funkin.modding.IScriptedClass.IFreeplayScriptedClass; -import funkin.modding.IScriptedClass.ICharacterSelectScriptedClass; +import funkin.modding.IScriptedClass; import funkin.modding.events.ScriptEvent; /** @@ -24,7 +21,7 @@ typedef ModuleParams = */ @:nullSafety class Module implements IPlayStateScriptedClass implements IStateChangingScriptedClass implements IFreeplayScriptedClass - implements ICharacterSelectScriptedClass + implements ICharacterSelectScriptedClass implements IDialogueScriptedClass { /** * Whether the module is currently active. @@ -367,4 +364,29 @@ class Module implements IPlayStateScriptedClass implements IStateChangingScripte public function onCharacterConfirm(event:CharacterSelectScriptEvent):Void { } + + /** + * Called when the dialogue starts, and before the first dialogue text is displayed. + */ + public function onDialogueStart(event:DialogueScriptEvent):Void {} + + /** + * Called when the dialogue line is completed. + */ + public function onDialogueCompleteLine(event:DialogueScriptEvent):Void {} + + /** + * Called when the next dialogue line starts. + */ + public function onDialogueLine(event:DialogueScriptEvent):Void {} + + /** + * Called when the dialogue is skipped. + */ + public function onDialogueSkip(event:DialogueScriptEvent):Void {} + + /** + * Called when the dialogue is finished. + */ + public function onDialogueEnd(event:DialogueScriptEvent):Void {} }