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

Handle foldables in Outfit.from/generally improved foldable handling in outfits #90

Open
horrible-little-slime opened this issue May 11, 2023 · 1 comment

Comments

@horrible-little-slime
Copy link
Contributor

I recently had to write the following admittedly-shitty function for garbo's upcoming outfit revamp:

export function validateGarbageFoldable(spec: OutfitSpec): void {
  const garbageItems = getFoldGroup($item`January's Garbage Tote`);
  for (const garbageItem of garbageItems) {
    if (
      Object.values(spec).some(
        (specEntry) =>
          specEntry === garbageItem || (Array.isArray(specEntry) && specEntry.includes(garbageItem))
      )
    ) {
      if (!have(garbageItem)) cliExecute(`fold ${garbageItem}`);
      break;
    }
  }
}

because calling Outfit.from was throwing errors when we don't have our foldable folded.

Garbo currently doesn't actually use grimoire's task-engine framework in most places, which is admittedly an us problem. phccs handles the issue by either folding the thing we want as part of our outfit function (as this does; phccs outfits are a lot more predictable and less dynamic than garbo ones) or as part of a prepare function for a task. It would be nice to have a system embedded directly into grimoire's outfit and/or task handling to do folding, sort of like how it has native modeable handling.

@Kasekopf
Copy link
Member

Yes, I think this would be a good idea to include in grimoire. Probably an outfit will have to keep track of the number of foldable versions of a given item that is about to be equipped, and then handle the folding in _dress.

I'm traveling right now but I might be able to look at this this weekend.

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

No branches or pull requests

2 participants