Fix ScriptedCutscene Confusing Event Names

This commit is contained in:
Ralty
2025-12-18 16:32:01 +07:00
parent abf77f72f2
commit 34639d729d
@@ -95,18 +95,20 @@ class ScriptedCutscene extends Cutscene {
script.call("stepHit", [curStep]);
}
public override function openSubState(sub:FlxSubState)
public override function openSubState(subState:FlxSubState)
{
var event = EventManager.get(StateEvent).recycle(sub);
script.call("onSubstateClose", [event]);
if(!event.cancelled) super.openSubState(event.substate is FlxSubState ? cast event.substate : sub);
var event = EventManager.get(StateEvent).recycle(subState);
script.call(Flags.MOD_API_VERSION > 2 ? "onSubstateClose" /*Remove this entirely*/ : "onOpenSubState", [event]);
if (!event.cancelled)
super.openSubState(event.substate is FlxSubState ? event.substate : subState);
}
public override function closeSubState()
{
var event = EventManager.get(StateEvent).recycle(subState);
script.call("onSubstateOpen", [event]);
if(!event.cancelled) super.closeSubState();
script.call(Flags.MOD_API_VERSION > 2 ? "onSubstateOpen" /*Remove this entirely*/ : "onCloseSubState", [event]);
if (!event.cancelled)
super.closeSubState();
}
public override function destroy() {