Skip to content

Commit 3469524

Browse files
authored
implement onCloseSubState (#789)
Seriously, why havent this been added alongside with onOpenSubstate
1 parent 90e0e56 commit 3469524

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

source/funkin/backend/MusicBeatState.hx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,12 @@ class MusicBeatState extends FlxState implements IBeatCancellableReceiver
275275
if (!e.cancelled)
276276
super.openSubState(e.substate is FlxSubState ? cast e.substate : subState);
277277
}
278+
279+
public override function closeSubState() {
280+
var e = event("onCloseSubState", EventManager.get(CancellableEvent).recycle());
281+
if (!e.cancelled)
282+
super.closeSubState();
283+
}
278284

279285
public override function onResize(w:Int, h:Int) {
280286
super.onResize(w, h);

0 commit comments

Comments
 (0)