feat: Dynamically update the countdown tracker's add button tooltip and icon based on existing countdowns, and increment module version.

This commit is contained in:
CPTN Cosmo 2025-12-22 01:02:49 +01:00
parent dfc84d0626
commit d39c5e3568
3 changed files with 8 additions and 4 deletions

View file

@ -1,7 +1,7 @@
{
"id": "dh-improved-countdowns",
"title": "Improved Countdowns",
"version": "1.2.0",
"version": "1.2.1",
"compatibility": {
"minimum": "13",
"verified": "13"
@ -40,5 +40,5 @@
"description": "A modern, draggable countdown tracker for the Daggerheart system.",
"url": "https://github.com/cptn-cosmo/dh-improved-countdowns",
"manifest": "https://github.com/cptn-cosmo/dh-improved-countdowns/releases/latest/download/module.json",
"download": "https://github.com/cptn-cosmo/dh-improved-countdowns/releases/download/1.2.0/dh-improved-countdowns.zip"
"download": "https://github.com/cptn-cosmo/dh-improved-countdowns/releases/download/1.2.1/dh-improved-countdowns.zip"
}

View file

@ -99,8 +99,11 @@ export class CountdownTrackerApp extends HandlebarsApplicationMixin(ApplicationV
}
}
const hasCountdowns = Object.keys(countdowns).length > 0;
return {
countdowns,
hasCountdowns,
isGM,
isMinimized,
isLocked,

View file

@ -5,8 +5,9 @@
</div>
<div class="header-controls">
{{#if isGM}}
<a class="control-btn" data-action="addCountdown" data-tooltip="Add New Countdown">
<i class="fa-solid fa-plus-circle"></i>
<a class="control-btn" data-action="addCountdown"
data-tooltip="{{#if hasCountdowns}}Manage Countdowns{{else}}Add New Countdown{{/if}}">
<i class="fa-solid {{#if hasCountdowns}}fa-pen-to-square{{else}}fa-plus-circle{{/if}}"></i>
</a>
{{/if}}
<a class="control-btn" data-action="toggleLock"