Make Physical Attribute tab work with NPC/Unnatural sheets
This commit is contained in:
@@ -173,6 +173,11 @@ export default class DGActorSheet extends DGSheetMixin(ActorSheetV2) {
|
||||
this.actor.system.sortedCustomSkills = sortedCustomSkills;
|
||||
}
|
||||
|
||||
// Set title for Physical Attributes.
|
||||
context.physicalAttributesTitle = game.i18n.localize(
|
||||
"DG.Sheet.BlockHeaders.Attributes",
|
||||
);
|
||||
|
||||
return context;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ export default class DGNPCSheet extends DGActorSheet {
|
||||
labelPrefix: "DG.Navigation",
|
||||
tabs: [
|
||||
{ id: "skills", label: "Skills" },
|
||||
{ id: "physical", label: "Physical" },
|
||||
{ id: "gear", label: "Gear" },
|
||||
{ id: "about", icon: "fas fa-question-circle", label: "" },
|
||||
],
|
||||
@@ -21,19 +20,15 @@ export default class DGNPCSheet extends DGActorSheet {
|
||||
header: {
|
||||
template: `${this.TEMPLATE_PATH}/parts/header.html`,
|
||||
},
|
||||
physical: {
|
||||
template: `${this.TEMPLATE_PATH}/partials/attributes-grid-partial.html`,
|
||||
},
|
||||
tabs: super.PARTS.tabs,
|
||||
skills: {
|
||||
template: `${this.TEMPLATE_PATH}/parts/skills-tab.html`,
|
||||
templates: [`${this.TEMPLATE_PATH}/partials/custom-skills-partial.html`],
|
||||
scrollable: [""],
|
||||
},
|
||||
physical: {
|
||||
template: `${this.TEMPLATE_PATH}/parts/physical-tab.html`,
|
||||
templates: [
|
||||
`${this.TEMPLATE_PATH}/partials/attributes-grid-partial.html`,
|
||||
],
|
||||
scrollable: [""],
|
||||
},
|
||||
gear: {
|
||||
template: `${this.TEMPLATE_PATH}/parts/gear-tab.html`,
|
||||
scrollable: [""],
|
||||
@@ -50,6 +45,11 @@ export default class DGNPCSheet extends DGActorSheet {
|
||||
async _prepareContext(options) {
|
||||
const context = await super._prepareContext(options);
|
||||
|
||||
// Override physical attribute title.
|
||||
context.physicalAttributesTitle = game.i18n.localize(
|
||||
"DG.Sheet.BlockHeaders.Statistics",
|
||||
);
|
||||
|
||||
context.enrichedDescription =
|
||||
await foundry.applications.ux.TextEditor.implementation.enrichHTML(
|
||||
this.actor.system.notes,
|
||||
|
||||
@@ -1,35 +1,40 @@
|
||||
<div class="grid grid-3col">
|
||||
{{#each actor.system.statistics as |statistic key| }}
|
||||
<div class="flex-group-center flex-mid-border">
|
||||
<div>
|
||||
<div class="physical-stats-outer-grid-3col">
|
||||
<label class="rollable resource-label"
|
||||
data-action="roll"
|
||||
data-rolltype="stat"
|
||||
data-key="{{key}}"
|
||||
data-tooltip="{{localize (concat 'DG.Attributes.Tooltip.' key)}}"
|
||||
for="system.statistics.{{key}}.value">
|
||||
{{localize (concat 'DG.Attributes.' key)}}
|
||||
</label>
|
||||
<input class="centered"
|
||||
type="text"
|
||||
name="system.statistics.{{key}}.value"
|
||||
value="{{statistic.value}}"
|
||||
data-dtype="Number" />
|
||||
<span class="rollable"
|
||||
data-action="roll"
|
||||
data-rolltype="stat"
|
||||
data-key="{{key}}"
|
||||
title="{{localize 'DG.Tooltip.x5AttributeLabel'}}">({{numberFormat statistic.x5 decimals=0 sign=false}}% <i class="fas fa-dice"></i>)</span>
|
||||
</div>
|
||||
<section class="attributes-wrapper">
|
||||
<div class="horizontal-bar-section-divider">
|
||||
<span>{{physicalAttributesTitle}}</span>
|
||||
</div>
|
||||
<div class="grid grid-3col">
|
||||
{{#each actor.system.statistics as |statistic key| }}
|
||||
<div class="flex-group-center flex-mid-border">
|
||||
<div>
|
||||
<input type="text"
|
||||
name="system.statistics.{{key}}.distinguishing_feature"
|
||||
value="{{statistic.distinguishing_feature}}"
|
||||
data-dtype="String"
|
||||
title="{{localize 'DG.Tooltip.DistinguishingFeature'}}" />
|
||||
<div class="physical-stats-outer-grid-3col">
|
||||
<label class="rollable resource-label"
|
||||
data-action="roll"
|
||||
data-rolltype="stat"
|
||||
data-key="{{key}}"
|
||||
data-tooltip="{{localize (concat 'DG.Attributes.Tooltip.' key)}}"
|
||||
for="system.statistics.{{key}}.value">
|
||||
{{localize (concat 'DG.Attributes.' key)}}
|
||||
</label>
|
||||
<input class="centered"
|
||||
type="text"
|
||||
name="system.statistics.{{key}}.value"
|
||||
value="{{statistic.value}}"
|
||||
data-dtype="Number" />
|
||||
<span class="rollable"
|
||||
data-action="roll"
|
||||
data-rolltype="stat"
|
||||
data-key="{{key}}"
|
||||
title="{{localize 'DG.Tooltip.x5AttributeLabel'}}">({{numberFormat statistic.x5 decimals=0 sign=false}}% <i class="fas fa-dice"></i>)</span>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text"
|
||||
name="system.statistics.{{key}}.distinguishing_feature"
|
||||
value="{{statistic.distinguishing_feature}}"
|
||||
data-dtype="String"
|
||||
title="{{localize 'DG.Tooltip.DistinguishingFeature'}}" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
data-group="primary"
|
||||
data-tab="physical">
|
||||
|
||||
<div class="horizontal-bar-section-divider">
|
||||
<span>{{localize "DG.Sheet.BlockHeaders.Attributes"}}</span>
|
||||
</div>
|
||||
|
||||
{{> "systems/deltagreen/templates/actor/partials/attributes-grid-partial.html" actorType="agent"}}
|
||||
|
||||
<br />
|
||||
|
||||
Reference in New Issue
Block a user