fix checking existing on creation
This commit is contained in:
@@ -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) {}}
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user