From e1883a6a09af6ae527d80240459311c5e6ee5282 Mon Sep 17 00:00:00 2001 From: Chronic x3 <126361810+chronicsilly@users.noreply.github.com> Date: Tue, 15 Jul 2025 17:32:46 +0100 Subject: [PATCH] Update CharacterEditor.hx --- .../funkin/editors/character/CharacterEditor.hx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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"); - return "\n" + Printer.print(charXML, true); + 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"); + } + + 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 +}