diff --git a/source/funkin/graphics/adobeanimate/FlxAtlasSprite.hx b/source/funkin/graphics/adobeanimate/FlxAtlasSprite.hx index c4eaaff50..e187c7808 100644 --- a/source/funkin/graphics/adobeanimate/FlxAtlasSprite.hx +++ b/source/funkin/graphics/adobeanimate/FlxAtlasSprite.hx @@ -56,6 +56,12 @@ class FlxAtlasSprite extends FlxAnimate throw 'Null path specified for FlxAtlasSprite!'; } + // Validate asset path. + if (!Assets.exists('${path}/Animation.json')) + { + throw 'FlxAtlasSprite does not have an Animation.json file at the specified path (${path})'; + } + super(x, y, path, settings); if (this.anim.stageInstance == null) diff --git a/source/funkin/play/character/AnimateAtlasCharacter.hx b/source/funkin/play/character/AnimateAtlasCharacter.hx index 32a4e765c..5cc603429 100644 --- a/source/funkin/play/character/AnimateAtlasCharacter.hx +++ b/source/funkin/play/character/AnimateAtlasCharacter.hx @@ -129,7 +129,11 @@ class AnimateAtlasCharacter extends BaseCharacter { trace('[ATLASCHAR] Loading sprite atlas for ${characterId}.'); - var sprite:FlxAtlasSprite = new FlxAtlasSprite(0, 0, Paths.animateAtlas(_data.assetPath)); + var animLibrary:String = Paths.getLibrary(_data.assetPath); + var animPath:String = Paths.stripLibrary(_data.assetPath); + var assetPath:String = Paths.animateAtlas(animPath, animLibrary); + + var sprite:FlxAtlasSprite = new FlxAtlasSprite(0, 0, assetPath); // sprite.onAnimationComplete.removeAll(); sprite.onAnimationComplete.add(this.onAnimationFinished); diff --git a/source/funkin/play/components/PopUpStuff.hx b/source/funkin/play/components/PopUpStuff.hx index 911c3578c..a02291e4e 100644 --- a/source/funkin/play/components/PopUpStuff.hx +++ b/source/funkin/play/components/PopUpStuff.hx @@ -21,6 +21,12 @@ class PopUpStuff extends FlxTypedGroup */ var noteStyle:NoteStyle; + /** + * Offsets that are applied to all elements, independent of the note style. + * Used to allow scripts to reposition the elements. + */ + var offsets:Array = [0, 0]; + override public function new(noteStyle:NoteStyle) { super(); @@ -42,9 +48,11 @@ class PopUpStuff extends FlxTypedGroup rating.y = (FlxG.camera.height * 0.45 - 60); rating.y -= rating.height / 2; - var offsets = noteStyle.getJudgementSpriteOffsets(daRating); rating.x += offsets[0]; rating.y += offsets[1]; + var styleOffsets = noteStyle.getJudgementSpriteOffsets(daRating); + rating.x += styleOffsets[0]; + rating.y += styleOffsets[1]; rating.acceleration.y = 550; rating.velocity.y -= FlxG.random.int(140, 175); @@ -90,9 +98,11 @@ class PopUpStuff extends FlxTypedGroup trace('numScore($daLoop) = ${numScore.x}'); numScore.y = (FlxG.camera.height * 0.44); - var offsets = noteStyle.getComboNumSpriteOffsets(digit); numScore.x += offsets[0]; numScore.y += offsets[1]; + var styleOffsets = noteStyle.getComboNumSpriteOffsets(digit); + numScore.x += styleOffsets[0]; + numScore.y += styleOffsets[1]; numScore.acceleration.y = FlxG.random.int(250, 300); numScore.velocity.y -= FlxG.random.int(130, 150);