Skip to content

Commit

Permalink
Merge pull request #145 from sasquach45932/master
Browse files Browse the repository at this point in the history
Fixed missing armor, insanity and corruption values on creature reference sheet
  • Loading branch information
ClipplerBlood authored Nov 29, 2023
2 parents d294ecc + 0c4d087 commit 52906e2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
9 changes: 9 additions & 0 deletions src/module/utils/handlebars-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export function registerHandlebarsHelpers() {
_buildPathAttributeTwoSetViewSelector(attributeName, isSelected, selectedName, selectedValue, idx)
)
Handlebars.registerHelper('dlAvailabilityDropdown', (groupName, checkedKey) => _buildAvailabilityDropdownItem(groupName, checkedKey))
Handlebars.registerHelper('dlCheckCharacteristicsIsNull', (actorData) => _CheckCharacteristicsIsNull(actorData));
}

// ----------------------------------------------------
Expand Down Expand Up @@ -92,6 +93,14 @@ function _buildRadioBoxes(groupName, checkedKey) {

// ----------------------------------------------------

function _CheckCharacteristicsIsNull(actorData) {
if (actorData === null) {
return true
} else {
return false
}
}

function _buildDropdownItem(groupName, checkedKey) {
let attributes = _getAttributes(groupName)
let html = ""
Expand Down
11 changes: 7 additions & 4 deletions src/templates/tabs/creature-reference.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@
{{system.perceptionsenses}}
</div>
<div>
<b>{{localize "DL.ArmorDefense"}}</b> {{system.characteristics.defense}};&nbsp;
<b>{{localize "DL.CreatureHealth"}}</b> {{system.characteristics.health.max}}
<b>{{localize "DL.ArmorDefense"}}</b> {{system.characteristics.defense}}{{#if system.armor}} ({{system.armor}}){{/if}};&nbsp;
<b>{{localize "DL.CreatureHealth"}}</b> {{system.characteristics.health.max}};&nbsp;
<b>{{localize "DL.CharInsanity"}}</b> {{#unless (dlCheckCharacteristicsIsNull system.characteristics.insanity.value)}} {{system.characteristics.insanity.value}};&nbsp;{{/unless}}
{{#if (dlCheckCharacteristicsIsNull system.characteristics.insanity.value)}}–;&nbsp;{{/if}}
<b>{{localize "DL.CharCorruption"}}</b> {{#unless (dlCheckCharacteristicsIsNull system.characteristics.corruption.value)}} {{system.characteristics.corruption.value}}&nbsp;{{/unless}}
{{#if (dlCheckCharacteristicsIsNull system.characteristics.corruption.value)}}&nbsp;{{/if}}
</div>
<div>
<b>{{localize "DL.AttributeStrength"}}</b> {{system.attributes.strength.value}} ({{plusify
Expand All @@ -35,7 +39,7 @@
<b>{{localize "DL.AttributeWill"}}</b> {{system.attributes.will.value}} ({{plusify system.attributes.will.modifier}})
</div>
<div>
<b>{{localize "DL.CharSpeed"}}</b> {{system.characteristics.speed}};
<b>{{localize "DL.CharSpeed"}}</b> {{system.characteristics.speed}}
{{system.speedtraits}}
</div>

Expand Down Expand Up @@ -144,4 +148,3 @@
{{/if}}

</div>

0 comments on commit 52906e2

Please sign in to comment.