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", "id": "dh-improved-countdowns",
"title": "Improved Countdowns", "title": "Improved Countdowns",
"version": "1.2.0", "version": "1.2.1",
"compatibility": { "compatibility": {
"minimum": "13", "minimum": "13",
"verified": "13" "verified": "13"
@ -40,5 +40,5 @@
"description": "A modern, draggable countdown tracker for the Daggerheart system.", "description": "A modern, draggable countdown tracker for the Daggerheart system.",
"url": "https://github.com/cptn-cosmo/dh-improved-countdowns", "url": "https://github.com/cptn-cosmo/dh-improved-countdowns",
"manifest": "https://github.com/cptn-cosmo/dh-improved-countdowns/releases/latest/download/module.json", "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 { return {
countdowns, countdowns,
hasCountdowns,
isGM, isGM,
isMinimized, isMinimized,
isLocked, isLocked,

View file

@ -5,8 +5,9 @@
</div> </div>
<div class="header-controls"> <div class="header-controls">
{{#if isGM}} {{#if isGM}}
<a class="control-btn" data-action="addCountdown" data-tooltip="Add New Countdown"> <a class="control-btn" data-action="addCountdown"
<i class="fa-solid fa-plus-circle"></i> 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> </a>
{{/if}} {{/if}}
<a class="control-btn" data-action="toggleLock" <a class="control-btn" data-action="toggleLock"