diff --git a/src/assets/heart_empty.png b/src/assets/heart_empty.png new file mode 100644 index 0000000..0673545 Binary files /dev/null and b/src/assets/heart_empty.png differ diff --git a/src/assets/heart_full.png b/src/assets/heart_full.png new file mode 100644 index 0000000..29747b8 Binary files /dev/null and b/src/assets/heart_full.png differ diff --git a/src/assets/shield.png b/src/assets/shield.png new file mode 100644 index 0000000..a2f7eed Binary files /dev/null and b/src/assets/shield.png differ diff --git a/src/lang/en.json b/src/lang/en.json index 2a6f65d..cd52679 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -53,6 +53,7 @@ "OSE.saves.spell.long": "Rod, Staff, Spell", "OSE.Health": "Hit Points", + "OSE.HealthMax": "Maximum Hit Points", "OSE.HealthShort": "HP", "OSE.HitDice": "Hit Dice", "OSE.HitDiceShort": "HD", diff --git a/src/module/helpers.js b/src/module/helpers.js new file mode 100644 index 0000000..0062abd --- /dev/null +++ b/src/module/helpers.js @@ -0,0 +1,18 @@ +export const registerHelpers = async function () { + // Handlebars template helpers + Handlebars.registerHelper("eq", function (a, b) { + return a == b; + }); + + Handlebars.registerHelper("add", function (lh, rh) { + return parseInt(lh) + parseInt(rh); + }); + + Handlebars.registerHelper("subtract", function (lh, rh) { + return parseInt(rh) - parseInt(lh); + }); + + Handlebars.registerHelper("counter", function (status, value, max) { + return status ? Math.clamped((100.0 * value) / max, 0, 100) : Math.clamped(100 - (100.0 * value) / max, 0, 100); + }); +}; diff --git a/src/ose.js b/src/ose.js index 33ecae6..2836cb1 100644 --- a/src/ose.js +++ b/src/ose.js @@ -7,19 +7,7 @@ import { OseActor } from "./module/actor/entity.js"; import { OseItem } from "./module/item/entity.js"; import { OSE } from "./module/config.js"; import { registerSettings } from './module/settings.js'; - -// Handlebars template helpers -Handlebars.registerHelper("eq", function (a, b) { - return a == b; -}); - -Handlebars.registerHelper("add", function (lh, rh) { - return parseInt(lh) + parseInt(rh); -}); - -Handlebars.registerHelper("subtract", function (lh, rh) { - return parseInt(rh) - parseInt(lh); -}); +import { registerHelpers } from './module/helpers.js'; /* -------------------------------------------- */ /* Foundry VTT Initialization */ @@ -37,6 +25,9 @@ Hooks.once("init", async function () { CONFIG.OSE = OSE; + // Custom Handlebars helpers + registerHelpers(); + // Register custom system settings registerSettings(); diff --git a/src/scss/actor-base.scss b/src/scss/actor-base.scss index 2ee8b45..2099b9c 100644 --- a/src/scss/actor-base.scss +++ b/src/scss/actor-base.scss @@ -81,8 +81,7 @@ .item { padding: 2px; &.active { - background: $colorTan; - text-shadow: none; + background: $colorCrimson; } } } @@ -96,7 +95,7 @@ padding: 0; .attribute { position: relative; - margin: 10px 2px; + margin: 10px; border: 1px solid $colorTan; .attribute-name { color: whitesmoke; @@ -109,6 +108,9 @@ padding: 4px; display: flex; flex-direction: row; + &.multiple input { + min-width: 28px; + } } .attribute-mod { position: absolute; @@ -120,6 +122,7 @@ } } .attribute-group { + flex: 0 0 105px; .attributes { .attribute { display: flex; @@ -128,6 +131,17 @@ width: 40px; margin: 0; line-height: 28px; + a { + margin: auto; + } + } + &.saving-throw .attribute-name { + line-height: 16px; + width: 80px; + } + .attribute-value { + width: 45px; + flex-grow: 0; } } } diff --git a/src/scss/character.scss b/src/scss/character.scss index cab8782..6576274 100644 --- a/src/scss/character.scss +++ b/src/scss/character.scss @@ -25,6 +25,45 @@ /* Sheet Body */ /* ----------------------------------------- */ .sheet-body { + .health { + &.armor-class { + background: url('/systems/ose/assets/shield.png') no-repeat center; + background-size: 90px; + } + margin: 10px 0; + height: 90px; + position: relative; + input { + font-size: 16px; + font-weight: bolder; + text-shadow: 0 0 2px white, 0 1px 2px white, 1px 0 2px white, 1px 1px 2px white; + } + .health-top { + border-bottom: none; + position: absolute; + font-size: 24px; + top: 28px; + width: 70px; + left: calc(50% - 35px); + } + .health-bottom { + border-bottom: none; + position: absolute; + bottom: 12px; + width: 40px; + right: calc(50% + -20px); + } + .health-empty { + background: url('/systems/ose/assets/heart_empty.png') no-repeat center; + background-size: 90px; + background-position: top; + } + .health-full { + background: url('/systems/ose/assets/heart_full.png') no-repeat center; + background-size: 90px; + background-position: bottom; + } + } .inventory { overflow: auto; .header-spells { diff --git a/src/scss/variables.scss b/src/scss/variables.scss index bd6ec1b..5c571fd 100644 --- a/src/scss/variables.scss +++ b/src/scss/variables.scss @@ -3,7 +3,7 @@ /* Sheet Styles */ /* ----------------------------------------- */ -$colorDark: #191813; +$colorDark: rgba(0, 0, 0, 0.9); $colorFaint: #c9c7b8; $colorBeige: #b5b3a4; $colorTan: #7a7971; diff --git a/src/templates/actors/partials/character-attributes-tab.html b/src/templates/actors/partials/character-attributes-tab.html index 0ff6cfa..baaf93c 100644 --- a/src/templates/actors/partials/character-attributes-tab.html +++ b/src/templates/actors/partials/character-attributes-tab.html @@ -1,38 +1,11 @@
+ {{!-- Resource Tracking --}} +
+
+ + +
+
+
+
+ {{#if config.ascendingAC}} + + + {{else}} + + + {{/if}} +
+
{{!-- Saving throws --}}