jessev14 / custom-character-sheet-sections

GNU General Public License v3.0
0 stars 5 forks source link

Enhancement: Make Opt-Out / Cancellation Hook for CCSS #23

Closed kgar closed 4 months ago

kgar commented 4 months ago

The Tidy 5e Sheets module is going to be rolling out its own native version of custom sectioning soon.

Currently, Tidy 5e reuses the base legacy Character Sheet class, and as a result, CCSS logic triggers.

I am requesting an opt-out hook like "preUseItem," which sheet modules like Tidy can use to opt out of custom sectioning. The reason I request the ability for a custom sheet to opt out is because any given table will use a mix of different types of sheets, so I want to work to make our modules coexist without stepping on each other.

I am also submitting a PR linked to this issue in hopes of saving effort and time.

Example of my request:

async function customSectionGetData(wrapped) {
    const data = await wrapped();

    if (!Hooks.call('custom-character-sheet-sections.preCustomSectionGetData', data)) {
        return data;
    }

    // etc.
}