add skills tab

This commit is contained in:
jalensailin
2025-07-18 22:47:29 -04:00
parent 161158d9f6
commit 2a819ca288
4 changed files with 96 additions and 321 deletions
+6
View File
@@ -40,6 +40,12 @@ export default class DeltaGreenActorSheet extends DGSheetMixin(ActorSheetV2) {
tabs: {
template: `templates/generic/tab-navigation.hbs`, // From FoundryVTT
},
skills: {
template: `${this.TEMPLATE_PATH}/actor/parts/skills-tab.html`,
templates: [
`${this.TEMPLATE_PATH}/actor/partials/custom-skills-partial.html`,
],
},
});
/* -------------------------------------------- */
-1
View File
@@ -5,7 +5,6 @@
*/
export default async function preloadHandlebarsTemplates() {
return foundry.applications.handlebars.loadTemplates([
"systems/deltagreen/templates/actor/actor-sheet.html",
"systems/deltagreen/templates/actor/limited-sheet.html",
"systems/deltagreen/templates/actor/unnatural-sheet.html",
"systems/deltagreen/templates/actor/npc-sheet.html",
-320
View File
@@ -1,320 +0,0 @@
<form autocomplete="off">
{{!-- Sheet Body --}}
<section class="sheet-body">
{{!-- Skills Tab --}}
<div class="tab skills" data-group="primary" data-tab="skills">
<div class="horizontal-bar-section-divider">
<span>{{localize "DG.Sheet.BlockHeaders.SkillsAndTraining"}}</span>
</div>
<div class="grid grid-3col">
{{#each actor.system.sortedSkills as |skill key| }}
<div class="flexrow flex-group-left flex-thin-border">
<label data-tooltip="{{localize (concat 'DG.Skills.Tooltip.' skill.key)}}">
{{localizeWithFallback (concat "DG.Skills." skill.key) skill.label }}
</label>
<label class="{{if_gt skill.proficiency 0 'rollable' 'not-rollable'}} skill-label"
data-key="{{skill.key}}"
data-rolltype="skill"
for="system.skills.{{skill.key}}.value"
{{#if skill.proficiency }}
data-tooltip="{{localize 'DG.Tooltip.SkillLabel'}}"
{{/if}}
{{#unless skill.proficiency}}
data-tooltip="{{localize 'DG.Tooltip.CannotRollSkillLabel'}}"
{{/unless}}>
<i class="fas fa-dice"></i>
</label>
{{#if_eq skill.key 'ritual' }}
{{#if (keepSanityPrivate) }}
<input class="percentile-skill-input"
type="text"
name="system.skills.{{skill.key}}.proficiency"
value="??"
data-dtype="Number"
{{#if skill.isCalculatedValue }}
disabled
{{/if}} />
<input class="checkbox-skill-input"
type="checkbox"
name="system.skills.{{skill.key}}.failure"
{{checked skill.failure}}
data-dtype="Boolean"
{{#if skill.cannotBeImprovedByFailure }}
disabled
{{/if}}
title="{{localize 'DG.Tooltip.SkillFailCheckbox'}}" />
{{/if}}
{{#unless (keepSanityPrivate)}}
<input class="percentile-skill-input"
type="text"
name="system.skills.{{skill.key}}.proficiency"
value="{{skill.proficiency}}"
data-dtype="Number"
{{#if skill.isCalculatedValue }}
disabled
{{/if}} />
<input class="checkbox-skill-input"
type="checkbox"
name="system.skills.{{skill.key}}.failure"
{{checked skill.failure}}
data-dtype="Boolean"
{{#if skill.cannotBeImprovedByFailure }}
disabled
{{/if}}
title="{{localize 'DG.Tooltip.SkillFailCheckbox'}}" />
{{/unless}}
{{/if_eq}}
{{#if_not_eq skill.key 'ritual' }}
<input class="percentile-skill-input {{#if_not_eq skill.proficiency skill.targetProficiency }}target-proficiency-mod{{/if_not_eq}}"
type="text"
name="system.skills.{{skill.key}}.proficiency"
value="{{skill.proficiency}}"
data-dtype="Number"
data-tooltip="{{skill.targetProficiency}}"
{{#if skill.isCalculatedValue }}
disabled
{{/if}} />
<input class="checkbox-skill-input"
type="checkbox"
name="system.skills.{{skill.key}}.failure"
{{checked skill.failure}}
data-dtype="Boolean"
{{#if skill.cannotBeImprovedByFailure }}
disabled
{{/if}}
title="{{localize 'DG.Tooltip.SkillFailCheckbox'}}" />
{{/if_not_eq}}
</div>
{{/each}}
</div>
{{!-- Custom Skills and Special Training --}}
<div>{{> "systems/deltagreen/templates/actor/partials/custom-skills-partial.html" actorType="agent"}}</div>
</div>
{{!-- Physical Statistics like STR, CON, etc. --}}
<div class="tab physical" 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 />
<div class="horizontal-bar-section-divider">
<span>{{localize "DG.Sheet.BlockHeaders.Injuries"}}</span>
</div>
<div>
<div class="first-aid-received-section resource">
<label class="bolded-label first-aid-label"
data-tooltip="{{localize 'DG.Tooltip.FirstAidAttempted'}}">
{{localize 'DG.Physical.FirstAidLabel'}}
</label>
<input class="labeled-resource-checkbox"
type="checkbox"
name="system.physical.firstAidAttempted"
{{checked actor.system.physical.firstAidAttempted}}
data-dtype="Boolean"
title="{{localize 'DG.Tooltip.FirstAidAttempted'}}" />
</div>
<div class="exhausted-section resource">
<label class="bolded-label exhaustion-label"
data-tooltip="{{localize 'DG.Tooltip.Exhaustion'}}">{{localize 'DG.Physical.Exhausted'}}</label>
<input class="labeled-resource-checkbox"
type="checkbox"
name="system.physical.exhausted"
{{checked actor.system.physical.exhausted}}
data-dtype="Boolean"
title="{{localize 'DG.Tooltip.Exhaustion'}}" />
{{#if actor.system.physical.exhausted }}
<label class="bolded-label exhaustion-label"
data-tooltip="{{localize 'DG.Tooltip.Exhaustion'}}">{{localize 'DG.Physical.ExhaustionPenalty'}}</label>
<input type="number"
name="system.physical.exhaustedPenalty"
value="{{actor.system.physical.exhaustedPenalty}}"
data-dtype="Number"
title="{{localize 'DG.Tooltip.Exhaustion'}}"
min="-99"
max="0" />
{{/if}}
</div>
<div>
<label class="bolded-label">{{localize 'DG.Physical.Wounds'}}</label>
<!--<input class="fill-remaining-space"
type="text"
name="system.physical.wounds"
value="{{system.physical.wounds}}"
data-dtype="String" /> -->
<!-- This seems to save values, but not retrieve them... -->
<textarea class="wounds" rows="10" cols="10" name="system.physical.wounds">{{actor.system.physical.wounds}}</textarea>
</div>
</div>
</div>
{{!-- Psychological Tab (formerly 'Mental', formerly 'Motivations') --}}
<div class="tab motivations" data-group="primary" data-tab="motivations">
<div class="horizontal-bar-section-divider">
<span>{{localize "DG.Sheet.BlockHeaders.BreakingPointAndAdaptations"}}</span>
</div>
<div class="">
<div class="breaking-point-grid-3col">
<label class="bolded-label"
data-tooltip="{{localize 'DG.Mental.Tooltip.BreakingPoint'}}">
{{localize 'DG.Mental.BreakingPoint'}}
</label>
<input class="centered-input-value"
title="{{localize 'DG.Tooltip.BreakPoint'}}"
type="text"
name="system.sanity.currentBreakingPoint"
value="{{actor.system.sanity.currentBreakingPoint}}"
data-dtype="Number" />
<a class="btn-tiny btn-reset-breaking-point"
title="{{localize 'DG.Tooltip.BreakPointReset'}}">{{localize 'DG.Mental.Reset'}}</a>
</div>
<div class="">
<h4 class="bolded-label">{{localize 'DG.Mental.SanityLossIncidentsLabel'}}</h4>
<div class="adaptation-grid-5col">
<label>{{localize 'DG.Mental.Violence'}}</label>
<input class="labeled-resource-checkbox"
type="checkbox"
name="system.sanity.adaptations.violence.incident1"
{{checked actor.system.sanity.adaptations.violence.incident1}}
data-dtype="Boolean" />
<input class="labeled-resource-checkbox"
type="checkbox"
name="system.sanity.adaptations.violence.incident2"
{{checked actor.system.sanity.adaptations.violence.incident2}}
data-dtype="Boolean" />
<input class="labeled-resource-checkbox"
type="checkbox"
name="system.sanity.adaptations.violence.incident3"
{{checked actor.system.sanity.adaptations.violence.incident3}}
data-dtype="Boolean" />
<label class="adapted-label"
data-tooltip="{{localize 'DG.Tooltip.AdaptedToViolence'}}">
{{#if actor.system.sanity.adaptations.violence.isAdapted }}
{{localize 'DG.Mental.AdaptedToViolence'}}
{{/if}}
</label>
<label>{{localize 'DG.Mental.Helplessness'}}</label>
<input class="labeled-resource-checkbox"
type="checkbox"
name="system.sanity.adaptations.helplessness.incident1"
{{checked actor.system.sanity.adaptations.helplessness.incident1}}
data-dtype="Boolean" />
<input class="labeled-resource-checkbox"
type="checkbox"
name="system.sanity.adaptations.helplessness.incident2"
{{checked actor.system.sanity.adaptations.helplessness.incident2}}
data-dtype="Boolean" />
<input class="labeled-resource-checkbox"
type="checkbox"
name="system.sanity.adaptations.helplessness.incident3"
{{checked actor.system.sanity.adaptations.helplessness.incident3}}
data-dtype="Boolean" />
<label class="adapted-label"
data-tooltip="{{localize 'DG.Tooltip.AdaptedToHelplessness'}}">
{{#if actor.system.sanity.adaptations.helplessness.isAdapted }}
{{localize 'DG.Mental.AdaptedToHelplessness'}}
{{/if}}
</label>
</div>
</div>
</div>
<div class="horizontal-bar-section-divider">
<span>{{localize "DG.Sheet.BlockHeaders.MotivationsAndDisorders"}}</span>
</div>
<div>
<ol class="items-list">
<li class="item flexrow item-header">
<div class="item-name">{{localize 'DG.Mental.Motivations'}}</div>
<div class="item-name">{{localize 'DG.Mental.Disorders'}}</div>
<div class="item-controls">
<a class="item-control item-create action-pill"
title="Create item"
data-type="motivation"><i class="fas fa-plus"></i> {{localize 'DG.Generic.AddButtonLabel'}}</a>
</div>
</li>
{{#each actor.items as |item id| }}
{{#if_eq item.type 'motivation' }}
<li class="item flexrow" data-item-id="{{item.id}}">
<h4 class="item-name"
{{#if item.system.crossedOut }}
style="text-decoration: line-through"
{{/if}}>
{{item.name}}
</h4>
{{#if item.system.crossedOut }}
<h4 class="item-name">{{item.system.disorder}}</h4>
{{/if}}
<div class="item-controls">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/if_eq}}
{{/each}}
</ol>
</div>
</div>
{{!-- GEAR Tab --}}
<div class="tab items" data-group="primary" data-tab="gear">
{{> "systems/deltagreen/templates/actor/partials/equipment-partial.html" }}
</div>
{{!-- PERSONAL (Biography) Tab --}}
<div class="tab bio" data-group="primary" data-tab="bio">
<div class="horizontal-bar-section-divider">
<span>{{localize "DG.Sheet.BlockHeaders.PersonalInfoCV"}}</span>
</div>
{{> "systems/deltagreen/templates/actor/partials/cv-partial.html" }}
</div>
{{!-- Bonds Tab --}}
<div class="tab bonds" data-group="primary" data-tab="bonds">
<div class="horizontal-bar-section-divider">
<span>{{localize "DG.Sheet.BlockHeaders.BondsRelationshipsContacts"}}</span>
</div>
<div>
<ol class="items-list">
<li class="item flexrow item-header">
<div class="item-icon">
<a class="clear-all-bond-damage-checks"
title="{{localizeWithFallback 'DG.Generic.ClearAll' 'Clear All'}}"><i class="fas fa-arrow-rotate-left"></i></a>
</div>
<div class="item-image"></div>
<div class="item-name">{{localize 'DG.Bonds.Name'}}</div>
<div class="item-name">{{localize 'DG.Bonds.Relationship'}}</div>
<div class="item-name">{{localize 'DG.Bonds.Score'}}</div>
<div class="item-controls">
<a class="item-control item-create action-pill"
title="Create item"
data-type="bond"><i class="fas fa-plus"></i> {{localize 'DG.Generic.AddButtonLabel'}}</a>
</div>
</li>
{{#each actor.items as |item id| }}
{{#if_eq item.type 'bond' }}
<li class="item flexrow" data-item-id="{{item.id}}">
<input class="bond-has-been-damaged-agent-sheet-checkbox"
type="checkbox"
{{checked item.system.hasBeenDamagedSinceLastHomeScene}}
data-dtype="Boolean"
title="Check if bond has been damaged since last home scene." />
<div class="item-image">
<img src="{{item.img}}" title="{{item.name}}" width="24" height="24" />
</div>
<h4 style="word-wrap: break-word;" class="item-name">{{item.name}}</h4>
<span>{{item.system.relationship}}</span>
<span>{{item.system.score}}</span>
<div class="item-controls">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/if_eq}}
{{/each}}
</ol>
<div>
<span>{{localizeWithFallback 'DG.Generic.CheckDamagedBondsBoxUntilNextHomeScene' 'Check a damaged Bond&#39;s box until the next Home scene ends.' }}</span>
</div>
</div>
</div>
{{!-- About Tab --}}
<div class="tab about" data-group="primary" data-tab="about">
{{> "systems/deltagreen/templates/actor/partials/help-and-licensing-partial.html" }}
</div>
</section>
</form>
+90
View File
@@ -0,0 +1,90 @@
<div class="tab skills sheet-body" data-group="primary" data-tab="skills">
<div class="horizontal-bar-section-divider">
<span>{{localize "DG.Sheet.BlockHeaders.SkillsAndTraining"}}</span>
</div>
<div class="grid grid-3col">
{{#each actor.system.sortedSkills as |skill key| }}
<div class="flexrow flex-group-left flex-thin-border">
<label class="{{if_gt skill.targetProficiency 0 'rollable' 'not-rollable'}} skill-label"
data-key="{{skill.key}}"
data-rolltype="skill"
for="system.skills.{{skill.key}}.value"
{{#if skill.proficiency }}
title="{{localize 'DG.Tooltip.SkillLabel' }}"
{{/if }}
{{#unless skill.proficiency }}
title="{{localize 'DG.Tooltip.CannotRollSkillLabel' }}"
{{/unless }}>
{{localizeWithFallback (concat "DG.Skills." skill.key) skill.label }}
<i class="fas fa-dice"></i>
</label>
{{#if_eq skill.key 'ritual' }}
{{#if (keepSanityPrivate) }}
<input class="percentile-skill-input"
type="text"
name="system.skills.{{skill.key}}.proficiency"
value="??"
data-dtype="Number"
{{#if skill.isCalculatedValue }}
disabled
{{/if }} />
<input class="checkbox-skill-input"
type="checkbox"
name="system.skills.{{skill.key}}.failure"
{{checked skill.failure}}
data-dtype="Boolean"
{{#if skill.cannotBeImprovedByFailure }}
disabled
{{/if }}
title="{{localize 'DG.Tooltip.SkillFailCheckbox' }}" />
{{/if}}
{{#unless (keepSanityPrivate)}}
<input class="percentile-skill-input"
type="text"
name="system.skills.{{skill.key}}.proficiency"
value="{{skill.proficiency}}"
data-dtype="Number"
{{#if skill.isCalculatedValue }}
disabled
{{/if }} />
<input class="checkbox-skill-input"
type="checkbox"
name="system.skills.{{skill.key}}.failure"
{{checked skill.failure}}
data-dtype="Boolean"
{{#if skill.cannotBeImprovedByFailure }}
disabled
{{/if }}
title="{{localize 'DG.Tooltip.SkillFailCheckbox' }}" />
{{/unless}}
{{/if_eq}}
{{#if_not_eq skill.key 'ritual' }}
<input class="percentile-skill-input
{{#if_not_eq skill.proficiency skill.targetProficiency }}
target-proficiency-mod{{/if_not_eq }}"
type="text"
name="system.skills.{{skill.key}}.proficiency"
value="{{skill.proficiency}}"
data-dtype="Number"
data-tooltip="{{skill.targetProficiency}}"
{{#if skill.isCalculatedValue }}
disabled
{{/if }} />
<input class="checkbox-skill-input"
type="checkbox"
name="system.skills.{{skill.key}}.failure"
{{checked skill.failure}}
data-dtype="Boolean"
{{#if skill.cannotBeImprovedByFailure }}
disabled
{{/if }}
title="{{localize 'DG.Tooltip.SkillFailCheckbox' }}" />
{{/if_not_eq}}
</div>
{{/each}}
</div>
{{!-- Custom Skills and Special Training --}}
<div>
{{> "systems/deltagreen/templates/actor/partials/custom-skills-partial.html" actorType="agent"}}
</div>
</div>