sanderfrenken / Universal-LPC-Spritesheet-Character-Generator

Character Generator based on Universal-LPC-Spritesheet
https://sanderfrenken.github.io/Universal-LPC-Spritesheet-Character-Generator/
GNU General Public License v3.0
396 stars 151 forks source link

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

Closed jrconway3 closed 4 months ago

jrconway3 commented 4 months ago

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: https://github.com/sanderfrenken/Universal-LPC-Spritesheet-Character-Generator/issues/161