mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
developing experience setting page
This commit is contained in:
parent
0c9c37470a
commit
ca297b97b1
9 changed files with 55 additions and 15 deletions
|
|
@ -29,12 +29,13 @@ export default class AdversarySheet extends DaggerheartSheet(ActorSheetV2) {
|
|||
sidebar: { template: 'systems/daggerheart/templates/sheets/actors/adversary/sidebar.hbs' },
|
||||
header: { template: 'systems/daggerheart/templates/sheets/actors/adversary/header.hbs' },
|
||||
features: { template: 'systems/daggerheart/templates/sheets/actors/adversary/features.hbs' },
|
||||
notes: { template: 'systems/daggerheart/templates/sheets/actors/adversary/notes.hbs' },
|
||||
effects: { template: 'systems/daggerheart/templates/sheets/actors/adversary/effects.hbs' }
|
||||
};
|
||||
|
||||
static TABS = {
|
||||
features: {
|
||||
active: false,
|
||||
active: true,
|
||||
cssClass: '',
|
||||
group: 'primary',
|
||||
id: 'features',
|
||||
|
|
|
|||
|
|
@ -23,7 +23,10 @@ export default class DHAdversarySettings extends HandlebarsApplicationMixin(Appl
|
|||
resizable: false
|
||||
},
|
||||
position: { width: 455, height: 'auto' },
|
||||
actions: {},
|
||||
actions: {
|
||||
addExperience: this.addExperience,
|
||||
removeExperience: this.removeExperience
|
||||
},
|
||||
form: {
|
||||
handler: this.updateForm,
|
||||
submitOnChange: true,
|
||||
|
|
@ -111,6 +114,22 @@ export default class DHAdversarySettings extends HandlebarsApplicationMixin(Appl
|
|||
return tabs;
|
||||
}
|
||||
|
||||
static async addExperience() {
|
||||
const newExperience = {
|
||||
name: 'Experience',
|
||||
modifier: 0
|
||||
};
|
||||
await this.actor.update({ [`system.experiences.${foundry.utils.randomID()}`]: newExperience });
|
||||
}
|
||||
|
||||
static async removeExperience() {
|
||||
const newExperience = {
|
||||
name: 'Experience',
|
||||
modifier: 0
|
||||
};
|
||||
await this.actor.update({ [`system.experiences.${foundry.utils.randomID()}`]: newExperience });
|
||||
}
|
||||
|
||||
static async updateForm(event, _, formData) {
|
||||
await this.actor.update(formData.object);
|
||||
this.render();
|
||||
|
|
|
|||
|
|
@ -5074,6 +5074,9 @@ div.daggerheart.views.multiclass {
|
|||
background-color: light-dark(#18162e, #f3c267);
|
||||
color: light-dark(#efe6d8, #18162e);
|
||||
}
|
||||
.application.dh-style fieldset.fit-height {
|
||||
height: 95%;
|
||||
}
|
||||
.application.dh-style fieldset.flex {
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
|
|
|
|||
|
|
@ -112,6 +112,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
&.fit-height {
|
||||
height: 95%;
|
||||
}
|
||||
|
||||
&.flex {
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
|
|
|
|||
|
|
@ -4,4 +4,7 @@
|
|||
data-group='{{tabs.features.group}}'
|
||||
>
|
||||
<h2>features</h2>
|
||||
{{#debug document}}
|
||||
|
||||
{{/debug}}
|
||||
</section>
|
||||
|
|
@ -8,11 +8,21 @@
|
|||
</div>
|
||||
<div class="tags">
|
||||
<div class="tag">
|
||||
{{localize (concat 'DAGGERHEART.Tiers.' source.system.tier)}}
|
||||
<span>
|
||||
{{localize (concat 'DAGGERHEART.Tiers.' source.system.tier)}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="tag">
|
||||
{{localize (concat 'DAGGERHEART.Adversary.Type.' source.system.type '.label')}}
|
||||
<span>
|
||||
{{localize (concat 'DAGGERHEART.Adversary.Type.' source.system.type '.label')}}
|
||||
</span>
|
||||
</div>
|
||||
{{#if (eq source.system.type 'horde')}}
|
||||
<div class="tag">
|
||||
<span>{{source.system.hordeHp}}</span>
|
||||
<span>/HP</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
<line-div></line-div>
|
||||
<div class="adversary-info">
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
data-tab='{{tabs.notes.id}}'
|
||||
data-group='{{tabs.notes.group}}'
|
||||
>
|
||||
<fieldset>
|
||||
<legend>{{tabs.notes.label}}</legend>
|
||||
<fieldset class="fit-height">
|
||||
<legend>{{localize tabs.notes.label}}</legend>
|
||||
{{formInput systemFields.notes value=document.system.notes enriched=source.document.notes localize=true toggled=true}}
|
||||
</fieldset>
|
||||
</section>
|
||||
|
|
@ -81,7 +81,7 @@
|
|||
<side-line-div></side-line-div>
|
||||
</div>
|
||||
<ul class="items-sidebar-list">
|
||||
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-item.hbs' item=source.system.attack type=source.system.attack.type isSidebar=true}}
|
||||
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-item.hbs' item=source.system.attack type=source.system.attack.systemPath isSidebar=true}}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="experience-section">
|
||||
|
|
@ -96,7 +96,7 @@
|
|||
<div class="experience-value">
|
||||
+{{experience.total}}
|
||||
</div>
|
||||
<input name="{{concat "system.experiences." id ".description"}}" data-experience={{id}} value="{{experience.description}}" type="text" />
|
||||
<span>{{experience.description}}</span>
|
||||
<div class="controls">
|
||||
<a data-action="toChat" data-type="experience" data-uuid="{{id}}"><i class="fa-regular fa-message"></i></a>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,15 +3,15 @@
|
|||
data-tab='{{tabs.experiences.id}}'
|
||||
data-group='{{tabs.experiences.group}}'
|
||||
>
|
||||
<button>
|
||||
<button data-action="addExperience">
|
||||
New Experience
|
||||
</button>
|
||||
{{#each document.system.experiences as |experience id|}}
|
||||
<div class="experience-row">
|
||||
<div class="experience-value">
|
||||
+{{experience.total}}
|
||||
</div>
|
||||
<input name="{{concat "system.experiences." id ".name"}}" data-experience={{id}} value="{{experience.name}}" type="text" />
|
||||
|
||||
{{#each document.system.experiences as |experience index|}}
|
||||
<div class="experience-chip">
|
||||
<input class="experience.value" type="text" name="system.experiences.{{index}}.name" value="{{experience.name}}" />
|
||||
<input class="experience-value" type="text" name="system.experiences.{{index}}.value" value="{{experience.value}}" data-dtype="Number" />
|
||||
<button class="experience-button" data-action="removeExperience" data-experience="{{experience.id}}"><i class="fa-solid fa-x"></i></button>
|
||||
</div>
|
||||
{{/each}}
|
||||
</section>
|
||||
Loading…
Add table
Add a link
Reference in a new issue