1
1
package funkin .backend ;
2
2
3
+ import flixel .animation .FlxAnimation ;
4
+ import flxanimate .animate .FlxAnim .FlxSymbolAnimation ;
3
5
import funkin .backend .utils .XMLUtil .BeatAnim ;
4
6
import funkin .backend .utils .XMLUtil .AnimData ;
5
7
import funkin .backend .utils .XMLUtil .IXMLEvents ;
@@ -11,6 +13,7 @@ import funkin.backend.system.interfaces.IOffsetCompatible;
11
13
import flixel .math .FlxMatrix ;
12
14
import flixel .math .FlxRect ;
13
15
import flixel .math .FlxPoint ;
16
+ import flixel .util .typeLimit .OneOfTwo ;
14
17
import funkin .backend .system .interfaces .IBeatReceiver ;
15
18
16
19
enum abstract XMLAnimType (Int )
@@ -325,6 +328,12 @@ class FunkinSprite extends FlxSkewedSprite implements IBeatReceiver implements I
325
328
lastAnimContext = Context ;
326
329
}
327
330
331
+ public function getAnim (name : String ): OneOfTwo <FlxAnimation , FlxSymbolAnimation > {
332
+ if (animateAtlas != null )
333
+ return animateAtlas .anim .getByName (name );
334
+ return animation .getByName (name );
335
+ }
336
+
328
337
public inline function getAnimOffset (name : String )
329
338
{
330
339
if (animOffsets .exists (name ))
@@ -378,7 +387,11 @@ class FunkinSprite extends FlxSkewedSprite implements IBeatReceiver implements I
378
387
379
388
public inline function isAnimFinished ()
380
389
{
381
- return animateAtlas != null ? (animateAtlas .anim .finished ) : (animation .curAnim != null ? animation .curAnim .finished : true );
390
+ return animateAtlas != null ? animateAtlas .anim .finished : (animation .curAnim != null ? animation .curAnim .finished : true );
391
+ }
392
+
393
+ public inline function isAnimAtEnd () {
394
+ return animateAtlas != null ? animateAtlas .anim .isAtEnd : (animation .curAnim != null ? animation .curAnim .isAtEnd : false );
382
395
}
383
396
#end
384
397
0 commit comments