foundry-vtt-tidy-5e-sheets icon indicating copy to clipboard operation
foundry-vtt-tidy-5e-sheets copied to clipboard

api: Action List custom sections and sectioning items by optional criteria

Open kgar opened this issue 1 year ago • 2 comments

Provide the API for injecting custom sections that reference specific items based on item-specific criteria. Items which match the criteria are bucketed into whatever custom section they refer to.

Stretch

Figure out how to offer custom ordering of custom sections.

Related

  • #11 Grid section expanding/collapsing

Reference

https://discord.com/channels/1167985253072257115/1170004050578767973/1185273377909391400

gambit — Today at 11:33 AM I've got an api related idea I thought I'd share. Chris from the Chris Premades module provides a helpful set of automated generic actions (Grapple/Dash/Dodge/etc). There's quite a few of them, so it would be great if a section could be added to the Actions tab for Generic Action so they don't clutter up an actors unique actions. Additionally, it would be really nice if that section was collapsible to allow it to be hidden when not needed. Chris already interacts with the original tidy sheets for a few things like auto setting the action list enabled flag on spells that are imported with his tool, so I think he would be open to injecting those into an api if given the option, maybe it could include the action list enabled flag for items as well to make it more scalable

kgar avatar Dec 15 '23 18:12 kgar

Back to this now.

Chris has a draft of something that would be nice to include in the Action List: https://github.com/chrisk123999/chris-premades/blob/master/scripts/integrations/tidy5eSheet.js

Essentially, this:

let pack = game.packs.get('chris-premades.CPR Actions');
if (!pack) return;
await pack.getDocuments();
let items = pack.contents;
let sectionLabel = 'DND5E.FeatureActive';

// TODO: Put those into their own section in the Action List.

Goals:

  • Update the API and Action List implementation to support injecting a custom section with items
  • these items are not owned by the actor, so ideally, Tidy should be able to try the UUID when looking for the item if the ID doesn't yield a result
  • Include the option to exclude Action List toggle icon for custom items, since they may not belong to the actor
  • Additional goal: allow for injecting custom items into existing sections
  • Release this API once this example is found to be working in a satisfactory way, and submit a PR to Chris's Premades for this.
  • Optionally also include a world script that provides the same implementation

kgar avatar Feb 13 '24 05:02 kgar

Duplicate of #507

kgar avatar Mar 27 '24 04:03 kgar

With Native CCSS in Tidy, this particular feature is almost redundant, while the Native CCSS offering will provide a good enough approximation for this. Will close with the release of #507

kgar avatar May 18 '24 17:05 kgar