fix checking existing on creation

This commit is contained in:
lunarcleint
2025-03-04 19:35:07 -07:00
parent 0cbdbfee0b
commit cdf4890c98
3 changed files with 3 additions and 4 deletions
@@ -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);
@@ -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) {}}
+2 -2
View File
@@ -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",