From 52872cd83702209542108c8e0f8cf609156ee436 Mon Sep 17 00:00:00 2001 From: lunarcleint Date: Tue, 25 Feb 2025 15:26:32 -0700 Subject: [PATCH] some stuffs >:D --- .../funkin/editors/character/CharacterAnimButton.hx | 5 +++-- source/funkin/editors/character/CharacterEditor.hx | 12 +++++++++++- source/funkin/editors/ui/UIImageExplorer.hx | 2 -- source/funkin/options/Options.hx | 3 ++- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/source/funkin/editors/character/CharacterAnimButton.hx b/source/funkin/editors/character/CharacterAnimButton.hx index d7f1da31..86e79584 100644 --- a/source/funkin/editors/character/CharacterAnimButton.hx +++ b/source/funkin/editors/character/CharacterAnimButton.hx @@ -293,7 +293,7 @@ class CharacterAnimButton extends UIButton { parent.character.animOffsets[anim].set(animData.x, animData.y); - if (parent.character.getAnimName() == anim) + if (parent.character.getAnimName() == anim && Options.playAnimOnOffset) CharacterEditor.instance.playAnimation(anim); updateText(); @@ -371,7 +371,8 @@ class CharacterAnimButton extends UIButton { try { if (animData.indices.length > 0) { - // keeps on crashing, look at flxanimate FlxAnim.hx for refrence + parent.character.animateAtlas.anim.addBySymbolIndices(animData.name, animData.anim, animData.indices, animData.fps, animData.loop); + wasRefreshed = true; } else { for (name in parent.character.animateAtlas.anim.symbolDictionary.keys()) if (parent.character.animateAtlas.anim.startsWith(name, animData.anim)) { diff --git a/source/funkin/editors/character/CharacterEditor.hx b/source/funkin/editors/character/CharacterEditor.hx index f27d011a..18050be0 100644 --- a/source/funkin/editors/character/CharacterEditor.hx +++ b/source/funkin/editors/character/CharacterEditor.hx @@ -250,7 +250,13 @@ class CharacterEditor extends UIState { label: "Change Animation ↓", keybind: [S], onSelect: _animation_down - } + }, + null, + { + label: "Play Animation On Offset?", + onSelect: _animation_toggle_anim_playing_offsets, + icon: Options.playAnimOnOffset ? 1 : 0 + }, ] }, ]; @@ -712,6 +718,10 @@ class CharacterEditor extends UIState { 0, characterAnimsWindow.animsList.length-1 )] ); + + function _animation_toggle_anim_playing_offsets(t) { + t.icon = (Options.playAnimOnOffset = !Options.playAnimOnOffset) ? 1 : 0; + } // The animation thats playing regardless if its valid or not public var characterFakeAnim:String = ""; diff --git a/source/funkin/editors/ui/UIImageExplorer.hx b/source/funkin/editors/ui/UIImageExplorer.hx index ecd8a2d6..e309672f 100644 --- a/source/funkin/editors/ui/UIImageExplorer.hx +++ b/source/funkin/editors/ui/UIImageExplorer.hx @@ -125,8 +125,6 @@ class UIImageExplorer extends UIFileExplorer { var image = null; if (isAtlas && spritemapImages.length > 0) { var spritemapPath:String = Path.join([directoryPath, spritemapImages[0]]); - trace("Loading spritemap: " + spritemapImages, spritemaps); - trace(directoryPath); imagePath = Path.normalize(spritemapPath); directoryPath = Path.directory(imagePath); diff --git a/source/funkin/options/Options.hx b/source/funkin/options/Options.hx index 5ec8a90b..19c2d6ea 100644 --- a/source/funkin/options/Options.hx +++ b/source/funkin/options/Options.hx @@ -83,7 +83,8 @@ class Options public static var characterHitbox:Bool = true; public static var characterCamera:Bool = true; public static var characterAxis:Bool = true; - public static var characterDragging:Bool = false; + public static var characterDragging:Bool = true; + public static var playAnimOnOffset:Bool = false; /** * PLAYER 1 CONTROLS