Skip to content

Commit

Permalink
[foundryvtt#2018] Replace titles with tooltips on sheets (foundryvtt#…
Browse files Browse the repository at this point in the history
…2074)

Co-authored-by: Kim Mantas <kim.mantas@gmail.com>
  • Loading branch information
arbron and Fyorl authored Jan 20, 2023
1 parent 33e7aa3 commit c14c05c
Show file tree
Hide file tree
Showing 29 changed files with 188 additions and 148 deletions.
63 changes: 36 additions & 27 deletions templates/actors/character-sheet.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{{!-- Sheet Header --}}
<header class="sheet-header flexrow">
<img class="profile" src="{{actor.img}}" title="{{actor.name}}" data-edit="img"/>
<img class="profile" src="{{actor.img}}" data-tooltip="{{actor.name}}" data-edit="img"/>

<section class="header-details flexrow">
{{> "dnd5e.actor-warnings"}}
Expand All @@ -12,7 +12,7 @@
</h1>

<aside class="header-exp flexcol">
<div class="charlevel" title="{{multiclassLabels}}">
<div class="charlevel" data-tooltip="{{multiclassLabels}}">
<label>{{ localize "DND5E.Level" }} {{system.details.level}}</label>
<span class="levels">{{classLabels}}</span>
</div>
Expand All @@ -36,7 +36,7 @@
</li>
<li>
{{#if labels.background}}
<span title="{{localize 'DND5E.Background'}}">{{labels.background}}</span>
<span data-tooltip="DND5E.Background">{{labels.background}}</span>
{{else}}
<input type="text" name="system.details.background" value="{{system.details.background}}" placeholder="{{ localize 'DND5E.Background' }}"/>
{{/if}}
Expand All @@ -53,47 +53,48 @@
<ul class="attributes flexrow">
<li class="attribute health">
<h4 class="attribute-name box-title">{{localize "DND5E.HitPoints"}}</h4>
<a class="config-button" data-action="hit-points" data-tooltip="{{localize 'DND5E.HitPointsConfig'}}">
<a class="config-button" data-action="hit-points" data-tooltip="DND5E.HitPointsConfig">
<i class="fas fa-cog"></i>
</a>
<div class="attribute-value multiple">
<input name="system.attributes.hp.value" type="text" value="{{hp.value}}" placeholder="10"
data-tooltip="{{localize 'DND5E.HitPointsCurrent'}}" data-dtype="Number">
data-tooltip="DND5E.HitPointsCurrent" data-dtype="Number">
<span class="sep"> / </span>
<span data-tooltip="{{#if hp.max}}{{localize 'DND5E.HitPointsOverride'}}
{{~ else}}{{localize 'DND5E.HitPointsMax'}}{{/if}}">{{hp.max}}</span>
<span data-tooltip="{{#if hp.max}}DND5E.HitPointsOverride{{else}}DND5E.HitPointsMax{{/if}}">
{{hp.max}}
</span>
</div>
<footer class="attribute-footer">
<input name="system.attributes.hp.temp" type="text" class="temphp"
placeholder="+{{ localize 'DND5E.Temp' }}" value="{{hp.temp}}"
title="{{localize 'DND5E.HitPointsTemp'}}" data-dtype="Number">
data-tooltip="DND5E.HitPointsTemp" data-dtype="Number">
<input name="system.attributes.hp.tempmax" type="text" class="temphp"
placeholder="+{{ localize 'DND5E.Max' }}" value="{{hp.tempmax}}"
title="{{localize 'DND5E.HitPointsTempMax'}}" data-dtype="Number">
data-tooltip="DND5E.HitPointsTempMax" data-dtype="Number">
</footer>
</li>

<li class="attribute hit-dice">
<h4 class="attribute-name box-title">{{ localize "DND5E.HitDice" }}</h4>
<a class="config-button" data-action="hit-dice" data-tooltip="{{localize 'DND5E.HitDiceConfig'}}">
<a class="config-button" data-action="hit-dice" data-tooltip="DND5E.HitDiceConfig">
<i class="fas fa-cog"></i>
</a>
<div class="attribute-value multiple">
<label class="hit-dice">
<span title="{{localize 'DND5E.HitDiceRemaining'}}">{{system.attributes.hd}}</span>
<span data-tooltip="DND5E.HitDiceRemaining">{{system.attributes.hd}}</span>
<span class="sep"> / </span>
<span title="{{localize 'DND5E.HitDiceMax'}}">{{system.details.level}}</span>
<span data-tooltip="DND5E.HitDiceMax">{{system.details.level}}</span>
</label>
</div>
<footer class="attribute-footer">
<a class="rest short-rest" title="{{localize 'DND5E.ShortRest'}}">{{ localize "DND5E.RestS" }}</a>
<a class="rest long-rest" title="{{localize 'DND5E.LongRest'}}">{{ localize "DND5E.RestL" }}</a>
<a class="rest short-rest" data-tooltip="DND5E.ShortRest">{{localize "DND5E.RestS"}}</a>
<a class="rest long-rest" data-tooltip="DND5E.LongRest">{{localize "DND5E.RestL"}}</a>
</footer>
</li>

<li class="attribute armor">
<h4 class="attribute-name box-title">{{ localize "DND5E.ArmorClass" }}</h4>
<a class="config-button" data-action="armor" data-tooltip="{{localize 'DND5E.ArmorConfig'}}">
<a class="config-button" data-action="armor" data-tooltip="DND5E.ArmorConfig">
<i class="fas fa-cog"></i>
</a>
<div class="attribute-value attributable" data-property="attributes.ac">
Expand All @@ -106,7 +107,7 @@

<li class="attribute movement">
<h4 class="attribute-name box-title">{{ localize "DND5E.Movement" }}</h4>
<a class="config-button" data-action="movement" data-tooltip="{{localize 'DND5E.MovementConfig'}}">
<a class="config-button" data-action="movement" data-tooltip="DND5E.MovementConfig">
<i class="fas fa-cog"></i>
</a>
<div class="attribute-value">
Expand All @@ -121,7 +122,7 @@
<h4 class="attribute-name box-title rollable" data-action="rollInitiative">
{{ localize "DND5E.Initiative" }}
</h4>
<a class="config-button" data-action="initiative" data-tooltip="{{localize 'DND5E.InitiativeConfig'}}">
<a class="config-button" data-action="initiative" data-tooltip="DND5E.InitiativeConfig">
<i class="fas fa-cog"></i>
</a>
<div class="attribute-value">
Expand Down Expand Up @@ -155,12 +156,19 @@
<input type="text" name="system.abilities.{{id}}.value" value="{{ability.value}}"
class="ability-score" placeholder="10" data-dtype="Number">
<div class="ability-modifiers flexrow">
<span class="ability-mod" title="{{ localize 'DND5E.Modifier' }}">{{numberFormat ability.mod decimals=0 sign=true}}</span>
<input type="hidden" name="system.abilities.{{id}}.proficient" value="{{ability.baseProf}}" data-dtype="Number"/>
<a class="proficiency-toggle ability-proficiency" title="{{ localize 'DND5E.Proficiency' }}">{{{ability.icon}}}</a>
<span class="ability-save" title="{{ localize 'DND5E.SavingThrow' }}">{{numberFormat ability.save decimals=0 sign=true}}</span>
<span class="ability-mod" data-tooltip="DND5E.Modifier">
{{numberFormat ability.mod decimals=0 sign=true}}
</span>
<input type="hidden" name="system.abilities.{{id}}.proficient" value="{{ability.baseProf}}"
data-dtype="Number"/>
<a class="proficiency-toggle ability-proficiency" data-tooltip="DND5E.Proficiency">
{{{ability.icon}}}
</a>
<span class="ability-save" data-tooltip="DND5E.SavingThrow">
{{numberFormat ability.save decimals=0 sign=true}}
</span>
</div>
<a class="config-button" data-action="ability" data-tooltip="{{localize 'DND5E.AbilityConfigure'}}">
<a class="config-button" data-action="ability" data-tooltip="DND5E.AbilityConfigure">
<i class="fas fa-cog"></i>
</a>
</li>
Expand All @@ -172,19 +180,20 @@
{{#each config.skills as |obj s|}}
{{#with (lookup ../skills s) as |skill|}}
<li class="skill flexrow {{#if skill.value}}proficient{{/if}}" data-skill="{{s}}">
<input type="hidden" name="system.skills.{{s}}.value" value="{{skill.baseValue}}" data-dtype="Number"/>
<a class="proficiency-toggle skill-proficiency" title="{{skill.hover}}">{{{skill.icon}}}</a>
<input type="hidden" name="system.skills.{{s}}.value"
value="{{skill.baseValue}}" data-dtype="Number">
<a class="proficiency-toggle skill-proficiency" data-tooltip="{{skill.hover}}">{{{skill.icon}}}</a>
<div class="skill-name-controls">
<h4 class="skill-name rollable">{{skill.label}}</h4>
<a class="config-button" data-action="skill" data-tooltip="{{localize 'DND5E.SkillConfigure'}}">
<a class="config-button" data-action="skill" data-tooltip="DND5E.SkillConfigure">
<i class="fas fa-cog"></i>
</a>
</div>
<span class="skill-ability">{{skill.ability}}</span>
<span class="skill-mod" title="{{ localize 'DND5E.SkillModifierHint' skill=skill.label }}">
<span class="skill-mod" data-tooltip="{{localize 'DND5E.SkillModifierHint' skill=skill.label}}">
{{numberFormat skill.total decimals=0 sign=true}}
</span>
<span class="skill-passive" title="{{ localize 'DND5E.SkillPassiveHint' skill=skill.label }}">
<span class="skill-passive" data-tooltip="{{localize 'DND5E.SkillPassiveHint' skill=skill.label}}">
({{skill.passive}})
</span>
</li>
Expand Down
13 changes: 7 additions & 6 deletions templates/actors/group-sheet.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<form class="{{cssClass}} flexcol" autocomplete="off">
<header class="sheet-header flexrow">
<img class="profile" src="{{actor.img}}" title="{{actor.name}}" alt="{{actor.name}}" data-edit="img">
<img class="profile" src="{{actor.img}}" data-tooltip="{{actor.name}}" alt="{{actor.name}}" data-edit="img">
<section class="header-details flexrow">
<h1 class="charname">
<input name="name" type="text" value="{{actor.name}}" placeholder="{{localize 'DND5E.Name'}}">
Expand All @@ -13,16 +13,17 @@

<ul class="attributes flexrow">
<li class="attribute health">
<h4 class="attribute-name box-title">{{localize 'DND5E.GroupHP'}}</h4>
<h4 class="attribute-name box-title">{{localize "DND5E.GroupHP"}}</h4>
<div class="attribute-value">
<span class="value" data-tooltip="{{localize 'DND5E.HitPointsCurrent'}}">{{currentHP}}</span>
<span class="value" data-tooltip="DND5E.HitPointsCurrent">{{currentHP}}</span>
<span class="sep"> &sol; </span>
<span class="value" data-tooltip="{{localize 'DND5E.HitPointsMax'}}">{{maxHP}}</span>
<span class="value" data-tooltip="DND5E.HitPointsMax">{{maxHP}}</span>
</div>
</li>
<li class="attribute movement">
<h4 class="attribute-name box-title">{{ localize "DND5E.Movement" }}</h4>
<a class="action-button config-button" data-action="movementConfig" data-tooltip="{{localize 'DND5E.MovementConfig'}}">
<h4 class="attribute-name box-title">{{localize "DND5E.Movement"}}</h4>
<a class="action-button config-button" data-action="movementConfig"
data-tooltip="DND5E.MovementConfig">
<i class="fas fa-cog"></i>
</a>
<div class="attribute-value">
Expand Down
2 changes: 1 addition & 1 deletion templates/actors/limited-sheet.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{{!-- Sheet Header --}}
<header class="sheet-header flexrow">
<img class="profile" src="{{actor.img}}" title="{{actor.name}}" data-edit="img"/>
<img class="profile" src="{{actor.img}}" data-tooltip="{{actor.name}}" data-edit="img"/>

<section class="header-details flexrow">
<h1 class="charname">
Expand Down
Loading

0 comments on commit c14c05c

Please sign in to comment.