Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
18 changes: 16 additions & 2 deletions source/funkin/play/character/MultiSparrowCharacter.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package funkin.play.character;

import flixel.graphics.frames.FlxAtlasFrames;
import flixel.graphics.frames.FlxFramesCollection;
import flixel.graphics.FlxGraphic;
import funkin.modding.events.ScriptEvent;
import funkin.util.assets.FlxAnimationUtil;
import funkin.data.character.CharacterData.CharacterRenderType;
Expand All @@ -19,6 +20,8 @@ import funkin.data.character.CharacterData.CharacterRenderType;
*/
class MultiSparrowCharacter extends BaseCharacter
{
var frameBase:Null<FlxGraphic> = null;

public function new(id:String)
{
super(id, CharacterRenderType.MultiSparrow);
Expand Down Expand Up @@ -58,7 +61,7 @@ class MultiSparrowCharacter extends BaseCharacter
{
trace('Loading assets for Multi-Sparrow character "${characterId}"', flixel.util.FlxColor.fromString("#89CFF0"));

var assetList = [];
var assetList:Array<String> = [_data.assetPath];
for (anim in _data.animations)
{
if (anim.assetPath != null && !assetList.contains(anim.assetPath))
Expand All @@ -67,7 +70,18 @@ class MultiSparrowCharacter extends BaseCharacter
}
}

var texture:FlxAtlasFrames = Paths.getSparrowAtlas(_data.assetPath);
// Forcefully create a new FlxAtlasFrames collection so that we don't add to the same FlxAtlasFrames instance.
var texture:Null<FlxAtlasFrames> = null;

if (frameBase == null)
{
frameBase = FlxGraphic.fromAssetKey(Paths.image(_data.assetPath), true, this.characterId, true);
}

if (frameBase != null)
{
texture = new FlxAtlasFrames(frameBase);
}
Comment on lines +73 to +84
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes don't seem to be used in the Animation Editor at all.

Copy link
Contributor Author

@KoloInDaCrib KoloInDaCrib Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using Paths.getSparrowAtlas from multisparrow characters, regardless of where in the code, will retreive the frame collection with appended frames from other spritesheets since Flixel constantly reuses the frame collection objects that have the same base graphic.
While this could be moved directly to the animation editor, I found it somewhat nicer to put in the Multisparrow character class in case other sprites end up using the same base asset path as a multisparrow character, saving the need to have the non-multisparrow character have the same frames as the multisparrow character. For example this change will make Pico opponent not have the same frames as Pico playable and therefore prevent Pico opponent having the same outline problems as Pico playable after Pico playable has been created at least once.


if (texture == null)
{
Expand Down
11 changes: 10 additions & 1 deletion source/funkin/ui/debug/anim/DebugBoundingState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,16 @@ class DebugBoundingState extends FlxState
trace('ERROR: Failed to load character ${char}!');
}

generateOutlines(swagChar.frames.frames);
// For multisparrow render types, only generate the outlines for the main spritesheet.
if (swagChar._data.renderType == "multisparrow")
{
generateOutlines(Paths.getSparrowAtlas(swagChar._data.assetPath).frames);
}
else
{
generateOutlines(swagChar.frames.frames);
}

bf.pixels = swagChar.pixels;

clearInfo();
Expand Down
Loading