Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 161 Added Ability to Filter Assets by Available Animation #165

Conversation

jrconway3
Copy link

@jrconway3 jrconway3 commented May 21, 2024

Here's the basics of how this works:

  1. At the top of "Body" is a collapsed-by-default "Supported Animation" section
  2. This defaults to "Any", but if chosen the assets are restricted
  3. By default, ALL assets are assumed to support the base animations (Spellcast through Watering)
  4. data-animation can be included manually in source_index.html and I did include it for all collapsible categories
  5. If data-animation is not provided, nothing is filtered (however, all generated spritesheets still include this by default; you can only leave the option off in source_index.html)

I even did this for the body types as well; Emotes for example currently only supports Female and Teen because I didn't finish Pregnant or Male for this asset yet due to how late I added it in.

I originally based this on how body type works, with it grabbing the type in the loop. However, it was too slow, so instead I put this outside the loop (made no sense to grab it every time anyway) and its just as fast as before now:

    const bodyType = getBodyTypeName();
    const selectedAnim = getSelectedAnimation();
    $("li").each(function(index) {

(When getSelectedAnimation() was called every loop it was very slow; adding it outside the loop it was fast again, and I saw no reason to include getBodyTypeName() inside the loop either).

This should solve this issue:
#161

Copy link
Owner

@sanderfrenken sanderfrenken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job, looks great!

@sanderfrenken sanderfrenken merged commit 0911b73 into sanderfrenken:master May 22, 2024
1 check passed
@jrconway3 jrconway3 deleted the issue-161-filter-assets-by-animation branch May 26, 2024 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants