diff --git a/src/module/ds4.ts b/src/module/ds4.ts index 0a50041..5ca1f25 100644 --- a/src/module/ds4.ts +++ b/src/module/ds4.ts @@ -8,6 +8,7 @@ import { DS4CreatureActorSheet } from "./actor/sheets/creature-sheet"; import { createCheckRoll } from "./rolls/check-factory"; import { registerSystemSettings } from "./settings"; import { migration } from "./migrations"; +import handlebarsHelpers from "./handlebars-helpers"; Hooks.once("init", async () => { console.log(`DS4 | Initializing the DS4 Game System\n${DS4.ASCII}`); @@ -39,7 +40,8 @@ Hooks.once("init", async () => { Items.unregisterSheet("core", ItemSheet); Items.registerSheet("ds4", DS4ItemSheet, { makeDefault: true }); - registerHandlebarsPartials(); + await registerHandlebarsPartials(); + registerHandlebarsHelpers(); }); async function registerHandlebarsPartials() { @@ -65,6 +67,10 @@ async function registerHandlebarsPartials() { return loadTemplates(templatePaths); } +function registerHandlebarsHelpers() { + Object.entries(handlebarsHelpers).forEach(([key, helper]) => Handlebars.registerHelper(key, helper)); +} + /** * This function runs after game data has been requested and loaded from the servers, so entities exist */ diff --git a/src/module/handlebars-helpers.ts b/src/module/handlebars-helpers.ts new file mode 100644 index 0000000..2790ea4 --- /dev/null +++ b/src/module/handlebars-helpers.ts @@ -0,0 +1,6 @@ +export default { htmlToPlainText }; + +function htmlToPlainText(input: string | null | undefined): string | null | undefined { + if (!input) return; + return $(input).text(); +} diff --git a/src/scss/components/_forms.scss b/src/scss/components/_forms.scss index 9f8f817..7da745c 100644 --- a/src/scss/components/_forms.scss +++ b/src/scss/components/_forms.scss @@ -28,15 +28,16 @@ header.sheet-header { padding: 0px; margin: $header-top-margin 10px $header-top-margin 0; border-bottom: 0; + @include font-heading-upper; + display: block; input { width: 100%; height: 100%; margin: 0; border: none; background-color: transparent; + @include font-heading-upper; } - @include font-heading-upper; - display: block; } h2.item-type { @include font-heading-upper; diff --git a/src/scss/components/_tabs.scss b/src/scss/components/_tabs.scss index fbeb235..b46da6b 100644 --- a/src/scss/components/_tabs.scss +++ b/src/scss/components/_tabs.scss @@ -1,10 +1,10 @@ nav.tabs { - height: 40px; + height: auto; border-top: 2px groove $c-border-groove; border-bottom: 2px groove $c-border-groove; .item { - line-height: 40px; + // line-height: 40px; font-weight: bold; } diff --git a/src/templates/actor/partials/items-overview.hbs b/src/templates/actor/partials/items-overview.hbs index 681a9a7..41c8edd 100644 --- a/src/templates/actor/partials/items-overview.hbs +++ b/src/templates/actor/partials/items-overview.hbs @@ -79,11 +79,12 @@ data-dtype="Number" data-property="data.quantity" title="{{localize 'DS4.Quantity'}}" /> {{!-- name --}} + data-property="name" title="{{htmlToPlainText item.data.data.description}}" /> {{!-- item type specifics --}} {{> @partial-block}} {{!-- description --}} -