Skip to content

Commit

Permalink
Custom Character Skin Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
CamLikesKirby committed May 20, 2024
1 parent 5705c8c commit 528f2c1
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions source/Character.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<String> = CoolUtil.coolTextFile('mods/global characters/offsets/' + character + '.txt');

for (offsetText in offsetStuffs)
{
var offsetInfo:Array<String> = offsetText.split(' ');

addOffset(offsetInfo[0], Std.parseFloat(offsetInfo[1]), Std.parseFloat(offsetInfo[2]));
}
}
override function update(elapsed:Float)
{
if (animation == null)
Expand Down

0 comments on commit 528f2c1

Please sign in to comment.