diff --git a/source/funkin/editors/character/CharacterEditor.hx b/source/funkin/editors/character/CharacterEditor.hx index 9a4fa977..f9cb45d3 100644 --- a/source/funkin/editors/character/CharacterEditor.hx +++ b/source/funkin/editors/character/CharacterEditor.hx @@ -361,8 +361,19 @@ class CharacterEditor extends UIState { if (charXML.exists("flipX") && !character.flipX) charXML.remove("flipX"); if (charXML.exists("scale") && character.scale.x == 1) charXML.remove("scale"); if (charXML.exists("antialiasing") && character.antialiasing) charXML.remove("antialiasing"); + if (charXML.exists("sprite") && character.sprite == character.curCharacter) charXML.remove("sprite"); + if (charXML.exists("icon") && character.icon == character.curCharacter) charXML.remove("icon"); + + for (a in charXML.elements()) + if (a.nodeName == "anim") { + if (a.exists("x") && a.get("x") == "0") a.remove("x"); + if (a.exists("y") && a.get("y") == "0") a.remove("y"); + if (a.exists("fps") && a.get("fps") == "24") a.remove("fps"); + if (a.exists("loop") && a.get("loop") == "false") a.remove("loop"); + } - return "\n" + Printer.print(charXML, true); + var xmlThingYea:String = "\n" + Printer.print(charXML, Options.editorPrettyPrint); + return Options.editorPrettyPrint ? xmlThingYea : xmlThingYea.replace("\n", ""); } function _edit_undo(_) { @@ -654,4 +665,4 @@ enum CharacterChange { CDeleteAnim(animID:Int, animData:AnimData); CChangeOffset(name:String, change:FlxPoint); CResetOffsets(oldOffsets:Map); -} \ No newline at end of file +}