mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-14 20:51:07 +01:00
toggle functionality added
This commit is contained in:
parent
8a832fa142
commit
4ce9cb98d8
3 changed files with 87 additions and 6 deletions
|
|
@ -55,6 +55,7 @@ export default class DHBaseActorSheet extends DHApplicationMixin(ActorSheetV2) {
|
||||||
async _prepareContext(_options) {
|
async _prepareContext(_options) {
|
||||||
const context = await super._prepareContext(_options);
|
const context = await super._prepareContext(_options);
|
||||||
context.isNPC = this.document.isNPC;
|
context.isNPC = this.document.isNPC;
|
||||||
|
context.useResourcePips = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance).useResourcePips;
|
||||||
context.showAttribution = !game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance)
|
context.showAttribution = !game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance)
|
||||||
.hideAttribution;
|
.hideAttribution;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,7 @@
|
||||||
color: light-dark(@beige, @dark-blue);
|
color: light-dark(@beige, @dark-blue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.status-value {
|
.slot-value {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
@ -216,6 +216,20 @@
|
||||||
border-left: 1px solid @dark-golden;
|
border-left: 1px solid @dark-golden;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-value {
|
||||||
|
position: absolute;
|
||||||
|
display: flex;
|
||||||
|
padding: 0 5px;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
align-items: center;
|
||||||
|
width: 140px;
|
||||||
|
height: 40px;
|
||||||
|
justify-content: center;
|
||||||
|
text-align: center;
|
||||||
|
z-index: 2;
|
||||||
|
color: @beige;
|
||||||
|
|
||||||
input[type='number'] {
|
input[type='number'] {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
|
|
@ -312,7 +326,7 @@
|
||||||
font-size: var(--font-size-12);
|
font-size: var(--font-size-12);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.status-value {
|
.slot-value {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 0 5px;
|
padding: 0 5px;
|
||||||
|
|
@ -372,6 +386,21 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
.status-value {
|
||||||
|
position: absolute;
|
||||||
|
display: flex;
|
||||||
|
padding: 0 5px;
|
||||||
|
font-size: 1.2rem;
|
||||||
|
align-items: center;
|
||||||
|
width: 80px;
|
||||||
|
height: 30px;
|
||||||
|
justify-content: center;
|
||||||
|
text-align: center;
|
||||||
|
z-index: 2;
|
||||||
|
color: light-dark(@dark-blue, @beige);
|
||||||
|
|
||||||
input[type='number'] {
|
input[type='number'] {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,8 @@
|
||||||
<div class="info-section">
|
<div class="info-section">
|
||||||
<div class="resources-section">
|
<div class="resources-section">
|
||||||
<div class="status-bar">
|
<div class="status-bar">
|
||||||
<div class='status-value'>
|
{{#if useResourcePips}}
|
||||||
|
<div class='slot-value'>
|
||||||
<div class="slot-bar">
|
<div class="slot-bar">
|
||||||
{{#times document.system.resources.hitPoints.max}}
|
{{#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 class='slot {{#if (gte ../document.system.resources.hitPoints.value (add this 1))}}filled{{/if}}' data-action='toggleHitPoints' data-value="{{add this 1}}">
|
||||||
|
|
@ -28,11 +29,28 @@
|
||||||
<div class="slot-label">
|
<div class="slot-label">
|
||||||
<span class="label">{{localize "DAGGERHEART.GENERAL.HitPoints.short"}}</span>
|
<span class="label">{{localize "DAGGERHEART.GENERAL.HitPoints.short"}}</span>
|
||||||
<span class="value">{{document.system.resources.hitPoints.value}} / {{document.system.resources.hitPoints.max}}</span>
|
<span class="value">{{document.system.resources.hitPoints.value}} / {{document.system.resources.hitPoints.max}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{{else}}
|
||||||
|
<div class='status-value'>
|
||||||
|
<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>
|
||||||
|
<p>/</p>
|
||||||
|
<p class="bar-label">{{document.system.resources.hitPoints.max}}</p>
|
||||||
|
</div>
|
||||||
|
<progress
|
||||||
|
class='progress-bar'
|
||||||
|
max='{{document.system.resources.hitPoints.max}}'
|
||||||
|
value='{{document.system.resources.hitPoints.value}}'
|
||||||
|
></progress>
|
||||||
|
<div class="status-label">
|
||||||
|
<h4>{{localize "DAGGERHEART.GENERAL.HitPoints.short"}}</h4>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
<div class="status-bar">
|
<div class="status-bar">
|
||||||
<div class='status-value'>
|
{{#if useResourcePips}}
|
||||||
|
<div class='slot-value'>
|
||||||
<div class="slot-bar">
|
<div class="slot-bar">
|
||||||
{{#times document.system.resources.stress.max}}
|
{{#times document.system.resources.stress.max}}
|
||||||
<span class='slot {{#if (gte ../document.system.resources.stress.value (add this 1))}}filled{{/if}}' data-action='toggleStress' data-value="{{add this 1}}">
|
<span class='slot {{#if (gte ../document.system.resources.stress.value (add this 1))}}filled{{/if}}' data-action='toggleStress' data-value="{{add this 1}}">
|
||||||
|
|
@ -46,6 +64,23 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{{else}}
|
||||||
|
<div class='status-value'>
|
||||||
|
<p><input class="bar-input" name="system.resources.stress.value" min="0" max='{{document.system.resources.stress.max}}'
|
||||||
|
value="{{document.system.resources.stress.value}}" type="number"></p>
|
||||||
|
<p>/</p>
|
||||||
|
<p class="bar-label">{{document.system.resources.stress.max}}</p>
|
||||||
|
</div>
|
||||||
|
<progress
|
||||||
|
class='progress-bar stress-color'
|
||||||
|
value='{{document.system.resources.stress.value}}'
|
||||||
|
min="0"
|
||||||
|
max='{{document.system.resources.stress.max}}'
|
||||||
|
></progress>
|
||||||
|
<div class="status-label">
|
||||||
|
<h4>{{localize "DAGGERHEART.GENERAL.stress"}}</h4>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="status-section">
|
<div class="status-section">
|
||||||
|
|
@ -60,7 +95,8 @@
|
||||||
|
|
||||||
{{#if document.system.armor.system.marks}}
|
{{#if document.system.armor.system.marks}}
|
||||||
<div class="status-bar armor-slots">
|
<div class="status-bar armor-slots">
|
||||||
<div class='status-value'>
|
{{#if useResourcePips}}
|
||||||
|
<div class='slot-value'>
|
||||||
<div class="slot-bar">
|
<div class="slot-bar">
|
||||||
{{#times document.system.armorScore}}
|
{{#times document.system.armorScore}}
|
||||||
<a class='armor-slot' data-action='toggleArmor' data-value="{{add this 1}}">
|
<a class='armor-slot' data-action='toggleArmor' data-value="{{add this 1}}">
|
||||||
|
|
@ -77,6 +113,21 @@
|
||||||
<span class="value">{{document.system.armor.system.marks.value}} / {{document.system.armorScore}}</span>
|
<span class="value">{{document.system.armor.system.marks.value}} / {{document.system.armorScore}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{{else}}
|
||||||
|
<div class='status-value'>
|
||||||
|
<p><input class="bar-input armor-marks-input" value="{{document.system.armor.system.marks.value}}" type="number"></p>
|
||||||
|
<p>/</p>
|
||||||
|
<p class="bar-label">{{document.system.armorScore}}</p>
|
||||||
|
</div>
|
||||||
|
<progress
|
||||||
|
class='progress-bar stress-color'
|
||||||
|
value='{{document.system.armor.system.marks.value}}'
|
||||||
|
max='{{document.system.armorScore}}'
|
||||||
|
></progress>
|
||||||
|
<div class="status-label">
|
||||||
|
<h4>{{localize "DAGGERHEART.GENERAL.armorSlots"}}</h4>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
<div class="status-number armor-slots">
|
<div class="status-number armor-slots">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue