Skip to content

Commit

Permalink
fixing two character offset bugs rq
Browse files Browse the repository at this point in the history
  • Loading branch information
NexIsDumb committed Jun 27, 2024
1 parent d79959d commit ce19a63
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions source/funkin/editors/character/CharacterEditor.hx
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,6 @@ class CharacterEditor extends UIState {
}

function buildCharacter():String {
if (character.isPlayer != character.playerOffsets) {
character.switchOffset('singLEFT', 'singRIGHT');
character.switchOffset('singLEFTmiss', 'singRIGHTmiss');
}
var charXML:Xml = character.buildXML([
for (button in characterAnimsWindow.buttons.members)
button.anim
Expand Down Expand Up @@ -588,6 +584,12 @@ class CharacterEditor extends UIState {
function changeOffset(anim:String, change:FlxPoint, addtoUndo:Bool = true) {
if (character.getNameList().length == 0) return;

var animData = character.animDatas.get(anim);
if (animData != null) {
animData.x += change.x;
animData.y += change.y;
}

character.animOffsets.set(anim, character.getAnimOffset(anim) + change);
for (i in characterAnimsWindow.buttons.members)
if (i.anim == anim)
Expand Down

0 comments on commit ce19a63

Please sign in to comment.