From 77ff261be16ab6fecb5c4e5e02db58becf5dffa9 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Fri, 16 Feb 2024 13:08:34 -0500 Subject: [PATCH] Make functions non-inline so they work on HScript --- source/funkin/graphics/adobeanimate/FlxAtlasSprite.hx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/funkin/graphics/adobeanimate/FlxAtlasSprite.hx b/source/funkin/graphics/adobeanimate/FlxAtlasSprite.hx index fe024e2f5..2329a2791 100644 --- a/source/funkin/graphics/adobeanimate/FlxAtlasSprite.hx +++ b/source/funkin/graphics/adobeanimate/FlxAtlasSprite.hx @@ -55,6 +55,7 @@ class FlxAtlasSprite extends FlxAnimate */ public function listAnimations():Array { + if (this.anim == null) return []; return this.anim.getFrameLabels(); // return [""]; } @@ -152,22 +153,22 @@ class FlxAtlasSprite extends FlxAnimate frameLabel.add(callback); } - inline function goToFrameLabel(label:String):Void + function goToFrameLabel(label:String):Void { this.anim.goToFrameLabel(label); } - inline function getNextFrameLabel(label:String):String + function getNextFrameLabel(label:String):String { return listAnimations()[(getLabelIndex(label) + 1) % listAnimations().length]; } - inline function getLabelIndex(label:String):Int + function getLabelIndex(label:String):Int { return listAnimations().indexOf(label); } - inline function goToFrameIndex(index:Int):Void + function goToFrameIndex(index:Int):Void { this.anim.curFrame = index; }