From 3213fc5482e1488336a06c98d2497cd207dd1b91 Mon Sep 17 00:00:00 2001 From: lunarcleint <88809950+lunarcleint@users.noreply.github.com> Date: Mon, 22 Jul 2024 15:11:07 -0700 Subject: [PATCH] Fix no stage designed as, default strage --- .../editors/character/CharacterEditor.hx | 37 +++++++++++-------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/source/funkin/editors/character/CharacterEditor.hx b/source/funkin/editors/character/CharacterEditor.hx index 01f4f6aa..c62a1734 100644 --- a/source/funkin/editors/character/CharacterEditor.hx +++ b/source/funkin/editors/character/CharacterEditor.hx @@ -279,9 +279,10 @@ class CharacterEditor extends UIState { add(uiGroup); playAnimation(character.getAnimOrder()[0]); + changeStage("stage"); + _view_focus_character(null); - - + if(Framerate.isLoaded) { Framerate.fpsCounter.alpha = 0.4; Framerate.memoryCounter.alpha = 0.4; @@ -501,7 +502,9 @@ class CharacterEditor extends UIState { remove(character); if (__stage == null) { - updateStagePositions(["NONE"]); + updateStagePositions([]); + changeStagePosition("NONE"); + add(character); } else { stage = new Stage(__stage, this, false); @@ -537,24 +540,28 @@ class CharacterEditor extends UIState { } public function changeStagePosition(position:String) { - if (stage == null) return; - - if (stage.characterPoses.exists(stagePosition)) - stage.characterPoses[stagePosition].revertCharacter(character); - - stagePosition = position.toLowerCase(); - remove(character); - - if (stage.characterPoses.exists(stagePosition)) - stage.applyCharStuff(character, stagePosition, 0); - _animation_play(null); + if (stage != null && position != "NONE") { + if (stage.characterPoses.exists(stagePosition)) + stage.characterPoses[stagePosition].revertCharacter(character); + + stagePosition = position.toLowerCase(); + remove(character); + + if (stage.characterPoses.exists(stagePosition)) + stage.applyCharStuff(character, stagePosition, 0); + _animation_play(null); + } else + stagePosition = position.toLowerCase(); characterPropertiesWindow.testAsDropDown.index = characterPropertiesWindow.testAsDropDown.options.indexOf(stagePosition.toUpperCase()); characterPropertiesWindow.testAsDropDown.label.text = stagePosition.toUpperCase(); } public function changeCharacterDesginedAs(player:Bool) @:privateAccess { - if (stage == null) return; + if (stage == null) { + changeCharacterIsPlayer(player); + return; + } if (stage.characterPoses.exists(stagePosition)) stage.characterPoses[stagePosition].revertCharacter(character);