From 168dacf68e21c261770472d515b6b11e929d39e5 Mon Sep 17 00:00:00 2001 From: lunarcleint <88809950+lunarcleint@users.noreply.github.com> Date: Sat, 23 Mar 2024 02:49:39 -0700 Subject: [PATCH] pretty print option --- source/funkin/editors/DebugOptions.hx | 6 +++++- source/funkin/editors/charter/Charter.hx | 6 +++--- source/funkin/game/PlayState.hx | 2 +- source/funkin/options/Options.hx | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/source/funkin/editors/DebugOptions.hx b/source/funkin/editors/DebugOptions.hx index 01df41d0..8dcfeda7 100644 --- a/source/funkin/editors/DebugOptions.hx +++ b/source/funkin/editors/DebugOptions.hx @@ -36,9 +36,13 @@ class DebugOptionsScreen extends OptionsScreen { })); #end add(new Checkbox( - "Enable Editor SFXs", + "Editor SFXs", "If checked, will play sound effects when working on editors (ex: will play sfxs when checking checkboxes...)", "editorSFX")); + add(new Checkbox( + "Pretty Print", + "If checked, the saved files from the editor will be formatted to be easily viewable (does not apply to xmls...)", + "editorPrettyPrint")); add(new Checkbox( "Intensive Blur", "If checked, will use more intensive blur that may be laggier but look better.", diff --git a/source/funkin/editors/charter/Charter.hx b/source/funkin/editors/charter/Charter.hx index df5c5aa2..9211b5fc 100644 --- a/source/funkin/editors/charter/Charter.hx +++ b/source/funkin/editors/charter/Charter.hx @@ -700,9 +700,9 @@ class Charter extends UIState { var songPath:String = '${Paths.getAssetsRoot()}/songs/${__song.toLowerCase()}'; if (Options.charterAutoSavesSeperateFolder) - Chart.save(songPath, PlayState.SONG, __autoSaveLocation, {saveMetaInChart: false, folder: "autosaves"}); + Chart.save(songPath, PlayState.SONG, __autoSaveLocation, {saveMetaInChart: false, folder: "autosaves", prettyPrint: Options.editorPrettyPrint}); else - Chart.save(songPath, PlayState.SONG, __diff.toLowerCase(), {saveMetaInChart: false}); + Chart.save(songPath, PlayState.SONG, __diff.toLowerCase(), {saveMetaInChart: false, prettyPrint: Options.editorPrettyPrint}); undos.save(); } autoSaveNotif.cancelled = false; @@ -1345,7 +1345,7 @@ class Charter extends UIState { #if sys function saveTo(path:String, separateEvents:Bool = false) { buildChart(); - Chart.save(path, PlayState.SONG, __diff.toLowerCase(), {saveMetaInChart: false, saveEventsInChart: !separateEvents}); + Chart.save(path, PlayState.SONG, __diff.toLowerCase(), {saveMetaInChart: false, saveEventsInChart: !separateEvents, prettyPrint: Options.editorPrettyPrint}); } #end diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index c7364225..9a46aeb9 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -759,7 +759,7 @@ class PlayState extends MusicBeatState SaveWarning.warningFunc = saveWarn; SaveWarning.saveFunc = () -> { @:privateAccess Chart.save('${Paths.getAssetsRoot()}/songs/${Charter.__song.toLowerCase()}', - PlayState.SONG, Charter.__diff.toLowerCase(), {saveMetaInChart: false, saveEventsInChart: true}); + PlayState.SONG, Charter.__diff.toLowerCase(), {saveMetaInChart: false, saveEventsInChart: true, prettyPrint: Options.editorPrettyPrint}); } } } diff --git a/source/funkin/options/Options.hx b/source/funkin/options/Options.hx index debe4a13..a9bf72ac 100644 --- a/source/funkin/options/Options.hx +++ b/source/funkin/options/Options.hx @@ -43,7 +43,7 @@ class Options */ public static var intensiveBlur:Bool = true; public static var editorSFX:Bool = true; - public static var resizableEditors:Bool = true; + public static var editorPrettyPrint:Bool = false; public static var maxUndos:Int = 120; /**