asacolips-projects / pbta

Run games for any PbtA system in Foundry VTT!
https://asacolips.gitbook.io/pbta-system
MIT License
3 stars 4 forks source link

Refactor Setup Hook #223

Open mclemente opened 2 months ago

mclemente commented 2 months ago

Why

What Changed?

Unrelated Changes

How It Worked Before - If an override exists and `sheetConfigOverride` was previously activated, load the override. - Otherwise, load the original, if any. - PbtA sets the `sheetConfigOverride` setting to false, calls the `pbtaSheetConfig` hook and awaits 1 second. - If the setting has been turned on, the override is saved. - Otherwise, delete any override and restore original config, if any. - The config is then saved to settings.
How It Works Now - PbtA checks if any module is flagged to override it. - If an override exists and a module is flagged to override it, load the override. - Otherwise, load the original, if any. - PbtA calls the `pbta.sheetConfig` hook. - If a module exists, the override is saved. - Otherwise, delete any override and restore original config, if any. - The config is then saved to settings.

What Modules Need to Change

Remove the game.settings.set('pbta', 'sheetConfigOverride', true) call that is somewhere in the code.

On module.json, add:

"flags": {
  "MODULE_ID": {
    "pbta-override": true
  }
}