From 528f2c1164b4aa333ed686d2e916f64b4ddaaf74 Mon Sep 17 00:00:00 2001 From: Cam the Kirby <92703353+CamtheKirby@users.noreply.github.com> Date: Mon, 20 May 2024 16:27:15 -0500 Subject: [PATCH] Custom Character Skin Fix --- source/Character.hx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/source/Character.hx b/source/Character.hx index 943503c..5a68946 100644 --- a/source/Character.hx +++ b/source/Character.hx @@ -1242,9 +1242,9 @@ class Character extends FlxSprite } if (!jsonCustom.isPlayable) { - loadCustomOffsetFile(curCharacter); + loadSkinOffsetFile(curCharacter); } else { - loadCustomOffsetFile(curCharacter + (isPlayer ? '-playable' : '')); + loadSkinOffsetFile(curCharacter + (isPlayer ? '-playable' : '')); } globalOffset = jsonCustom.globalOffset; @@ -1344,6 +1344,18 @@ class Character extends FlxSprite addOffset(offsetInfo[0], Std.parseFloat(offsetInfo[1]), Std.parseFloat(offsetInfo[2])); } } + + function loadSkinOffsetFile(character:String) + { + var offsetStuffs:Array = CoolUtil.coolTextFile('mods/global characters/offsets/' + character + '.txt'); + + for (offsetText in offsetStuffs) + { + var offsetInfo:Array = offsetText.split(' '); + + addOffset(offsetInfo[0], Std.parseFloat(offsetInfo[1]), Std.parseFloat(offsetInfo[2])); + } + } override function update(elapsed:Float) { if (animation == null)