tickwerk/templates/combat-tracker.hbs

133 lines
6.4 KiB
Handlebars
Raw Permalink Normal View History

{{!--
2022-05-16 03:46:53 +02:00
SPDX-FileCopyrightText: 2022 Foundry Gaming LLC.
SPDX-FileCopyrightText: 2022 Johannes Loher
SPDX-License-Identifier: MIT
--}}
<section class="{{cssClass}} directory flexcol" id="{{cssId}}" data-tab="{{tabName}}">
<header class="combat-tracker-header">
2022-05-16 02:08:27 +02:00
{{#if user.isGM}}
<nav class="encounters flexrow" aria-label="COMBAT.NavLabel">
<a class="combat-button combat-create" data-tooltip="COMBAT.Create">
2022-05-16 02:08:27 +02:00
<i class="fas fa-plus"></i>
</a>
{{#if combatCount}}
<a class="combat-button combat-cycle" data-tooltip="COMBAT.EncounterPrevious"
{{#if previousId}}data-document-id="{{previousId}}"{{else}}disabled{{/if}}>
2022-05-16 02:08:27 +02:00
<i class="fas fa-caret-left"></i>
</a>
<h4 class="encounter">{{localize "COMBAT.Encounter"}} {{currentIndex}} / {{combatCount}}</h4>
<a class="combat-button combat-cycle" data-tooltip="COMBAT.EncounterNext"
{{#if nextId}}data-document-id="{{nextId}}"{{else}}disabled{{/if}}>
2022-05-16 02:08:27 +02:00
<i class="fas fa-caret-right"></i>
</a>
{{/if}}
<a class="combat-button combat-control" data-tooltip="COMBAT.Delete" data-control="endCombat" {{#unless combatCount}}disabled{{/unless}}>
2022-05-16 02:08:27 +02:00
<i class="fas fa-trash"></i>
</a>
</nav>
{{/if}}
<div class="encounter-controls flexrow {{#if hasCombat}}combat{{/if}}">
2022-05-16 02:08:27 +02:00
{{#if user.isGM}}
<a class="combat-button combat-control" data-tooltip="COMBAT.RollAll" data-control="rollAll" {{#unless turns}}disabled{{/unless}}>
2022-05-16 02:08:27 +02:00
<i class="fas fa-users"></i>
</a>
<a class="combat-button combat-control" data-tooltip="COMBAT.RollNPC" data-control="rollNPC" {{#unless turns}}disabled{{/unless}}>
2022-05-16 02:08:27 +02:00
<i class="fas fa-users-cog"></i>
</a>
{{/if}}
{{#if combatCount}}
{{#if combat.started}}
<h3 class="encounter-title noborder">{{localize 'TICKWERK.Tick'}} {{combat.tickValue}}</h3>
2022-05-16 02:08:27 +02:00
{{else}}
<h3 class="encounter-title noborder">{{localize 'COMBAT.NotStarted'}}</h3>
2022-05-16 02:08:27 +02:00
{{/if}}
{{else}}
<h3 class="encounter-title noborder">{{localize "COMBAT.None"}}</h3>
2022-05-16 02:08:27 +02:00
{{/if}}
{{#if user.isGM}}
<a class="combat-button combat-control" data-tooltip="COMBAT.InitiativeReset" data-control="resetAll"
2022-05-16 02:08:27 +02:00
{{#unless hasCombat}}disabled{{/unless}}>
<i class="fas fa-undo"></i>
</a>
<a class="combat-button combat-control" data-tooltip="{{labels.scope}}"
2022-05-16 02:08:27 +02:00
data-control="toggleSceneLink" {{#unless hasCombat}}disabled{{/unless}}>
<i class="fas fa-{{#unless linked}}un{{/unless}}link"></i>
</a>
<a class="combat-button combat-settings" data-tooltip="COMBAT.Settings" data-control="trackerSettings">
2022-05-16 02:08:27 +02:00
<i class="fas fa-cog"></i>
</a>
{{/if}}
</div>
2022-05-16 02:08:27 +02:00
</header>
<ol id="combat-tracker" class="directory-list">
{{#each turns}}
<li class="combatant actor directory-item flexrow {{this.css}}" data-combatant-id="{{this.id}}">
<img class="token-image" data-src="{{this.img}}" alt="{{this.name}}"/>
2022-05-16 02:08:27 +02:00
<div class="token-name flexcol">
<h4>{{this.name}}</h4>
<div class="combatant-controls flexrow">
{{#if (or ../user.isGM (and ../control this.owner))}}
<a class="combatant-control" data-tooltip="{{#if this.waiting}}TICKWERK.StopWaiting{{else}}TICKWERK.Wait{{/if}}" data-control="toggleWaiting">
2022-05-16 02:08:27 +02:00
<i class="fas {{#if this.waiting}}fa-play-circle{{else}}fa-pause-circle{{/if}}"></i></a>
{{/if}}
{{#if ../user.isGM}}
<a class="combatant-control {{#if this.hidden}}active{{/if}}" data-tooltip="COMBAT.ToggleVis" data-control="toggleHidden">
<i class="fas fa-eye-slash"></i>
</a>
<a class="combatant-control {{#if this.defeated}}active{{/if}}" data-tooltip="COMBAT.ToggleDead" data-control="toggleDefeated">
<i class="fas fa-skull"></i>
</a>
{{/if}}
{{#if this.canPing}}
<a class="combatant-control" data-tooltip="COMBAT.PingCombatant" data-control="pingCombatant">
<i class="fa-solid fa-bullseye-arrow"></i>
</a>
2022-05-16 02:08:27 +02:00
{{/if}}
<div class="token-effects">
{{#each this.effects}}
<img class="token-effect" src="{{this}}"/>
{{/each}}
</div>
</div>
</div>
{{#if this.hasResource}}
<div class="token-resource">
<span class="resource">{{this.resource}}</span>
</div>
{{/if}}
<div class="token-initiative tickwerk-token-initiative">
{{#if this.hasRolled}}
<span class="initiative">{{#if this.waiting}}{{localize "TICKWERK.Waiting"}}{{else}}{{this.initiative}}{{/if}}</span>
{{else if this.owner}}
<a class="combatant-control roll" data-tooltip="COMBAT.InitiativeRoll" data-control="rollInitiative"></a>
2022-05-16 02:08:27 +02:00
{{/if}}
</div>
</li>
{{/each}}
</ol>
<nav id="combat-controls" class="directory-footer flexrow" data-tooltip-direction="UP">
2022-05-16 02:08:27 +02:00
{{#if hasCombat}}
{{#if user.isGM}}
{{#if combat.started}}
<a class="combat-control center" data-control="endCombat">{{localize 'COMBAT.End'}}</a>
<a class="combat-control" data-tooltip="COMBAT.TurnNext" data-control="nextTurn"><i class="fas fa-arrow-right"></i></a>
2022-05-16 02:08:27 +02:00
{{else}}
<a class="combat-control center" data-control="startCombat">{{localize 'COMBAT.Begin'}}</a>
2022-05-16 02:08:27 +02:00
{{/if}}
{{else if (and control combat.started)}}
<a class="combat-control center" data-control="nextTurn">{{localize 'COMBAT.TurnEnd'}}</a>
<a class="combat-control" data-tooltip="COMBAT.TurnNext" data-control="nextTurn"><i class="fas fa-arrow-right"></i></a>
2022-05-16 02:08:27 +02:00
{{/if}}
{{/if}}
</nav>
</section>