Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flixel 5.3.0 compat #382

Merged
merged 4 commits into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
flixel 5.3.0 compat
  • Loading branch information
Geokureli committed Apr 10, 2023
commit dc3554e5a3a158aa18f302653ee2cb4b257e14ea
2 changes: 1 addition & 1 deletion flixel/addons/effects/chainable/FlxEffectSprite.hx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class FlxEffectSprite extends FlxSprite
*/
override public function update(elapsed:Float):Void
{
if (updateTargetAnimation && target.animation.frames > 1)
if (updateTargetAnimation && target.animation.numFrames > 1)
{
target.updateAnimation(elapsed);
}
Expand Down
37 changes: 14 additions & 23 deletions flixel/addons/transition/FlxTransitionableState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -64,44 +64,35 @@ class FlxTransitionableState extends FlxState
super();
}

override public function destroy():Void
override function destroy():Void
{
super.destroy();
transIn = null;
transOut = null;
_onExit = null;
}

override public function create():Void
override function create():Void
{
super.create();
transitionIn();
}

override public function switchTo(nextState:FlxState):Bool
override function startOutro(onOutroComplete:() -> Void)
{
if (!hasTransOut)
return true;

if (!_exiting)
transitionToState(nextState);

return transOutFinished;
}

function transitionToState(nextState:FlxState):Void
{
// play the exit transition, and when it's done call FlxG.switchState
_exiting = true;
transitionOut(function()
{
FlxG.switchState(nextState);
});

if (skipNextTransOut)
onOutroComplete();
else if (!_exiting)
{
skipNextTransOut = false;
finishTransOut();
// play the exit transition, and when it's done call FlxG.switchState
_exiting = true;
transitionOut(onOutroComplete);

if (skipNextTransOut)
{
skipNextTransOut = false;
finishTransOut();
}
}
}

Expand Down