mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2024-12-26 15:07:14 +00:00
Merge pull request #84 from FunkinCrew/bugfix/songeventscriptevent
Fixed an issue where SongEventScriptEvent would not be dispatched
This commit is contained in:
commit
03f48289e1
2
hmm.json
2
hmm.json
|
@ -104,7 +104,7 @@
|
|||
"name": "polymod",
|
||||
"type": "git",
|
||||
"dir": null,
|
||||
"ref": "4e5b4b3",
|
||||
"ref": "6594dd8",
|
||||
"url": "https://github.com/larsiusprime/polymod"
|
||||
},
|
||||
{
|
||||
|
|
|
@ -385,12 +385,6 @@ class SongEventScriptEvent extends ScriptEvent
|
|||
*/
|
||||
public var event(default, null):funkin.play.song.SongData.SongEventData;
|
||||
|
||||
/**
|
||||
* The combo count as it is with this event.
|
||||
* Will be (combo) on miss events and (combo + 1) on hit events (the stored combo count won't update if the event is cancelled).
|
||||
*/
|
||||
public var comboCount(default, null):Int;
|
||||
|
||||
public function new(event:funkin.play.song.SongData.SongEventData):Void
|
||||
{
|
||||
super(ScriptEvent.SONG_EVENT, true);
|
||||
|
|
|
@ -72,6 +72,9 @@ class ScriptEventDispatcher
|
|||
case ScriptEvent.RESUME:
|
||||
t.onResume(event);
|
||||
return;
|
||||
case ScriptEvent.SONG_EVENT:
|
||||
t.onSongEvent(cast event);
|
||||
return;
|
||||
case ScriptEvent.COUNTDOWN_START:
|
||||
t.onCountdownStart(cast event);
|
||||
return;
|
||||
|
@ -118,7 +121,8 @@ class ScriptEventDispatcher
|
|||
return;
|
||||
}
|
||||
|
||||
throw "No function called for event type: " + event.type;
|
||||
// If you get a crash on this line, that means ERIC FUCKED UP!
|
||||
throw 'No function called for event type: ${event.type}';
|
||||
}
|
||||
|
||||
public static function callEventOnAllTargets(targets:Iterator<IScriptedClass>, event:ScriptEvent):Void
|
||||
|
|
|
@ -1771,7 +1771,13 @@ class PlayState extends MusicBeatState
|
|||
trace('Found ${songEventsToActivate.length} event(s) to activate.');
|
||||
for (event in songEventsToActivate)
|
||||
{
|
||||
SongEventParser.handleEvent(event);
|
||||
var eventEvent:SongEventScriptEvent = new SongEventScriptEvent(event);
|
||||
dispatchEvent(eventEvent);
|
||||
// Calling event.cancelEvent() skips the event. Neat!
|
||||
if (!eventEvent.eventCanceled)
|
||||
{
|
||||
SongEventParser.handleEvent(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2674,10 +2680,6 @@ class PlayState extends MusicBeatState
|
|||
|
||||
// Dispatch event to character script(s).
|
||||
if (currentStage != null) currentStage.dispatchToCharacters(event);
|
||||
|
||||
// TODO: Dispatch event to song script
|
||||
|
||||
// TODO: Dispatch event to note script
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -83,6 +83,7 @@ class CharacterDataParser
|
|||
try
|
||||
{
|
||||
var character:SparrowCharacter = ScriptedSparrowCharacter.init(charCls, DEFAULT_CHAR_ID);
|
||||
trace(' Initialized character ${character.characterName}');
|
||||
characterScriptedClass.set(character.characterId, charCls);
|
||||
}
|
||||
catch (e)
|
||||
|
|
Loading…
Reference in a new issue