Skip to content

Commit

Permalink
* Added tooltip for cover adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
Eligarf committed Apr 24, 2024
1 parent 0b8ebe8 commit 3875af4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# v1.2.1
* Added tooltip for cover adjustments

# v1.2.0
* Look for built-in cover effect if not using PF2e Perception
* If enabled, let PF2e Perception autocalculate cover at combat start
Expand Down
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"id": "pf2e",
"type": "system",
"compatibility": {
"verified": "5.15.0"
"verified": "5.15.1"
}
}
]
Expand Down
1 change: 1 addition & 0 deletions scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ Hooks.once('init', () => {
if (coverBonus) {
const oldDelta = stealther.initiative - target.dc;
target.oldDelta = (oldDelta < 0) ? `${oldDelta}` : `+${oldDelta}`
target.tooltip = (coverBonus == 2) ? 'Standard Cover: +2' : (coverBonus == 4) ? 'Greater Cover: +4' : `Cover: +${coverBonus}`;
}

// Handle failing to win at stealth
Expand Down
5 changes: 4 additions & 1 deletion templates/combat-start.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
<tr>
<td style="min-width:60px">{{target.name}}</td>
{{#if target.oldDelta}}
<td style="min-width:25px"><s>{{target.oldDelta}}</s><b>{{target.delta}}</b></td>
<td style="min-width:25px">
<span><s>{{target.oldDelta}}</s></span>
<span data-tooltip="<div>{{target.tooltip}}</div>"> <b>{{target.delta}}</b></span>
</td>
{{else}}
<td style="min-width:25px">{{target.delta}}</td>
{{/if}}
Expand Down

0 comments on commit 3875af4

Please sign in to comment.