199 - Tooltips (#311)

* Set up templates for all 'advanced' tooltips

* Fixed ItemFeature Header label

* Fixed less import
This commit is contained in:
WBHarry 2025-07-11 22:26:56 +02:00 committed by GitHub
parent 72436478c1
commit b6195127fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 505 additions and 54 deletions

View file

@ -10,6 +10,7 @@
<div class="action-item"
data-action="editAction"
data-index="{{index}}"
data-tooltip="{{concat "#item#" @root.document.uuid "#action#" action.id}}"
>
<img class="image" src="{{action.img}}" />
<span>{{action.name}}</span>

View file

@ -11,7 +11,7 @@
data-action="editFeature"
id="{{feature.id}}"
>
<img class="image" src="{{feature.img}}" />
<img class="image" src="{{feature.img}}" data-tooltip="{{concat "#item#" feature.uuid}}" />
<span>{{feature.name}}</span>
<div class="controls">
<a data-action="removeFeature" id="{{feature.id}}"><i class="fa-solid fa-trash"></i></a>

View file

@ -4,7 +4,7 @@
<line-div></line-div>
<h1 class='item-name'><input type='text' name='name' value='{{source.name}}' /></h1>
<div class='item-description'>
<h3>{{localize (concat 'TYPES.Item.feature' source.system.type)}}</h3>
<h3>{{localize 'TYPES.Item.feature'}}</h3>
</div>
</div>
</header>

View file

@ -0,0 +1,83 @@
<div class="daggerheart dh-style tooltip">
<h2 class="tooltip-title">{{item.name}}</h2>
<img class="tooltip-image" src="{{item.img}}" />
<div class="tooltip-description">{{{item.description}}}</div>
{{#if item.uses.max}}
<h4 class="tooltip-sub-title">{{localize "DAGGERHEART.GENERAL.uses"}}</h4>
<div class="tooltip-information-section triple spaced">
<div class="tooltip-information">
<label>{{localize "DAGGERHEART.GENERAL.used"}}</label>
<div>{{item.uses.value}}</div>
</div>
<div class="tooltip-information">
<label>{{localize "DAGGERHEART.GENERAL.max"}}</label>
<div>{{item.uses.max}}</div>
</div>
<div class="tooltip-information">
<label>{{localize "DAGGERHEART.GENERAL.recovery"}}</label>
{{#with (lookup config.GENERAL.refreshTypes item.uses.recovery) as | type |}}
<div>{{localize type.label}}</div>
{{/with}}
</div>
</div>
{{/if}}
{{#if (gt item.cost.length 0)}}
<h4 class="tooltip-sub-title">{{localize "DAGGERHEART.GENERAL.Cost.plural"}}</h4>
{{#each item.cost as | cost |}}
<div class="tooltip-information-section border spaced">
<div class="tooltip-information">
<label>{{localize "Type"}}</label>
{{#with (lookup @root.config.GENERAL.abilityCosts cost.type) as | type |}}
<div>{{localize type.label}}</div>
{{/with}}
</div>
<div class="tooltip-information">
<label>{{localize "DAGGERHEART.GENERAL.value"}}</label>
<div>{{cost.value}}</div>
</div>
{{#if cost.scalable}}
<div class="tooltip-information">
<label>{{localize "DAGGERHEART.GENERAL.scalable"}}</label>
<div>{{localize "DAGGERHEART.GENERAL.true"}}</div>
</div>
<div class="tooltip-information">
<label>{{localize "DAGGERHEART.GENERAL.value"}}</label>
<div>{{cost.step}}</div>
</div>
{{/if}}
</div>
{{/each}}
{{/if}}
{{#if (or item.range item.target)}}
<h4 class="tooltip-sub-title">{{localize "DAGGERHEART.UI.Tooltip.rangeAndTarget"}}</h4>
<div class="tooltip-information-section border spaced">
<div class="tooltip-information">
<label>{{localize "DAGGERHEART.GENERAL.range"}}</label>
<div>
{{#if item.range}}
{{#with (lookup @root.config.GENERAL.range item.range) as | range |}}
<div>{{localize range.label}}</div>
{{/with}}
{{else}}
<div>{{localize "DAGGERHEART.GENERAL.none"}}</div>
{{/if}}
</div>
</div>
<div class="tooltip-information">
<label>{{localize "DAGGERHEART.GENERAL.target"}}</label>
<div>
{{#if item.target.type}}
{{#with (lookup @root.config.ACTIONS.targetTypes item.target.type) as | target |}}
<div>{{@root.item.target.amount}} {{localize target.label}}</div>
{{/with}}
{{else}}
<div>{{localize "DAGGERHEART.GENERAL.none"}}</div>
{{/if}}
</div>
</div>
</div>
{{/if}}
</div>

View file

@ -0,0 +1,64 @@
<div class="daggerheart dh-style tooltip">
<h2 class="tooltip-title">{{item.name}}</h2>
<img class="tooltip-image" src="{{item.img}}" />
<div class="tooltip-description">{{{item.system.description}}}</div>
<div class="tooltip-information-section triple spaced">
<div class="tooltip-information">
<label>{{localize "DAGGERHEART.GENERAL.Tiers.singular"}}</label>
{{#with (lookup config.GENERAL.tiers item.system.tier) as | tier |}}
<div>{{localize tier.label}}</div>
{{/with}}
</div>
<div class="tooltip-information">
<label>{{localize "Type"}}</label>
{{#with (lookup config.ACTOR.adversaryTypes item.system.type) as | type |}}
<div>{{localize type.label}}</div>
{{/with}}
</div>
<div class="tooltip-information">
<label>{{localize "DAGGERHEART.ACTORS.Adversary.FIELDS.difficulty.label"}}</label>
<div>{{item.system.difficulty}}</div>
</div>
</div>
<div class="tooltip-information-section spaced">
<div class="tooltip-information">
<label>{{localize "DAGGERHEART.GENERAL.hitPoints"}}</label>
<div>{{item.system.resources.hitPoints.max}}</div>
</div>
<div class="tooltip-information">
<label>{{localize "DAGGERHEART.GENERAL.stress"}}</label>
<div>{{item.system.resources.stress.max}}</div>
</div>
<div class="tooltip-information">
<label>{{localize "DAGGERHEART.ITEMS.Armor.baseThresholds.major"}}</label>
<div>{{item.system.damageThresholds.major}}</div>
</div>
<div class="tooltip-information">
<label>{{localize "DAGGERHEART.ITEMS.Armor.baseThresholds.severe"}}</label>
<div>{{item.system.damageThresholds.severe}}</div>
</div>
<div class="tooltip-information">
<label>{{localize "DAGGERHEART.GENERAL.attack"}}</label>
<div>{{numberFormat item.system.attack.roll.bonus sign=true}}</div>
</div>
<div class="tooltip-information">
<label>{{localize "DAGGERHEART.GENERAL.damage"}}</label>
<div>{{damageFormula item.system.attack item}}</div>
</div>
</div>
<strong>{{localize "DAGGERHEART.GENERAL.Experience.plural"}}</strong>
{{#each item.system.experiences as | experience |}}
<div>{{experience.name}} {{numberFormat experience.total sign=true}}</div>
{{/each}}
<div class="tooltip-information-section">
<div class="tooltip-information full-width">
<label>{{localize "DAGGERHEART.ACTORS.Adversary.FIELDS.motivesAndTactics.label"}}</label>
<div>{{item.system.motivesAndTactics}}</div>
</div>
</div>
{{> "systems/daggerheart/templates/ui/tooltip/parts/tooltipTags.hbs" features=item.system.features }}
</div>

View file

@ -1,5 +1,37 @@
<div>
<div>{{name}}</div>
<img src="{{img}}" />
<div>{{{system.description}}}</div>
<div class="daggerheart dh-style tooltip">
<h2 class="tooltip-title">{{item.name}}</h2>
<img class="tooltip-image" src="{{item.img}}" />
<div class="tooltip-description">{{{item.system.description}}}</div>
<div class="tooltip-information-section">
<div class="tooltip-information full-width">
<label>{{localize "DAGGERHEART.ITEMS.Armor.baseScore"}}</label>
<div>{{item.system.baseScore}}</div>
</div>
<div class="tooltip-information">
<label>{{localize "DAGGERHEART.ITEMS.Armor.baseThresholds.major"}}</label>
<div>{{item.system.baseThresholds.major}}</div>
</div>
<div class="tooltip-information">
<label>{{localize "DAGGERHEART.ITEMS.Armor.baseThresholds.severe"}}</label>
<div>{{item.system.baseThresholds.severe}}</div>
</div>
</div>
{{#if (gt item.system.armorFeatures.length 0)}}<h4 class="tooltip-sub-title">{{localize "DAGGERHEART.GENERAL.features"}}</h4>{{/if}}
<div class="tooltip-tags">
{{#each item.system.armorFeatures}}
{{#with (lookup ../config.ITEM.armorFeatures this.value) as | feature | }}
<div class="tooltip-tag">
<div class="tooltip-tag-label-container">
<div class="tooltip-tag-label">{{localize feature.label}}</div>
</div>
<div class="tooltip-tag-description">{{{localize feature.description}}}</div>
</div>
{{/with}}
{{/each}}
</div>
{{> "systems/daggerheart/templates/ui/tooltip/parts/tooltipTags.hbs" features=item.system.customActions label=(localize "DAGGERHEART.GENERAL.Action.plural")}}
</div>

View file

@ -1,6 +0,0 @@
<div>
<div>{{name}}</div>
<img src="{{system.tokenImg}}" />
<div>{{{system.examples}}}</div>
<div>{{system.advantageOn}}</div>
</div>

View file

@ -0,0 +1,14 @@
<div class="daggerheart dh-style tooltip">
<h2 class="tooltip-title">{{item.name}}</h2>
<img class="tooltip-image" src="{{item.img}}" />
<div class="tooltip-description">{{{item.system.description}}}</div>
<div class="tooltip-information-section">
<div class="tooltip-information full-width">
<label>{{localize "DAGGERHEART.GENERAL.quantity"}}</label>
<div>{{item.system.quantity}}</div>
</div>
</div>
{{> "systems/daggerheart/templates/ui/tooltip/parts/tooltipTags.hbs" features=item.system.actions label=(localize "DAGGERHEART.GENERAL.Action.plural") }}
</div>

View file

@ -1,5 +1,31 @@
<div>
<div>{{name}}</div>
<img src="{{img}}" />
<div>{{{system.description}}}</div>
<div class="daggerheart dh-style tooltip">
<h2 class="tooltip-title">{{item.name}}</h2>
<img class="tooltip-image" src="{{item.img}}" />
<div class="tooltip-description">{{{item.system.description}}}</div>
<div class="tooltip-information-section">
<div class="tooltip-information">
<label>{{localize "DAGGERHEART.GENERAL.Domain.single"}}</label>
{{#with (lookup config.DOMAIN.domains item.system.domain) as | domain |}}
<div>{{localize domain.label}}</div>
{{/with}}
</div>
<div class="tooltip-information">
<label>{{localize "Type"}}</label>
{{#with (lookup config.DOMAIN.cardTypes item.system.type) as | type |}}
<div>{{localize type.label}}</div>
{{/with}}
</div>
<div class="tooltip-information">
<label>{{localize "DAGGERHEART.GENERAL.level"}}</label>
<div>{{item.system.level}}</div>
</div>
<div class="tooltip-information">
<label>{{localize "DAGGERHEART.ITEMS.DomainCard.recallCost"}}</label>
<div>{{item.system.recallCost}}</div>
</div>
</div>
{{> "systems/daggerheart/templates/ui/tooltip/parts/tooltipTags.hbs" features=item.system.actions label=(localize "DAGGERHEART.GENERAL.Action.plural") }}
</div>

View file

@ -0,0 +1,8 @@
<div class="daggerheart dh-style tooltip">
<h2 class="tooltip-title">{{item.name}}</h2>
<img class="tooltip-image" src="{{item.img}}" />
<div class="tooltip-description">{{{item.system.description}}}</div>
{{> "systems/daggerheart/templates/ui/tooltip/parts/tooltipTags.hbs" features=item.system.actions label=(localize "DAGGERHEART.GENERAL.Action.plural") }}
{{> "systems/daggerheart/templates/ui/tooltip/parts/tooltipTags.hbs" features=item.effects label=(localize "DAGGERHEART.GENERAL.Effect.plural") }}
</div>

View file

@ -0,0 +1,7 @@
<div class="daggerheart dh-style tooltip">
<h2 class="tooltip-title">{{item.name}}</h2>
<img class="tooltip-image" src="{{item.img}}" />
<div class="tooltip-description">{{{item.system.description}}}</div>
{{> "systems/daggerheart/templates/ui/tooltip/parts/tooltipTags.hbs" features=item.system.actions label=(localize "DAGGERHEART.GENERAL.Action.plural") }}
</div>

View file

@ -0,0 +1,12 @@
{{#if (gt features.length 0)}}<h4 class="tooltip-sub-title">{{label}}</h4>{{/if}}
<div class="tooltip-tags">
{{#each features as | feature |}}
<div class="tooltip-tag">
<div class="tooltip-tag-label-container">
<div class="tooltip-tag-label">{{localize feature.name}}</div>
{{#if feature.img}}<img class="tooltip-tag-image" src="{{feature.img}}" />{{/if}}
</div>
<div class="tooltip-tag-description">{{{localize (tertiary feature.description feature.system.description)}}}</div>
</div>
{{/each}}
</div>

View file

@ -1,5 +1,56 @@
<div>
<div>{{name}}</div>
<img src="{{img}}" />
<div>{{{system.description}}}</div>
<div class="daggerheart dh-style tooltip">
<h2 class="tooltip-title">{{item.name}}</h2>
<img class="tooltip-image" src="{{item.img}}" />
<div class="tooltip-description">{{{item.system.description}}}</div>
<div class="tooltip-information-section">
<div class="tooltip-information">
<label>{{localize "DAGGERHEART.ITEMS.Weapon.weaponType"}}</label>
<div>{{#if item.system.secondaryWeapon}}{{localize "DAGGERHEART.ITEMS.Weapon.secondaryWeapon"}}{{else}}{{localize "DAGGERHEART.ITEMS.Weapon.primaryWeapon"}}{{/if}}</div>
</div>
<div class="tooltip-information">
<label>{{localize "DAGGERHEART.GENERAL.burden"}}</label>
{{#with (lookup config.GENERAL.burden item.system.burden) as | burden |}}
<div>{{localize burden.label}}</div>
{{/with}}
</div>
{{#if item.system.attack.roll.trait}}
<div class="tooltip-information">
<label>{{localize "DAGGERHEART.GENERAL.Trait.single"}}</label>
{{#with (lookup config.ACTOR.abilities item.system.attack.roll.trait) as | trait |}}
<div>{{localize trait.label}}</div>
{{/with}}
</div>
{{/if}}
<div class="tooltip-information">
<label>{{localize "DAGGERHEART.GENERAL.range"}}</label>
{{#with (lookup config.GENERAL.range item.system.attack.range) as | range |}}
<div>{{localize range.label}}</div>
{{/with}}
</div>
<div class="tooltip-information">
<label>{{localize "DAGGERHEART.GENERAL.damage"}}</label>
<div>{{{damageFormula item.system.attack item.parent}}}</div>
</div>
<div class="tooltip-information">
<label>{{localize "DAGGERHEART.GENERAL.damageType"}}</label>
<div>{{{damageSymbols item.system.attack.damage.parts}}}</div>
</div>
</div>
{{#if (gt item.system.weaponFeatures.length 0)}}<h4 class="tooltip-sub-title">{{localize "DAGGERHEART.GENERAL.features"}}</h4>{{/if}}
<div class="tooltip-tags">
{{#each item.system.weaponFeatures}}
{{#with (lookup ../config.ITEM.weaponFeatures this.value) as | feature | }}
<div class="tooltip-tag">
<div class="tooltip-tag-label-container">
<div class="tooltip-tag-label">{{localize feature.label}}</div>
</div>
<div class="tooltip-tag-description">{{{localize feature.description}}}</div>
</div>
{{/with}}
{{/each}}
</div>
{{> "systems/daggerheart/templates/ui/tooltip/parts/tooltipTags.hbs" features=item.system.customActions label=(localize "DAGGERHEART.GENERAL.Action.plural") }}
</div>