mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
Added categories for combatants
This commit is contained in:
parent
ece1c7e6c1
commit
92b4bfd741
7 changed files with 104 additions and 143 deletions
|
|
@ -294,6 +294,7 @@ const preloadHandlebarsTemplates = async function () {
|
||||||
'systems/daggerheart/templates/sheets/pc/parts/heritageCard.hbs',
|
'systems/daggerheart/templates/sheets/pc/parts/heritageCard.hbs',
|
||||||
'systems/daggerheart/templates/sheets/pc/parts/advancementCard.hbs',
|
'systems/daggerheart/templates/sheets/pc/parts/advancementCard.hbs',
|
||||||
'systems/daggerheart/templates/views/parts/level.hbs',
|
'systems/daggerheart/templates/views/parts/level.hbs',
|
||||||
'systems/daggerheart/templates/sheets/global/partials/feature-section-item.hbs'
|
'systems/daggerheart/templates/sheets/global/partials/feature-section-item.hbs',
|
||||||
|
'systems/daggerheart/templates/ui/combat/combatTrackerSection.hbs'
|
||||||
]);
|
]);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -163,6 +163,14 @@
|
||||||
"Or": "Or",
|
"Or": "Or",
|
||||||
"Description": "Description",
|
"Description": "Description",
|
||||||
"Features": "Features",
|
"Features": "Features",
|
||||||
|
"Adversary": {
|
||||||
|
"Singular": "Adversary",
|
||||||
|
"Plural": "Adversaries"
|
||||||
|
},
|
||||||
|
"Character": {
|
||||||
|
"Singular": "Character",
|
||||||
|
"Plural": "Characters"
|
||||||
|
},
|
||||||
"RefreshType": {
|
"RefreshType": {
|
||||||
"Session": "Session",
|
"Session": "Session",
|
||||||
"Shortrest": "Short Rest",
|
"Shortrest": "Short Rest",
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,13 @@ export default class DhCombatTracker extends foundry.applications.sidebar.tabs.C
|
||||||
async _prepareTrackerContext(context, options) {
|
async _prepareTrackerContext(context, options) {
|
||||||
await super._prepareTrackerContext(context, options);
|
await super._prepareTrackerContext(context, options);
|
||||||
|
|
||||||
|
const adversaries = context.turns.filter(x => x.isNPC);
|
||||||
|
const characters = context.turns.filter(x => !x.isNPC);
|
||||||
|
|
||||||
Object.assign(context, {
|
Object.assign(context, {
|
||||||
actionTokens: game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.variantRules).actionTokens
|
actionTokens: game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.variantRules).actionTokens,
|
||||||
|
adversaries,
|
||||||
|
characters
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1365,6 +1365,10 @@
|
||||||
filter: drop-shadow(0 0 3px gold);
|
filter: drop-shadow(0 0 3px gold);
|
||||||
color: var(--button-hover-text-color);
|
color: var(--button-hover-text-color);
|
||||||
}
|
}
|
||||||
|
.combat-sidebar h5 {
|
||||||
|
margin: 0;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
.chat-message.duality {
|
.chat-message.duality {
|
||||||
border-color: black;
|
border-color: black;
|
||||||
padding: 8px 0 0 0;
|
padding: 8px 0 0 0;
|
||||||
|
|
|
||||||
|
|
@ -1,73 +1,4 @@
|
||||||
.combat-sidebar {
|
.combat-sidebar {
|
||||||
// .encounter-gm-resources {
|
|
||||||
// flex: 0;
|
|
||||||
// display: flex;
|
|
||||||
// justify-content: center;
|
|
||||||
// padding: @largePadding 0;
|
|
||||||
|
|
||||||
// .gm-resource-controls {
|
|
||||||
// display: flex;
|
|
||||||
// flex-direction: column;
|
|
||||||
// align-items: center;
|
|
||||||
// padding: 0 4px;
|
|
||||||
// justify-content: center;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// .gm-resource-tools {
|
|
||||||
// display: flex;
|
|
||||||
// flex-direction: column;
|
|
||||||
// justify-content: center;
|
|
||||||
// padding: 0 5px 0 @fullPadding;
|
|
||||||
|
|
||||||
// i {
|
|
||||||
// margin: 0 @tinyMargin;
|
|
||||||
// font-size: 16px;
|
|
||||||
|
|
||||||
// &.disabled {
|
|
||||||
// opacity: 0.6;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// &:hover:not(.disabled) {
|
|
||||||
// cursor: pointer;
|
|
||||||
// filter: drop-shadow(0 0 3px @mainShadow);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// .gm-resource {
|
|
||||||
// background: rgba(255, 255, 255, 0.1);
|
|
||||||
// padding: @fullPadding;
|
|
||||||
// border-radius: 8px;
|
|
||||||
// border: @normalBorder solid black;
|
|
||||||
// font-size: 20px;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// .token-action-tokens {
|
|
||||||
// flex: 0 0 48px;
|
|
||||||
// text-align: center;
|
|
||||||
|
|
||||||
// .use-action-token {
|
|
||||||
// &.disabled {
|
|
||||||
// opacity: 0.6;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// .icon-button {
|
|
||||||
// &.spaced {
|
|
||||||
// margin-left: @halfMargin;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// &.disabled {
|
|
||||||
// opacity: 0.6;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// &:hover:not(.disabled) {
|
|
||||||
// cursor: pointer;
|
|
||||||
// filter: drop-shadow(0 0 3px @mainShadow);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
.encounter-controls.combat {
|
.encounter-controls.combat {
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
|
|
@ -157,4 +88,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h5 {
|
||||||
|
margin: 0;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,72 +1,4 @@
|
||||||
<ol class="combat-tracker plain">
|
<div>
|
||||||
{{#each turns}}
|
{{> 'systems/daggerheart/templates/ui/combat/combatTrackerSection.hbs' this title=(localize "DAGGERHEART.General.Character.Plural") turns=this.characters}}
|
||||||
<li class="combatant {{ css }}" data-combatant-id="{{ id }}" data-action="activateCombatant">
|
{{> 'systems/daggerheart/templates/ui/combat/combatTrackerSection.hbs' this title=(localize "DAGGERHEART.General.Adversary.Plural") turns=this.adversaries}}
|
||||||
{{!-- Image --}}
|
</div>
|
||||||
<img class="token-image" src="{{ img }}" alt="{{ name }}" loading="lazy">
|
|
||||||
|
|
||||||
{{!-- Name & Controls --}}
|
|
||||||
<div class="token-name">
|
|
||||||
<strong class="name">{{ name }}</strong>
|
|
||||||
<div class="combatant-controls">
|
|
||||||
{{#if @root.user.isGM}}
|
|
||||||
<button type="button" class="inline-control combatant-control icon fa-solid fa-eye-slash {{#if hidden}}active{{/if}}"
|
|
||||||
data-action="toggleHidden" data-tooltip aria-label="{{ localize "COMBAT.ToggleVis" }}"></button>
|
|
||||||
<button type="button" class="inline-control combatant-control icon fa-solid fa-skull {{#if isDefeated}}active{{/if}}"
|
|
||||||
data-action="toggleDefeated" data-tooltip
|
|
||||||
aria-label="{{ localize "COMBAT.ToggleDead" }}"></button>
|
|
||||||
{{/if}}
|
|
||||||
{{#if canPing}}
|
|
||||||
<button type="button" class="inline-control combatant-control icon fa-solid fa-bullseye-arrow"
|
|
||||||
data-action="pingCombatant" data-tooltip
|
|
||||||
aria-label="{{ localize "COMBAT.PingCombatant" }}"></button>
|
|
||||||
{{/if}}
|
|
||||||
{{#unless @root.user.isGM}}
|
|
||||||
<button type="button" class="inline-control combatant-control icon fa-solid fa-arrows-to-eye"
|
|
||||||
data-action="panToCombatant" data-tooltip
|
|
||||||
aria-label="{{ localize "COMBAT.PanToCombatant" }}"></button>
|
|
||||||
{{/unless}}
|
|
||||||
{{!-- TODO: Target Control --}}
|
|
||||||
<div class="token-effects" data-tooltip-html="{{ effects.tooltip }}">
|
|
||||||
{{#each effects.icons}}
|
|
||||||
<img class="token-effect" src="{{ img }}" alt="{{ name }}">
|
|
||||||
{{/each}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{!-- Resource --}}
|
|
||||||
{{#if resource includeZero=true}}
|
|
||||||
<div class="token-resource">
|
|
||||||
<span class="resource">{{ resource }}</span>
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{#if ../combat.round}}
|
|
||||||
<div class="token-actions">
|
|
||||||
{{#if isOwner}}
|
|
||||||
{{#if (and (not isNPC) ../actionTokens.enabled)}}
|
|
||||||
<div class="action-tokens">
|
|
||||||
{{#times ../actionTokens.tokens}}
|
|
||||||
<button type="button" class="inline-control main icon fa-solid fa-bolt-lightning action-token {{#if (lte ../system/actionTokens this)}}used{{/if}}" data-action="setActionTokens" data-combatant-id="{{../id}}" data-token-index="{{this}}">
|
|
||||||
</button>
|
|
||||||
{{/times}}
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{#if @root.user.isGM}}
|
|
||||||
<button
|
|
||||||
type="button" class="inline-control combatant-control discrete icon fa-solid {{#if system.spotlight.requesting}}fa-hand-sparkles requesting{{else}}fa-hand{{/if}}"
|
|
||||||
data-action="toggleSpotlight" data-combatant-id="{{id}}" data-tooltip aria-label="{{localize "DAGGERHEART.Combat.giveSpotlight"}}"
|
|
||||||
></button>
|
|
||||||
{{else}}
|
|
||||||
<button
|
|
||||||
type="button" class="inline-control combatant-control discrete icon fa-solid {{#if system.spotlight.requesting}}fa-hand-sparkles requesting{{else}}fa-hand{{/if}}"
|
|
||||||
data-action="requestSpotlight" data-combatant-id="{{id}}" data-tooltip aria-label="{{#if system.spotlight.requesting}}{{localize "DAGGERHEART.Combat.requestingSpotlight"}}{{else}}{{localize "DAGGERHEART.Combat.requestSpotlight"}}{{/if}}"
|
|
||||||
></button>
|
|
||||||
{{/if}}
|
|
||||||
{{/if}}
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
</li>
|
|
||||||
{{/each}}
|
|
||||||
</ol>
|
|
||||||
75
templates/ui/combat/combatTrackerSection.hbs
Normal file
75
templates/ui/combat/combatTrackerSection.hbs
Normal file
|
|
@ -0,0 +1,75 @@
|
||||||
|
<div>
|
||||||
|
<h5>{{title}}</h5>
|
||||||
|
<ol class="combat-tracker plain">
|
||||||
|
{{#each turns}}
|
||||||
|
<li class="combatant {{ css }}" data-combatant-id="{{ id }}" data-action="activateCombatant">
|
||||||
|
{{!-- Image --}}
|
||||||
|
<img class="token-image" src="{{ img }}" alt="{{ name }}" loading="lazy">
|
||||||
|
|
||||||
|
{{!-- Name & Controls --}}
|
||||||
|
<div class="token-name">
|
||||||
|
<strong class="name">{{ name }}</strong>
|
||||||
|
<div class="combatant-controls">
|
||||||
|
{{#if @root.user.isGM}}
|
||||||
|
<button type="button" class="inline-control combatant-control icon fa-solid fa-eye-slash {{#if hidden}}active{{/if}}"
|
||||||
|
data-action="toggleHidden" data-tooltip aria-label="{{ localize "COMBAT.ToggleVis" }}"></button>
|
||||||
|
<button type="button" class="inline-control combatant-control icon fa-solid fa-skull {{#if isDefeated}}active{{/if}}"
|
||||||
|
data-action="toggleDefeated" data-tooltip
|
||||||
|
aria-label="{{ localize "COMBAT.ToggleDead" }}"></button>
|
||||||
|
{{/if}}
|
||||||
|
{{#if canPing}}
|
||||||
|
<button type="button" class="inline-control combatant-control icon fa-solid fa-bullseye-arrow"
|
||||||
|
data-action="pingCombatant" data-tooltip
|
||||||
|
aria-label="{{ localize "COMBAT.PingCombatant" }}"></button>
|
||||||
|
{{/if}}
|
||||||
|
{{#unless @root.user.isGM}}
|
||||||
|
<button type="button" class="inline-control combatant-control icon fa-solid fa-arrows-to-eye"
|
||||||
|
data-action="panToCombatant" data-tooltip
|
||||||
|
aria-label="{{ localize "COMBAT.PanToCombatant" }}"></button>
|
||||||
|
{{/unless}}
|
||||||
|
{{!-- TODO: Target Control --}}
|
||||||
|
<div class="token-effects" data-tooltip-html="{{ effects.tooltip }}">
|
||||||
|
{{#each effects.icons}}
|
||||||
|
<img class="token-effect" src="{{ img }}" alt="{{ name }}">
|
||||||
|
{{/each}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{!-- Resource --}}
|
||||||
|
{{#if resource includeZero=true}}
|
||||||
|
<div class="token-resource">
|
||||||
|
<span class="resource">{{ resource }}</span>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if ../combat.round}}
|
||||||
|
<div class="token-actions">
|
||||||
|
{{#if isOwner}}
|
||||||
|
{{#if (and (not isNPC) ../actionTokens.enabled)}}
|
||||||
|
<div class="action-tokens">
|
||||||
|
{{#times ../actionTokens.tokens}}
|
||||||
|
<button type="button" class="inline-control main icon fa-solid fa-bolt-lightning action-token {{#if (lte ../system/actionTokens this)}}used{{/if}}" data-action="setActionTokens" data-combatant-id="{{../id}}" data-token-index="{{this}}">
|
||||||
|
</button>
|
||||||
|
{{/times}}
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if @root.user.isGM}}
|
||||||
|
<button
|
||||||
|
type="button" class="inline-control combatant-control discrete icon fa-solid {{#if system.spotlight.requesting}}fa-hand-sparkles requesting{{else}}fa-hand{{/if}}"
|
||||||
|
data-action="toggleSpotlight" data-combatant-id="{{id}}" data-tooltip aria-label="{{localize "DAGGERHEART.Combat.giveSpotlight"}}"
|
||||||
|
></button>
|
||||||
|
{{else}}
|
||||||
|
<button
|
||||||
|
type="button" class="inline-control combatant-control discrete icon fa-solid {{#if system.spotlight.requesting}}fa-hand-sparkles requesting{{else}}fa-hand{{/if}}"
|
||||||
|
data-action="requestSpotlight" data-combatant-id="{{id}}" data-tooltip aria-label="{{#if system.spotlight.requesting}}{{localize "DAGGERHEART.Combat.requestingSpotlight"}}{{else}}{{localize "DAGGERHEART.Combat.requestSpotlight"}}{{/if}}"
|
||||||
|
></button>
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
</li>
|
||||||
|
{{/each}}
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue