From 2b659d688fae5a826127e875d9f2dc88f5304596 Mon Sep 17 00:00:00 2001 From: lunarcleint <88809950+lunarcleint@users.noreply.github.com> Date: Mon, 22 Jul 2024 16:07:58 -0700 Subject: [PATCH] W and S works --- .../editors/character/CharacterAnimsWindow.hx | 7 ++----- .../funkin/editors/character/CharacterEditor.hx | 17 +++++++++++++++-- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/source/funkin/editors/character/CharacterAnimsWindow.hx b/source/funkin/editors/character/CharacterAnimsWindow.hx index caf959f1..d9bca67c 100644 --- a/source/funkin/editors/character/CharacterAnimsWindow.hx +++ b/source/funkin/editors/character/CharacterAnimsWindow.hx @@ -16,6 +16,7 @@ class CharacterAnimsWindow extends UIButtonList { public var displayAnimsFramesList:Map = []; public var animButtons:Map = []; + public var animsList:Array = []; public function new(x:Float, y:Float, character:CharacterGhost) { super(x, y, Std.int(500-16), 419, "", FlxPoint.get(Std.int(500-16-32), 208)); @@ -50,11 +51,7 @@ class CharacterAnimsWindow extends UIButtonList { public override function update(elapsed:Float) { super.update(elapsed); - // if (CharacterEditor.instance.draggingCharacter && ghosts[0] != character.getAnimName()) { - // if (ghosts.indexOf(character.getAnimName()) != -1) - // ghosts.remove(character.getAnimName()); - // ghosts.insert(0, character.getAnimName()); - // } + animsList = [for (button in buttons) button.anim]; character.ghosts = ghosts; } diff --git a/source/funkin/editors/character/CharacterEditor.hx b/source/funkin/editors/character/CharacterEditor.hx index c1f487ad..38d96aa0 100644 --- a/source/funkin/editors/character/CharacterEditor.hx +++ b/source/funkin/editors/character/CharacterEditor.hx @@ -658,8 +658,21 @@ class CharacterEditor extends UIState { character.stopAnimation(); } - function _animation_up(_) {} - function _animation_down(_) {} + function _animation_up(_) + playAnimation( + characterAnimsWindow.animsList[ + FlxMath.wrap( + characterAnimsWindow.animsList.indexOf(character.getAnimName()) - 1, + 0, characterAnimsWindow.animsList.length-1 + )] + ); + function _animation_down(_) + playAnimation( + characterAnimsWindow.animsList[FlxMath.wrap( + characterAnimsWindow.animsList.indexOf(character.getAnimName()) + 1, + 0, characterAnimsWindow.animsList.length-1 + )] + ); public function playAnimation(anim:String) { character.playAnim(anim, true);