mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-16 05:31:07 +01:00
Stressful task
This commit is contained in:
parent
c887f82e3f
commit
3334baef11
2 changed files with 25 additions and 20 deletions
|
|
@ -20,6 +20,7 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
||||||
toggleVault: CharacterSheet.#toggleVault,
|
toggleVault: CharacterSheet.#toggleVault,
|
||||||
rollAttribute: CharacterSheet.#rollAttribute,
|
rollAttribute: CharacterSheet.#rollAttribute,
|
||||||
toggleHitPoints: CharacterSheet.#toggleHitPoints,
|
toggleHitPoints: CharacterSheet.#toggleHitPoints,
|
||||||
|
toggleStress: CharacterSheet.#toggleStress,
|
||||||
toggleHope: CharacterSheet.#toggleHope,
|
toggleHope: CharacterSheet.#toggleHope,
|
||||||
toggleLoadoutView: CharacterSheet.#toggleLoadoutView,
|
toggleLoadoutView: CharacterSheet.#toggleLoadoutView,
|
||||||
openPack: CharacterSheet.#openPack,
|
openPack: CharacterSheet.#openPack,
|
||||||
|
|
@ -729,7 +730,7 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Toggles a hitpoint resource value.
|
* Toggles hitpoint resource value.
|
||||||
* @type {ApplicationClickAction}
|
* @type {ApplicationClickAction}
|
||||||
*/
|
*/
|
||||||
static async #toggleHitPoints(_, button) {
|
static async #toggleHitPoints(_, button) {
|
||||||
|
|
@ -738,6 +739,16 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
||||||
await this.document.update({ 'system.resources.hitPoints.value': newValue });
|
await this.document.update({ 'system.resources.hitPoints.value': newValue });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Toggles stress resource value.
|
||||||
|
* @type {ApplicationClickAction}
|
||||||
|
*/
|
||||||
|
static async #toggleStress(_, button) {
|
||||||
|
const StressValue = Number.parseInt(button.dataset.value);
|
||||||
|
const newValue = this.document.system.resources.stress.value >= StressValue ? StressValue - 1 : StressValue;
|
||||||
|
await this.document.update({ 'system.resources.stress.value': newValue });
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Toggles a hope resource value.
|
* Toggles a hope resource value.
|
||||||
* @type {ApplicationClickAction}
|
* @type {ApplicationClickAction}
|
||||||
|
|
|
||||||
|
|
@ -24,15 +24,11 @@
|
||||||
<span class='slot {{#if (gte ../document.system.resources.hitPoints.value (add this 1))}}filled{{/if}}' data-action='toggleHitPoints' data-value="{{add this 1}}">
|
<span class='slot {{#if (gte ../document.system.resources.hitPoints.value (add this 1))}}filled{{/if}}' data-action='toggleHitPoints' data-value="{{add this 1}}">
|
||||||
</span>
|
</span>
|
||||||
{{/times}}
|
{{/times}}
|
||||||
</div> {{!--
|
</div>
|
||||||
<p><input class="bar-input" name="system.resources.hitPoints.value" min="0" max='{{document.system.resources.hitPoints.max}}'
|
</div>
|
||||||
value="{{document.system.resources.hitPoints.value}}" type="number"></p>
|
<div class='progress-bar'>
|
||||||
<p>/</p>
|
|
||||||
<p class="bar-label">{{document.system.resources.hitPoints.max}}</p> --}}
|
|
||||||
</div>
|
</div>
|
||||||
<div
|
|
||||||
class='progress-bar'
|
|
||||||
></div>
|
|
||||||
<div class="status-label">
|
<div class="status-label">
|
||||||
<h4><span>{{localize "DAGGERHEART.GENERAL.HitPoints.short"}}</span><span>|</span>
|
<h4><span>{{localize "DAGGERHEART.GENERAL.HitPoints.short"}}</span><span>|</span>
|
||||||
<span>{{document.system.resources.hitPoints.value}} / {{document.system.resources.hitPoints.max}}</span></h4>
|
<span>{{document.system.resources.hitPoints.value}} / {{document.system.resources.hitPoints.max}}</span></h4>
|
||||||
|
|
@ -41,19 +37,17 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="status-bar">
|
<div class="status-bar">
|
||||||
<div class='status-value'>
|
<div class='status-value'>
|
||||||
<p><input class="bar-input" name="system.resources.stress.value" min="0" max='{{document.system.resources.stress.max}}'
|
<div class="slot-bar">
|
||||||
value="{{document.system.resources.stress.value}}" type="number"></p>
|
{{#times document.system.resources.stress.max}}
|
||||||
<p>/</p>
|
<span class='slot {{#if (gte ../document.system.resources.stress.value (add this 1))}}filled{{/if}}' data-action='toggleStress' data-value="{{add this 1}}">
|
||||||
<p class="bar-label">{{document.system.resources.stress.max}}</p>
|
</span>
|
||||||
|
{{/times}}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<progress
|
<div class="progress-bar"></div>
|
||||||
class='progress-bar stress-color'
|
|
||||||
value='{{document.system.resources.stress.value}}'
|
|
||||||
min="0"
|
|
||||||
max='{{document.system.resources.stress.max}}'
|
|
||||||
></progress>
|
|
||||||
<div class="status-label">
|
<div class="status-label">
|
||||||
<h4>{{localize "DAGGERHEART.GENERAL.stress"}}</h4>
|
<h4>{{localize "DAGGERHEART.GENERAL.stress"}}</span><span>|</span>
|
||||||
|
<span>{{document.system.resources.stress.value}} / {{document.system.resources.stress.max}}</span></h4>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue