From 7c7378bca8321f4d35e94d02150cb18cfe49aa0c Mon Sep 17 00:00:00 2001 From: lunarcleint <88809950+lunarcleint@users.noreply.github.com> Date: Mon, 17 Jul 2023 18:59:33 -0700 Subject: [PATCH] better saving --- .../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 b055224b..3cbb785b 100644 --- a/source/funkin/editors/character/CharacterEditor.hx +++ b/source/funkin/editors/character/CharacterEditor.hx @@ -340,11 +340,22 @@ class CharacterEditor extends UIState { } function buildCharacter():String { - return "\n" + Printer.print(character.buildXML(), true); + var charXML:Xml = character.buildXML(); + + // clean + if (charXML.exists("gameOverChar") && character.gameOverCharacter == "bf-dead") charXML.remove("gameOverChar"); + if (charXML.exists("camx") && character.cameraOffset.x == 0) charXML.remove("camx"); + if (charXML.exists("camy") && character.cameraOffset.y == 0) charXML.remove("camy"); + if (charXML.exists("holdTime") && character.holdTime == 4) charXML.remove("holdTime"); + 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"); + + return "\n" + Printer.print(charXML, true); } function _edit_undo(_) { - var v = undoList.shift(); + var v = undoList.shift();s switch (v) { case null: // do nothing