Fixed ghosts for atlases

This commit is contained in:
Yoshman29
2026-01-19 14:21:38 +01:00
parent f6694fe4b9
commit abbc562d45
2 changed files with 13 additions and 4 deletions
@@ -108,6 +108,8 @@ class TranslatedAssetLibrary extends AssetLibrary implements IModsAssetLibrary {
return null;
}
// TODO: list support for TranslatedAssetLibrary (idk how it works)
#if MOD_SUPPORT
public var _parsedAsset:String = null; // Theres no need to actually make this work - Nex
@@ -20,12 +20,15 @@ class CharacterGhost extends Character {
var wasInvalidFrame:Bool = !colorTransform.__isDefault(false);
colorTransform.__identity();
var animName = animation.curAnim?.name ?? null;
var animFrame = animation.curAnim?.curFrame ?? 0;
var animFrameTimer = animation.curAnim?._frameTimer ?? 0;
for (anim in ghosts) @:privateAccess {
alpha = 0.4; color = 0xFFAEAEAE;
var flxanim:FlxAnimation = animation._animations.get(anim);
var frameIndex:Int = flxanim.frames.getDefault([0])[flxanim.frames.length - 1];
frame = frames.frames[frameIndex];
animation.play(anim, true, false, flxanim.frames.length - 1);
setAnimOffset(anim);
super.draw();
@@ -40,8 +43,12 @@ class CharacterGhost extends Character {
frameOffset.set(0, 0);
offset.set(globalOffset.x * (isPlayer != playerOffsets ? 1 : -1), -globalOffset.y);
colorTransform.color = 0xFFEF0202;
} else
setAnimOffset(animation.name);
} else {
animation.play(animName, true, false, animFrame);
setAnimOffset(animName);
if (animation.curAnim != null)
animation.curAnim._frameTimer = animFrameTimer;
}
super.draw();
}