-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Event based dialogue handling (#443)
* Event based dialogue handling * better imo * typo * Small script example new script by NexIsDumb --------- Co-authored-by: ⍚~Nex <87421482+NexIsDumb@users.noreply.github.com>
- Loading branch information
1 parent
f8a19b1
commit b1b1663
Showing
3 changed files
with
26 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
function next(event) | ||
if (!event.playFirst) trace("-"); | ||
|
||
function postNext(event) | ||
trace(curLine.char + " says: " + curLine.text); |
14 changes: 14 additions & 0 deletions
14
source/funkin/backend/scripting/events/dialogue/DialogueNextLineEvent.hx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package funkin.backend.scripting.events.dialogue; | ||
|
||
/** | ||
* CANCEL this event to prevent continuing with the next dialogue. | ||
* | ||
* **NOTE**: To access the current, past or next lines, use `curLine`, `lastLine` or also `dialogueLines` in the `DialogueCutscene` class (they're globals and can be accessed at any time as long as the Dialogue Cutscene is active)! | ||
*/ | ||
final class DialogueNextLineEvent extends CancellableEvent | ||
{ | ||
/** | ||
* If the dialogue has just been opened. | ||
*/ | ||
public var playFirst:Bool = false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters