diff --git a/source/Character.hx b/source/Character.hx index 414558cbb98..9506ccef03d 100644 --- a/source/Character.hx +++ b/source/Character.hx @@ -72,8 +72,12 @@ class Character extends FlxSprite public var positionArray:Array = [0, 0]; public var cameraPosition:Array = [0, 0]; + public var otherCharacters:Array; + public var hasMissAnimations:Bool = false; + public var isDeathCharacter:Bool = false; + //Used on Character Editor public var imageFile:String = ''; public var jsonScale:Float = 1; @@ -82,7 +86,7 @@ class Character extends FlxSprite public var healthColorArray:Array = [255, 0, 0]; public static var DEFAULT_CHARACTER:String = 'bf'; //In case a character is missing, it will use BF on its place - public function new(x:Float, y:Float, ?character:String = 'bf', ?isPlayer:Bool = false) + public function new(x:Float, y:Float, ?character:String = 'bf', ?isPlayer:Bool = false, ?isDeathCharacter:Bool = false) { super(x, y); diff --git a/source/editors/CharacterEditorState.hx b/source/editors/CharacterEditorState.hx index cbcf1fd9b90..696dd8c094c 100644 --- a/source/editors/CharacterEditorState.hx +++ b/source/editors/CharacterEditorState.hx @@ -526,10 +526,15 @@ class CharacterEditorState extends MusicBeatState imageInputText.focusGained = () -> FlxG.stage.window.textInputEnabled = true; var reloadImage:FlxButton = new FlxButton(imageInputText.x + 210, imageInputText.y - 3, "Reload Image", function() { - char.imageFile = imageInputText.text; - reloadCharacterImage(); - if(char.animation.curAnim != null) { - char.playAnim(char.animation.curAnim.name, true); + if (Paths.fileExists('images/' + char.imageFile, IMAGE)) + { + char.imageFile = imageInputText.text; + reloadCharacterImage(); + if(char.animation.curAnim != null) { + char.playAnim(char.animation.curAnim.name, true); + } + } else { + CoolUtil.coolError("The image/XML you tried to load couldn't be found!\nEither it doesn't exist, or the name doesn't match with the one you're putting?", "JS Engine Anti-Crash Tool"); } });