Skip to content

Commit

Permalink
Revert "small simplification"
Browse files Browse the repository at this point in the history
This reverts commit 4ffbf0b.
  • Loading branch information
richTrash21 committed Jul 13, 2024
1 parent 4ffbf0b commit 420ed88
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flixel/animation/FlxAnimation.hx
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class FlxAnimation extends FlxBaseAnimation
if (looped && curFrame == loopPoint)
{
curFrame = numFrames - 1;
parent.onLoopComplete.dispatch(name);
parent.fireLoopCallback(name);
}
else
{
Expand All @@ -228,7 +228,7 @@ class FlxAnimation extends FlxBaseAnimation
if (looped && curFrame == numFrames - 1)
{
curFrame = loopPoint;
parent.onLoopComplete.dispatch(name);
parent.fireLoopCallback(name);
}
else
{
Expand Down
6 changes: 6 additions & 0 deletions flixel/animation/FlxAnimationController.hx
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,12 @@ class FlxAnimationController implements IFlxDestroyable
onFinish.dispatch(name);
}

@:allow(flixel.animation)
function fireLoopCallback(?name:String):Void
{
onLoopComplete.dispatch(name);
}

function byNamesHelper(addTo:Array<Int>, frameNames:Array<String>):Void
{
for (frameName in frameNames)
Expand Down

0 comments on commit 420ed88

Please sign in to comment.