From c38c2ba0a005517fd67469b0bb84572c07ee4109 Mon Sep 17 00:00:00 2001 From: WBHarry <89362246+WBHarry@users.noreply.github.com> Date: Wed, 11 Mar 2026 11:25:07 +0100 Subject: [PATCH] Created System Modules (markdown) --- System-Modules.md | 54 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 System-Modules.md diff --git a/System-Modules.md b/System-Modules.md new file mode 100644 index 0000000..5b6a6e5 --- /dev/null +++ b/System-Modules.md @@ -0,0 +1,54 @@ +Various intended ways modules can alter the system. + +## Custom Resources +In the `init` hook, you can register custom resources for characters. This is done by defining new key/object pairs on `CONFIG.DH.RESOURCE.character.custom`. +The data structure is: +```json +{ + id - the resource key + initial - the initial numerical value of the resource (stress starts at 6 for instance) + max - the maximum numerical value the resource can reach + label - the label shown for the resource, preferably a i18n localizable string +} +``` + +Optionally, you can also define custom full and empty icons for the resource together with the above, + +```json +{ + images: { + full: { + value - the FontAwesome icon class or the filepath to the image if 'isIcon' is false + isIcon - if the image is a fontAwesome icon or an image in your filesystem + noColorFilter - normally a uniform color is applied to the image via a css filter. If you're using a non-transparent background or just don't want it, then set this to true + }, + empty: { + value - see above + isIcon - see above + noColorFilter - see above + } + } +} +``` + +Example +```js +Hooks.once('init', () => { + CONFIG.DH.RESOURCE.character.custom.corruption = { + id: 'corruption', + initial: 0, + max: 4, + label: 'Corruption', + images: { + full: { + value: 'systems/daggerheart/assets/icons/domains/sage.svg', + isIcon: false + }, + empty: { + value: 'systems/daggerheart/assets/icons/domains/sage.svg', + isIcon: false + } + } + }; +} +``` \ No newline at end of file