From cdf4890c981cf9eaeb25681e1837963e0a3a233a Mon Sep 17 00:00:00 2001 From: lunarcleint Date: Tue, 4 Mar 2025 19:35:07 -0700 Subject: [PATCH] fix checking existing on creation --- source/funkin/editors/character/CharacterCreationScreen.hx | 2 +- source/funkin/editors/character/CharacterSelection.hx | 1 - source/funkin/editors/ui/UIImageExplorer.hx | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/source/funkin/editors/character/CharacterCreationScreen.hx b/source/funkin/editors/character/CharacterCreationScreen.hx index 7112026d..d844b965 100644 --- a/source/funkin/editors/character/CharacterCreationScreen.hx +++ b/source/funkin/editors/character/CharacterCreationScreen.hx @@ -49,8 +49,8 @@ class CharacterCreationScreen extends UISubstateWindow { imageExplorer.maxSize.y -= 100; saveButton = new UIButton(windowSpr.x + windowSpr.bWidth - 20 - 125, windowSpr.y + windowSpr.bHeight - 16 - 32, "Save & Close", function() { - createCharacter(); close(); + createCharacter(); }, 125); add(saveButton); diff --git a/source/funkin/editors/character/CharacterSelection.hx b/source/funkin/editors/character/CharacterSelection.hx index 9145618b..a1c3546c 100644 --- a/source/funkin/editors/character/CharacterSelection.hx +++ b/source/funkin/editors/character/CharacterSelection.hx @@ -67,7 +67,6 @@ class CharacterSelection extends EditorTreeMenu public function createCharacter(name:String, imageSaveData:ImageSaveData, xml:Xml) { var characterAlreadyExists:Bool = Character.getList().contains(name); - if (characterAlreadyExists) { openSubState(new UIWarningSubstate("Creating Character: Error!", "The character you are trying to create already exists, if you would like to override it delete the character first!", [ {label: "Ok", color: 0xFFFF0000, onClick: function(t) {}} diff --git a/source/funkin/editors/ui/UIImageExplorer.hx b/source/funkin/editors/ui/UIImageExplorer.hx index 971fe483..2b5d817e 100644 --- a/source/funkin/editors/ui/UIImageExplorer.hx +++ b/source/funkin/editors/ui/UIImageExplorer.hx @@ -279,8 +279,8 @@ class UIImageExplorer extends UIFileExplorer { if (onFinishSaving != null) onFinishSaving(); } - if (alreadlyExistingFiles.length > 0) { - (FlxG.state.subState != null ? FlxG.state.subState : FlxG.state).openSubState(new UIWarningSubstate("Alreadly Existing Files!!!", + if (alreadlyExistingFiles.length > 0 && checkExisting) @:privateAccess { + (FlxG.state.subState != null && !FlxG.state._requestSubStateReset ? FlxG.state.subState : FlxG.state).openSubState(new UIWarningSubstate("Alreadly Existing Files!!!", "The following files alreadly exist: \n\n" + alreadlyExistingFiles.join('\n') + "\n\nIMPORTANT: OVERRIDING CAN NOT BE UNDONE!!!!!!!!", [ { label: "Override Files",