[ENHANCEMENT] Chart Editor Character Previews
Co-Authored-By: @ComedyLost They started it first and he made good start base, but i still kinda rewrote all that, BUT I want to show that them worked on it too!
Linked Issues
#6212
Associated Funkin PR
Assets PR: Link
Description
Janky a bit, but still...
This PR revives old CharacterPlayer class with cool features. Preview your characters animations, including PlayAnimation event! (Also includes custom animation notekinds, since character's scripts are also loaded)
Also some optimization for ScriptEvent stuff and icons reloading. (Also now NoteScript event) And I HOPE no performance issues. (I tested and there was none :P)
Screenshots/Videos
!!!! Showcase video
This isn't the best thing I've written, but OH MY GOD, I did it all in two hours.
P.S. If changes are needed, I will make them immediately after requesting them. (Like fix all characters scripts for this pr and etc)
Fantastic, this is a great feature to finally clean up.
For the issue where characters expand out of the box, we could look into expanding the preview box to match the "full" size of the character based on its bounds. Or we could leave it, having the characters go out of the box is a little charming.
Note to self: BaseCharacter.debug is true if the character is not being used in a stage, so you can use if (debug) {} in any scripts which cause issues when used in the chart editor via the preview. Do you have a list of all the characters that are currently causing these kinds of issues? (Blazin' is a likely culprit).
EDIT: At some point I want to go into this PR and squash it, then I can edit the commit message to include Co-authored-by: ComedyLost <[email protected]>
Might not finish my version in favor of this one, it's great.
For the issue where characters expand out of the box, we could look into expanding the preview box to match the "full" size of the character based on its bounds. Or we could leave it, having the characters go out of the box is a little charming.
Expanding the box to the character's full bounds might cause the window to become BIG when it comes to things like BF's attack animation.
All characters that are broken (that I could find)
- All characters with a dark variant [Errors when trying to add the default variant]
- Pico (Speaker Shooter) [Errors while trying to grab shooting chart]
- Nene (All Versions) [Errors onUpdate while trying to add A-Bot stuff]
- Otis [Same errors as Nene & Pico (Speaker Shooter)]
- Spirit [Errors when trying to add to stage]
- Blazin' characters [Errors when trying to hit a Blazin' specific notekind]
- Tankman (Atlas) [Fully crashes the game]
How is this doing? Does it function perfectly or still need some character fixes?
The trojan horse truly was the contributors we made along the way
you guys ARE the trojan horse
Yeah man The contributors carry the patches
We are all bros...
I'm trying to hold back my tears
Expanding the box to the character's full bounds might cause the window to become BIG when it comes to things like BF's attack animation.
Noticing 👀
For the issue where characters expand out of the box, we could look into expanding the preview box to match the "full" size of the character based on its bounds.
That wouldn't work for things like Blazin' where overlap of sprites is part of the design.
Expanding the box too much would make it very big for things like bf-attack, but currently it doesn't expand ENOUGH for several characters like parents-christmas.
It should at least consistently hold the idle animations.
I'm also working on fixing all the characters that break when using them in the preview.
EDIT: The character preview seems to be updating its size to match the PREVIOUS character (this is obvious if you switch characters a bunch), the problem is that anything I tried didn't work, so this is probably a HaxeUI-related issue and not necessarily Funkin's fault.
EDIT: The character preview seems to be updating its size to match the PREVIOUS character (this is obvious if you switch characters a bunch), the problem is that anything I tried didn't work, so this is probably a HaxeUI-related issue and not necessarily Funkin's fault.
I was able to fix this myself in my closed PR (might redo it cuz I got nothing better to do) and all I did was move the code that resized the window out of the if statement reading the preview's dirty variable.
Mighty, can you add the fix to this PR through PurSnake? That way your commit will make it in with the currently reviewed draft of the PR
@PurSnake I attempted to give this a new review as it seems the expanding box bug has been fixed, but it needs a rebase (ideally to the current develop branch). I rebased it internally but switching characters causes the box to disappear and I'm not sure if that's your fault or mine.
@EliteMasterEric Technically, this isn't our problem, as it's caused by Abnormal's changes to migrate a large number of characters to the AnimateAtlas format. Because of this, it can't get the animation width/height correctly I think I'll work on fixing that.
Fixed aw boi
That's done
Now we just need the debug check PR to merge before 0.7.6