mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-21 23:13:39 +02:00
Improved resourceManager clickable
This commit is contained in:
parent
e102a28305
commit
62d08c8fab
5 changed files with 25 additions and 3 deletions
|
|
@ -986,7 +986,7 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
||||||
|
|
||||||
const target = button.closest('.resource-section');
|
const target = button.closest('.resource-section');
|
||||||
|
|
||||||
// game.tooltip.dismissLockedTooltips();
|
game.tooltip.dismissLockedTooltips();
|
||||||
game.tooltip.activate(target, {
|
game.tooltip.activate(target, {
|
||||||
html,
|
html,
|
||||||
locked: true,
|
locked: true,
|
||||||
|
|
@ -995,6 +995,13 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
||||||
noOffset: true
|
noOffset: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const resourceManager = target.querySelector('.resource-manager');
|
||||||
|
resourceManager.classList.toggle('inverted');
|
||||||
|
|
||||||
|
Hooks.once(CONFIG.DH.HOOKS.hooksConfig.lockedTooltipDismissed, () => {
|
||||||
|
resourceManager.classList.toggle('inverted');
|
||||||
|
});
|
||||||
|
|
||||||
for (const element of html.querySelectorAll('.resource-value'))
|
for (const element of html.querySelectorAll('.resource-value'))
|
||||||
element.addEventListener('click', CharacterSheet.resourceUpdate.bind(this));
|
element.addEventListener('click', CharacterSheet.resourceUpdate.bind(this));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
export const hooksConfig = {
|
export const hooksConfig = {
|
||||||
effectDisplayToggle: 'DHEffectDisplayToggle'
|
effectDisplayToggle: 'DHEffectDisplayToggle',
|
||||||
|
lockedTooltipDismissed: 'DHLockedTooltipDismissed'
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -364,6 +364,12 @@ export default class DhTooltipManager extends foundry.helpers.interaction.Toolti
|
||||||
return clone;
|
return clone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**@inheritdoc */
|
||||||
|
dismissLockedTooltips() {
|
||||||
|
super.dismissLockedTooltips();
|
||||||
|
Hooks.callAll(CONFIG.DH.HOOKS.hooksConfig.lockedTooltipDismissed);
|
||||||
|
}
|
||||||
|
|
||||||
/** Get HTML for Battlepoints tooltip */
|
/** Get HTML for Battlepoints tooltip */
|
||||||
async getBattlepointHTML(combatId) {
|
async getBattlepointHTML(combatId) {
|
||||||
const combat = game.combats.get(combatId);
|
const combat = game.combats.get(combatId);
|
||||||
|
|
|
||||||
|
|
@ -138,6 +138,14 @@
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 4px;
|
gap: 4px;
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
|
|
||||||
|
.resource-manager {
|
||||||
|
transition: all 0.1s ease;
|
||||||
|
|
||||||
|
&.inverted {
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.downtime-section {
|
.downtime-section {
|
||||||
|
|
|
||||||
|
|
@ -82,8 +82,8 @@
|
||||||
<i class='fa-regular fa-ban'></i>
|
<i class='fa-regular fa-ban'></i>
|
||||||
</span>
|
</span>
|
||||||
{{/times}}
|
{{/times}}
|
||||||
|
{{#if hasExtraResources}}<a type="button" class="resource-manager" data-action="toggleResourceManagement"><i class="fa-solid fa-angle-down"></i></a>{{/if}}
|
||||||
</div>
|
</div>
|
||||||
{{#if hasExtraResources}}<button type="button" class="resource-manager" data-action="toggleResourceManagement"><i class="fa-solid fa-bars"></i></button>{{/if}}
|
|
||||||
</div>
|
</div>
|
||||||
{{#if document.system.class.value}}
|
{{#if document.system.class.value}}
|
||||||
<div class="domains-section">
|
<div class="domains-section">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue