mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-03-28 21:09:37 +00:00
onUpdate, etc. works now too
This commit is contained in:
parent
606d9d4af4
commit
c83e505f5b
|
@ -1178,12 +1178,16 @@ class PlayState extends MusicBeatSubState
|
||||||
// Dispatch event to conversation script.
|
// Dispatch event to conversation script.
|
||||||
ScriptEventDispatcher.callEvent(currentConversation, event);
|
ScriptEventDispatcher.callEvent(currentConversation, event);
|
||||||
|
|
||||||
// Dispatch event to note script
|
// Dispatch event to only the specific note script
|
||||||
if (Std.isOfType(event, NoteScriptEvent))
|
if (Std.isOfType(event, NoteScriptEvent))
|
||||||
{
|
{
|
||||||
var noteEvent:NoteScriptEvent = cast(event, NoteScriptEvent);
|
var noteEvent:NoteScriptEvent = cast(event, NoteScriptEvent);
|
||||||
NoteKindManager.callEvent(noteEvent.note.noteData.kind, noteEvent);
|
NoteKindManager.callEvent(noteEvent.note.noteData.kind, noteEvent);
|
||||||
}
|
}
|
||||||
|
else // Dispatch event to all note scripts
|
||||||
|
{
|
||||||
|
NoteKindManager.callEventForAll(event);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -43,4 +43,12 @@ class NoteKindManager
|
||||||
|
|
||||||
ScriptEventDispatcher.callEvent(noteKind, event);
|
ScriptEventDispatcher.callEvent(noteKind, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function callEventForAll(event:ScriptEvent):Void
|
||||||
|
{
|
||||||
|
for (noteKind in noteKinds.iterator())
|
||||||
|
{
|
||||||
|
ScriptEventDispatcher.callEvent(noteKind, event);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue