mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
Something experimenting
This commit is contained in:
parent
a23061a8be
commit
eaf4e3b78f
3 changed files with 62 additions and 11 deletions
|
|
@ -19,6 +19,7 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
||||||
actions: {
|
actions: {
|
||||||
toggleVault: CharacterSheet.#toggleVault,
|
toggleVault: CharacterSheet.#toggleVault,
|
||||||
rollAttribute: CharacterSheet.#rollAttribute,
|
rollAttribute: CharacterSheet.#rollAttribute,
|
||||||
|
toggleHitpoints: CharacterSheet.#toggleHitPoints,
|
||||||
toggleHope: CharacterSheet.#toggleHope,
|
toggleHope: CharacterSheet.#toggleHope,
|
||||||
toggleLoadoutView: CharacterSheet.#toggleLoadoutView,
|
toggleLoadoutView: CharacterSheet.#toggleLoadoutView,
|
||||||
openPack: CharacterSheet.#openPack,
|
openPack: CharacterSheet.#openPack,
|
||||||
|
|
@ -727,6 +728,17 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
||||||
this.render();
|
this.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Toggles a hitpoint resource value.
|
||||||
|
* @type {ApplicationClickAction}
|
||||||
|
*/
|
||||||
|
static async #toggleHitPoints(_, button) {
|
||||||
|
const hitPointsValue = Number.parseInt(button.dataset.value);
|
||||||
|
const newValue = this.document.system.resources.hitPoints.value >= hitPointsValue ? hitPointsValue - 1 : hitPointsValue;
|
||||||
|
await this.document.update({ 'system.resources.hitPoints.value': newValue });
|
||||||
|
this.render();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Toggles a hope resource value.
|
* Toggles a hope resource value.
|
||||||
* @type {ApplicationClickAction}
|
* @type {ApplicationClickAction}
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,7 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100px;
|
width: 120px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
|
|
||||||
.status-label {
|
.status-label {
|
||||||
|
|
@ -157,16 +157,50 @@
|
||||||
.status-value {
|
.status-value {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 0 6px;
|
padding: 0 5px;
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: 100px;
|
width: 140px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
color: @beige;
|
color: @beige;
|
||||||
|
|
||||||
|
.slot-bar {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 5px;
|
||||||
|
padding: 7px;
|
||||||
|
|
||||||
|
color: light-dark(@dark-blue, @golden);
|
||||||
|
width: fit-content;
|
||||||
|
|
||||||
|
.armor-slot {
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
font-size: var(--font-size-12);
|
||||||
|
|
||||||
|
.fa-shield-halved {
|
||||||
|
color: light-dark(@dark-blue-40, @golden-40);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.slot {
|
||||||
|
width: 15px;
|
||||||
|
height: 10px;
|
||||||
|
border: 1px solid light-dark(@dark-blue, @golden);
|
||||||
|
background: light-dark(@dark-blue-10, @golden-10);
|
||||||
|
border-radius: 3px;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
&.filled {
|
||||||
|
background: light-dark(@dark-blue, @golden);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
input[type='number'] {
|
input[type='number'] {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
|
|
@ -199,7 +233,7 @@
|
||||||
.progress-bar {
|
.progress-bar {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
appearance: none;
|
appearance: none;
|
||||||
width: 100px;
|
width: 125px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
border: 1px solid light-dark(@dark-blue, @golden);
|
border: 1px solid light-dark(@dark-blue, @golden);
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
|
|
@ -503,4 +537,4 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -19,18 +19,23 @@
|
||||||
<div class="resources-section">
|
<div class="resources-section">
|
||||||
<div class="status-bar">
|
<div class="status-bar">
|
||||||
<div class='status-value'>
|
<div class='status-value'>
|
||||||
|
<div class="slot-bar">
|
||||||
|
{{#times document.system.resources.hitPoints.max}}
|
||||||
|
<span class='slot {{#if (gte ../document.system.resources.hitPoints.value (add this 1))}}filled{{/if}}' data-action='toggleHitPoints' data-value="{{add this 1}}">
|
||||||
|
</span>
|
||||||
|
{{/times}}
|
||||||
|
</div> {{!--
|
||||||
<p><input class="bar-input" name="system.resources.hitPoints.value" min="0" max='{{document.system.resources.hitPoints.max}}'
|
<p><input class="bar-input" name="system.resources.hitPoints.value" min="0" max='{{document.system.resources.hitPoints.max}}'
|
||||||
value="{{document.system.resources.hitPoints.value}}" type="number"></p>
|
value="{{document.system.resources.hitPoints.value}}" type="number"></p>
|
||||||
<p>/</p>
|
<p>/</p>
|
||||||
<p class="bar-label">{{document.system.resources.hitPoints.max}}</p>
|
<p class="bar-label">{{document.system.resources.hitPoints.max}}</p> --}}
|
||||||
</div>
|
</div>
|
||||||
<progress
|
<div
|
||||||
class='progress-bar'
|
class='progress-bar'
|
||||||
max='{{document.system.resources.hitPoints.max}}'
|
></div>
|
||||||
value='{{document.system.resources.hitPoints.value}}'
|
|
||||||
></progress>
|
|
||||||
<div class="status-label">
|
<div class="status-label">
|
||||||
<h4>{{localize "DAGGERHEART.GENERAL.HitPoints.short"}}</h4>
|
<h4><span>{{localize "DAGGERHEART.GENERAL.HitPoints.short"}}</span><span>|</span>
|
||||||
|
<span>{{document.system.resources.hitPoints.value}} / {{document.system.resources.hitPoints.max}}</span></h4>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue