trioderegion / melvins-support-desk

Public repository for issues related to Melvin's Mechanical Masterworks, a FoundryVTT module.
Other
2 stars 1 forks source link

Feature Request: tokenizer integration [API Exposure] #2

Closed MrPotatoZed closed 2 years ago

MrPotatoZed commented 2 years ago

Love what you're doing and making tokens entirely within foundry is pretty great. After using it for a while and making some tokens it seems the main thing that would help the workflow at the moment would be the ability to import images directly from M3 to tokenizer. An "import to tokenizer" button would be appreciated. I've made a similar suggestion to MrPrimate in re adding an open M3 button to the tokenizer interface as M3 and tokenizer seem to be a match made in heaven. Perhaps that's the easier way to implement this as from yall's end it seems like there would need to be a way to pick which actor tokenizer was altering. Not sure if that would be a problem or not.

As a longer term thing the ability to generate images without backgrounds/on transparent backgrounds would help us easily make popout tokens inside tokenizer (or wherever) but that's a wish list thing for the future.

Thanks for all yalls work; this is a really exciting mod.

trioderegion commented 2 years ago

Does tokenizer use the FilePicker for any of its operations? If so, Melvin's should be right there.

However, cleaning up and providing easier API access to the workshop and supporting query code may make it easier for other modules to invoke Melvin's. Its almost usable as is, but needs better documentation and a bit more safety.

Thank you for the kind words 😄

MrPotatoZed commented 2 years ago

I don't think it does. Tokenizer is normally accessed through clicking on a character sheet portrait. Looking at the readme there's what seems like a pretty simple way for calling it but it does require inputting the name of a particular actor with the call.

Opening up the API seems like a huge step in the right direction. Thanks for looking at this.

benbarbour commented 2 years ago

This would be the killer feature for me. Most of the art my players interact with is circular, bordered tokens. I imagine I'd head here first before my token library if it was quicker to make "pogs" from this art.

Still, fantastic module!

trioderegion commented 2 years ago

The upcoming release will expose the Workshop and (new) Laminator application to the module's API, allowing other modules/macros to configure and open these applications.

Workshop constructor

  /**
   * @param {FilePicker} filePicker      File browser used for uploading saved images
   *
   * @param {M3Session} [m3session]      Current session object to use. If not provided,
   *                                     will construct and connect using default config.
   *
   * @param {Object} [options]           Optional constructor arguments passed to parent FormApplication
   * @param {number} [options.gridSize]  Defines the initial grid size, defaulting to last used
   *                                     value or '7' if none.
   * @param {number} [options.thumbSize] Defines the initial result size (in pixels), defaulting 
   *                                     to last used or '128' if none
   */

Laminator constructor

  /**
   * @param {Workshop} workshop Active Workshop application
   * @param {Object} [options] Optional constructor arguments passed to parent Application
   * @param {Object} [options.base] Initial image url to be used as the base layer
   * @param {Object} [options.overlay] Initial image url to be used as the overlay layer
   */