diff --git a/module.json b/module.json index 5795c2f..4f60bf7 100644 --- a/module.json +++ b/module.json @@ -8,7 +8,7 @@ "email": "dev7355608@gmail.com" } ], - "version": "2.0.0", + "version": "2.0.1", "compatibility": { "minimum": "12", "verified": "12" @@ -33,8 +33,8 @@ ], "url": "https://github.com/dev7355608/limits", "manifest": "https://github.com/dev7355608/limits/releases/latest/download/module.json", - "download": "https://github.com/dev7355608/limits/releases/download/v2.0.0/module.zip", - "changelog": "https://github.com/dev7355608/limits/releases/tag/v2.0.0", + "download": "https://github.com/dev7355608/limits/releases/download/v2.0.1/module.zip", + "changelog": "https://github.com/dev7355608/limits/releases/tag/v2.0.1", "bugs": "https://github.com/dev7355608/limits/issues", "readme": "https://raw.githubusercontent.com/dev7355608/limits/main/README.md", "license": "https://raw.githubusercontent.com/dev7355608/limits/main/LICENSE" diff --git a/scripts/_index.mjs b/scripts/_index.mjs index b9fb3e3..02c71ce 100644 --- a/scripts/_index.mjs +++ b/scripts/_index.mjs @@ -1,12 +1,13 @@ +import LimitRangeRegionBehaviorConfig from "./apps/region-behavior.mjs"; import { PointDarknessSourceMixin, PointLightSourceMixin, PointSoundSourceMixin, PointVisionSourceMixin } from "./canvas/sources/_module.mjs"; import LimitRangeRegionBehaviorType from "./data/region-behavior.mjs"; -Hooks.once("init", () => { - const type = "limits.limitRange"; +const TYPE = "limits.limitRange"; - CONFIG.RegionBehavior.dataModels[type] = LimitRangeRegionBehaviorType; - CONFIG.RegionBehavior.typeIcons[type] = "fa-solid fa-eye-low-vision"; - CONFIG.RegionBehavior.typeLabels[type] = "LIMITS.label"; +Hooks.once("init", () => { + CONFIG.RegionBehavior.dataModels[TYPE] = LimitRangeRegionBehaviorType; + CONFIG.RegionBehavior.typeIcons[TYPE] = "fa-solid fa-eye-low-vision"; + CONFIG.RegionBehavior.typeLabels[TYPE] = "LIMITS.label"; Hooks.once("setup", () => { Hooks.once("canvasInit", () => { @@ -37,3 +38,7 @@ Hooks.once("init", () => { }); }); }); + +Hooks.once("ready", () => { + CONFIG.RegionBehavior.sheetClasses[TYPE]["core.RegionBehaviorConfig"].cls = LimitRangeRegionBehaviorConfig; +}); diff --git a/scripts/_module.mjs b/scripts/_module.mjs index adda2a6..6ec42b1 100644 --- a/scripts/_module.mjs +++ b/scripts/_module.mjs @@ -1,5 +1,6 @@ export { default as Limits } from "./limits.mjs"; +export * as apps from "./apps/_module.mjs"; export * as canvas from "./canvas/_module.mjs"; export * as const from "./const.mjs"; export * as data from "./data/_module.mjs"; diff --git a/scripts/apps/_module.mjs b/scripts/apps/_module.mjs new file mode 100644 index 0000000..d481c0c --- /dev/null +++ b/scripts/apps/_module.mjs @@ -0,0 +1 @@ +export { default as LimitRangeRegionBehaviorConfig } from "./region-behavior.mjs"; diff --git a/scripts/apps/region-behavior.mjs b/scripts/apps/region-behavior.mjs new file mode 100644 index 0000000..a239c1c --- /dev/null +++ b/scripts/apps/region-behavior.mjs @@ -0,0 +1,17 @@ +/** + * The "Limit Range" Region Behavior Config. + * @sealed + */ +export default class LimitRangeRegionBehaviorConfig extends foundry.applications.sheets.RegionBehaviorConfig { + /** @override */ + static PARTS = foundry.utils.mergeObject(super.PARTS, { form: { scrollable: [""] } }, { inplace: false }); + + /** @override */ + async _renderHTML(context, options) { + const rendered = await super._renderHTML(context, options); + + rendered.form.classList.add("scrollable"); + + return rendered; + } +}