feat: Add Foundry V13 compatibility, hide the system tracker when detached, and include a new README.
This commit is contained in:
parent
30b2943ae3
commit
72ee9dd8e3
4 changed files with 46 additions and 7 deletions
24
README.md
Normal file
24
README.md
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
# Daggerheart Countdowns Plus
|
||||||
|
|
||||||
|
A simple module for the **Daggerheart** system on Foundry VTT that improves the usability of the countdown tracker.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- **Detachable Tracker**: Adds a "Detach" button to the default systems countdown/fear tracker.
|
||||||
|
- **Movable Window**: The detached tracker opens in its own window that can be dragged anywhere on the screen, minimizing obstruction of the game canvas.
|
||||||
|
- **System Tracker Integration**: While the detached tracker is open, the default system tracker (pinned to the top right) is hidden to avoid clutter. Closing the detached tracker automatically restores the system tracker.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
1. Open the Foundry VTT Setup screen.
|
||||||
|
2. Go to **Add-on Modules**.
|
||||||
|
3. Click **Install Module**.
|
||||||
|
4. Search for "Daggerheart Countdowns Plus" or paste the manifest URL.
|
||||||
|
5. Click **Install**.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
1. Open a world with the **Daggerheart** system.
|
||||||
|
2. Enable the **Daggerheart Countdowns Plus** module in **Game Settings** > **Manage Modules**.
|
||||||
|
3. Look for the "Detach" icon (an arrow pointing out of a square) in the header of the standard Countdown/Fear tracker.
|
||||||
|
4. Click it to pop out the tracker into a movable window.
|
||||||
10
module.json
10
module.json
|
|
@ -4,12 +4,16 @@
|
||||||
"description": "A module to allow the Daggerheart countdown tracker to be detached and moved freely.",
|
"description": "A module to allow the Daggerheart countdown tracker to be detached and moved freely.",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"compatibility": {
|
"compatibility": {
|
||||||
"minimum": "12",
|
"minimum": "13",
|
||||||
"verified": "12"
|
"verified": "13"
|
||||||
},
|
},
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Antigravity"
|
"name": "CPTN Cosmo",
|
||||||
|
"email": "cptncosmo@gmail.com",
|
||||||
|
"url": "https://github.com/cptn-cosmo",
|
||||||
|
"discord": "cptn_cosmo",
|
||||||
|
"flags": {}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"relationships": {
|
"relationships": {
|
||||||
|
|
|
||||||
|
|
@ -76,8 +76,7 @@ export function createMovableCountdownsClass(BaseCountdowns) {
|
||||||
// but next time it renders it will check flag.
|
// but next time it renders it will check flag.
|
||||||
}
|
}
|
||||||
|
|
||||||
/**@inheritdoc */
|
/** @inheritDoc */
|
||||||
/**@inheritdoc */
|
|
||||||
async _renderFrame(options) {
|
async _renderFrame(options) {
|
||||||
const frame = await super._renderFrame(options);
|
const frame = await super._renderFrame(options);
|
||||||
|
|
||||||
|
|
@ -117,6 +116,9 @@ export function createMovableCountdownsClass(BaseCountdowns) {
|
||||||
|
|
||||||
// Ensure visibility
|
// Ensure visibility
|
||||||
this.element.hidden = false;
|
this.element.hidden = false;
|
||||||
|
|
||||||
|
// Add detached class to body for CSS blocking of system tracker
|
||||||
|
document.body.classList.add('dh-countdowns-detached');
|
||||||
}
|
}
|
||||||
|
|
||||||
static async reattach() {
|
static async reattach() {
|
||||||
|
|
@ -130,10 +132,13 @@ export function createMovableCountdownsClass(BaseCountdowns) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @override */
|
|
||||||
/** @override */
|
/** @override */
|
||||||
async close(options = {}) {
|
async close(options = {}) {
|
||||||
await super.close(options);
|
await super.close(options);
|
||||||
|
|
||||||
|
// Remove detached class from body
|
||||||
|
document.body.classList.remove('dh-countdowns-detached');
|
||||||
|
|
||||||
// Re-attach on close
|
// Re-attach on close
|
||||||
if (ui.countdowns) {
|
if (ui.countdowns) {
|
||||||
ui.countdowns._suppressed = false;
|
ui.countdowns._suppressed = false;
|
||||||
|
|
|
||||||
|
|
@ -22,3 +22,9 @@
|
||||||
/* Ensure background image works if it relied on parent classes */
|
/* Ensure background image works if it relied on parent classes */
|
||||||
/* System uses .theme-dark .daggerheart.dh-style.countdowns */
|
/* System uses .theme-dark .daggerheart.dh-style.countdowns */
|
||||||
/* If the body has theme-dark, this should still work. */
|
/* If the body has theme-dark, this should still work. */
|
||||||
|
|
||||||
|
/* Hide system tracker when detached */
|
||||||
|
/* Exclude .movable-countdowns explicitly to prevent self-hiding if classes leak or overlap */
|
||||||
|
body.dh-countdowns-detached .daggerheart.dh-style.countdowns.faded-ui:not(.movable-countdowns) {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue