Skip to content

Commit c5f69c8

Browse files
authored
Merge pull request #34 from paulcheeba/v13.2.1.0
V13.2.1.0
2 parents 173f873 + 8923a82 commit c5f69c8

19 files changed

+447
-125
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Development documentation
2+
dev-docs/

README.md

Lines changed: 63 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<!-- Latest release (semantic version) -->
22
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/paulcheeba/about-time-next?sort=semver) <!-- Total downloads across all releases -->![Downloads](https://img.shields.io/github/downloads/paulcheeba/about-time-next/total) <!-- Downloads of latest release only -->![Downloads (latest)](https://img.shields.io/github/downloads/paulcheeba/about-time-next/latest/total)
33

4+
<img width="512" height="512" alt="ATN Logo" src="https://github.com/paulcheeba/about-time-next/blob/v13.2.1.0/assets/images/about-time-next_cartoon_logo_w-ATN.png?raw=true" />
5+
46

57
# About Time Next (v13.1.3.2)
68

@@ -9,7 +11,7 @@ It works with **Simple Calendar** (*see installation note 3*) or falls back to F
911

1012
---
1113

12-
## 📦 Installation
14+
## Installation
1315

1416
1. Download and install via Foundry’s module browser
1517

@@ -28,9 +30,9 @@ It works with **Simple Calendar** (*see installation note 3*) or falls back to F
2830
2931
---
3032

31-
## 🚀 Quick Start
33+
## Quick Start
3234

33-
- **EM (Event Manager V2):** Open from the **Journal/Notes** toolbar sub-button **“Event Manager”** (GM-only).
35+
- **Event Manager (applicationV2):** Open from the **Journal/Notes** toolbar sub-button **“Event Manager”** (GM-only).
3436
Use it to create one-shots or repeating events, stop items by name/UID, view the queue, or flush all.
3537

3638
- **Mini Time Manager (optional):** Enable in **Configure Settings → About-Time** to show a compact panel with **Play/Pause**, current time, and tiny toggles for realtime behavior (GM sees controls; players see time).
@@ -40,11 +42,11 @@ It works with **Simple Calendar** (*see installation note 3*) or falls back to F
4042

4143
---
4244

43-
## 🧰 Toolbars
45+
### Toolbar Buttons
4446

4547
<img width="281" height="200" alt="image" src="https://github.com/user-attachments/assets/8f3c06f8-d511-4e0c-9528-9c2b67d1c8a3" />
4648

47-
### Event Manager (V2, ApplicationV2)
49+
### Event Manager (ApplicationV2)
4850

4951
<img width="923" height="437" alt="image" src="https://github.com/user-attachments/assets/6e72b4b3-477a-417e-bb5b-789698696a46" />
5052

@@ -57,7 +59,7 @@ Opened via the **Journal/Notes** toolbar sub-button (GM-only).
5759
- **Stop all Events**: Flush the queue.
5860
- **Stop all + 1h reminder**: Flush and schedule a “Resume in 1h” reminder.
5961

60-
The V2 view auto-updates countdowns and refreshes itself if an event fires or is rescheduled, keeping “Remaining” correct for repeating items.
62+
The Event Manager auto-updates countdowns and refreshes itself if an event fires or is rescheduled, keeping “Remaining” correct for repeating items.
6163

6264
### Mini Time Manager (optional, client setting)
6365
Enable **“Enable AT Time Manager”** to show a compact panel:
@@ -73,7 +75,7 @@ Enable **“Enable AT Time Manager”** to show a compact panel:
7375

7476
---
7577

76-
## Realtime & Clock
78+
## Realtime & Clock
7779

7880
About-Time provides a simple **realtime worldTime runner** (GM-only, single-owner) with:
7981
- **Rate** (default 1.0×) and **Tick Hz** settings (safe minimums enforced)
@@ -82,7 +84,7 @@ About-Time provides a simple **realtime worldTime runner** (GM-only, single-owne
8284

8385
---
8486

85-
## 💬 Chat Commands (GM-only output)
87+
## Chat Commands (GM-only output)
8688

8789
All commands are handled by `/at` (see `module/ATChat.js`).
8890
Durations accept mixed units: days (**d**), hours (**h**), minutes (**m**), seconds (**s**).
@@ -113,9 +115,9 @@ Examples: `1h30m`, `2d 4h`, `45m10s`, or `5400` (seconds).
113115

114116
---
115117

116-
## 🗓 Event Manager (details)
118+
## Event Manager (details)
117119

118-
The EM V2 lists every queued item with:
120+
The Event Manager lists every queued item with:
119121

120122
- **Name** (friendly name you provided when scheduling)
121123
- **UID** (unique identifier; safe to copy)
@@ -132,11 +134,34 @@ Actions (top buttons):
132134
- **Send Queue to Chat** (GM-whisper)
133135
- **Stop all Events** / **Stop all + 1h reminder**
134136

135-
> With **Simple Calendar** installed, About-Time uses SC’s formatting/conversion where appropriate. Without SC, it falls back to core Foundry world time.
137+
> With **Simple Calendar** installed, About-Time uses SC's formatting/conversion where appropriate. Without SC, it falls back to core Foundry world time.
138+
139+
### Event Notification Cards (v13.2.1.0)
140+
When events trigger, they display standardized notification cards with detailed information:
141+
142+
<img width="293" height="365" alt="image" src="https://github.com/user-attachments/assets/0bbc2efb-e1a4-408c-9b54-1865c1e4d457" />
143+
144+
145+
```
146+
[about-time-next]
147+
Event Name: <name or NA>
148+
Message: <message or NA>
149+
Duration: DD:HH:MM:SS (or NA)
150+
Repeating: Yes/No
151+
Macro: <macro name or NA>
152+
Event UID: <unique identifier>
153+
```
154+
155+
- **Consistent Format**: All Event Manager events use the same card layout
156+
- **Persistence**: Format maintained through Foundry reloads
157+
- **Macro Integration**: Events with macros show the event card *and* executes the macro
158+
- **Sound Support**: `[about-time-next]` prefix ensures notification sounds trigger correctly
159+
160+
_Note: `/at` chat commands currently use legacy format. Standardization planned for future release._
136161

137162
---
138163

139-
## 🧩 Macros
164+
## Macros
140165

141166
**Advance by 30 seconds (core FVTT v13):**
142167
```js
@@ -172,7 +197,7 @@ game.abouttime.notifyIn({ seconds: 30 }, "myCustomEvent", "arg1", "arg2");
172197

173198
---
174199

175-
## 🧪 Example Scenarios
200+
## Example Scenarios
176201

177202
- **Short Rest timer (one-shot):**
178203
“Wake the party in 1 hour.”
@@ -191,17 +216,36 @@ game.abouttime.notifyIn({ seconds: 30 }, "myCustomEvent", "arg1", "arg2");
191216

192217
---
193218

194-
## Settings (high-level)
219+
## Settings (high-level)
195220

196221
- **Enable AT Time Manager (client)** — Shows the mini panel for this user.
197222
- **Realtime Rate / Tick Hz (world)** — Controls the realtime runner (GM-only; safe ranges enforced).
198223
- **Link Pause / Auto-Pause Combat (client)** — How the mini panel reacts to world/game state.
199224

225+
### Event Notification Sounds (client, v13.2.0.0)
226+
227+
Configure audible alerts when events trigger (GM-only feature):
228+
229+
- **Enable Event Notification Sound** — Toggle notification sounds on/off
230+
- **Sound Source** — Choose between built-in sound or custom audio file
231+
- **Custom Sound Path** — File picker to select your own audio (defaults to module's sounds folder)
232+
- **Notification Volume** — Adjust volume from 0-100% (affects only ATN notifications)
233+
- **Test Sound** — Preview button to hear current selection before saving
234+
235+
Event notifications play automatically when scheduled events fire, helping GMs track timers without constantly watching the Event Manager. Settings apply immediately after saving, so you can adjust volume mid-session without reloading. Included are 3 royalty free notification sounds.
236+
- Supported file types:
237+
- MP3 (.mp3) - Most widely supported, best compatibility
238+
- OGG (.ogg) - Good compression, well-supported
239+
- WAV (.wav) - Uncompressed, larger files
240+
- WebM (.webm) - Modern format with good compression
241+
- M4A (.m4a) - AAC audio, good quality
242+
Best practice: MP3 is the safest choice for maximum browser compatibility across all platforms (which is why we used it for the notification sounds in v13.2.0.0+).
243+
200244
> Where SC is present, date/time formatting in the mini panel and EM uses SC helpers.
201245
202246
---
203247

204-
## Notes & Limitations
248+
## Notes & Limitations
205249

206250
- The module **does not** override combat round/initiative time.
207251
- Complex SC calendars (non-365-day years, custom months) are supported via SC’s own conversions, while raw seconds math remains conservative in fallback mode.
@@ -210,10 +254,12 @@ game.abouttime.notifyIn({ seconds: 30 }, "myCustomEvent", "arg1", "arg2");
210254

211255
---
212256

213-
## 📝 Credits
257+
## Credits
214258

215259
Originally created by **Tim Posney**, updated and maintained for FVTT v13+ by **paulcheeba** with community input and ChatGPT-assisted refactoring.
216260

217-
## 📝 License
261+
**Event notification sound effects** by [Notification_Message](https://pixabay.com/users/notification_message-47259947/) from [Pixabay](https://pixabay.com/sound-effects/).
262+
263+
## License
218264

219265
MIT — see LICENSE file.

about-time.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// about-time.js — Entry point
2-
// v13.1.1.1 (Hotfix: use active-combat signal and reconcile on updateCombat)
2+
// v13.2.0.0 — Added event notification sound system
33

44
import { registerSettings, MODULE_ID } from './module/settings.js';
55
import { preloadTemplates } from './module/preloadTemplates.js';
@@ -13,6 +13,7 @@ import { registerMiniSettings } from './module/ATMiniSettings.js';
1313
import { showMiniPanel, hideMiniPanel, toggleMiniPanel } from './module/ATMiniPanel.js';
1414
import { startRealtime, stopRealtime, isRealtimeRunning, setRealtimeRate } from './module/ATRealtimeClock.js';
1515
import './module/ATMiniToolbar.js'; // only adds tool when enabled & GM
16+
import { ATNotificationSound } from './module/ATNotificationSound.js'; // v13.2.0.0 - event notifications
1617

1718
// Side-effect imports (existing)
1819
import './module/ATChat.js'; // /at chat command
@@ -145,6 +146,9 @@ Hooks.once('ready', () => {
145146
PseudoClock.init();
146147
ElapsedTime.init();
147148

149+
// Initialize event notification sound system (v13.2.0.0)
150+
ATNotificationSound.init();
151+
148152
// Auto-open the mini panel per user setting
149153
try {
150154
if (game.settings.get(MODULE_ID, "enableMiniPanel")) {
323 KB
Loading
40.8 KB
Binary file not shown.
158 KB
Binary file not shown.
58.8 KB
Binary file not shown.

changelog.md

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,52 @@
1+
# Changelog (v13.2.1.0)
2+
3+
- **Standardized Event Chat Cards**
4+
All Event Manager events now display detailed, consistently formatted notification cards with clear visual styling. Cards include event name, message, duration (DD:HH:MM:SS), repeating status, macro name, and event UID. Format persists through Foundry reloads with all metadata intact.
5+
6+
- **Event Card Persistence Fix**
7+
Fixed critical bug where event metadata was lost after Foundry reload, causing empty or malformed chat messages. Implemented deep cloning for proper serialization through Foundry's settings system, ensuring all event details survive reload cycles.
8+
9+
- **[about-time-next] Prefix Integration**
10+
Event cards now always include the `[about-time-next]` prefix, ensuring notification sounds trigger correctly for both fresh events and after reload. Both fresh handlers and reconstructed handlers use the same standardized format for consistency.
11+
12+
- **Macro Integration Enhancement**
13+
Events with macros now display the event notification card *before* executing the macro, providing clear context about what triggered the macro execution. Both card and macro output appear in sequence.
14+
15+
- **UID Display Fix**
16+
Corrected issue where event UID displayed as "null" in fresh event cards. UIDs now display correctly in both pre-reload and post-reload scenarios.
17+
18+
---
19+
20+
# Changelog (v13.2.0.0)
21+
22+
- **Event Notification Sounds**
23+
Added audible alerts when scheduled events trigger (GM-only). Configure sound source, volume, and preview selections via module settings. Includes 3 built-in notification sounds with file picker support for custom audio.
24+
25+
- **Settings Enhancements**
26+
Added 5 new client settings for notification sound system: enable/disable toggle, sound source selector, custom sound path with file picker, volume slider (0-100%), and test button for previewing sounds before saving.
27+
28+
- **Hook-Based Detection**
29+
Implemented ATNotificationSound.js with pattern-matching detection for ATN event chat messages, ensuring notifications play only for actual event triggers without modifying existing event handling code.
30+
31+
- **Localization**
32+
Added 11 new translation keys for notification settings and test button (English only; other languages use fallback).
33+
34+
---
35+
136
# Changelog (v13.1.1.1)
237

338
- **Fixed pause/link bug**
439
Replaced all combat-state checks from `game.combats?.size` to `!!game.combat`, ensuring realtime is gated only by active combat, not dormant combat documents.
540

641
- **Realtime runner reconciliation**
7-
Added `Hooks.on("updateCombat", ...)` to catch combat start/stop transitions that dont create or delete combat documents (e.g., starting an encounter from an existing record, scene changes).
42+
Added `Hooks.on("updateCombat", ...)` to catch combat start/stop transitions that don't create or delete combat documents (e.g., starting an encounter from an existing record, scene changes).
843

944
- **Pause/unpause logic corrected**
1045
Updated the `pauseGame` hook to resume realtime only when the game is unpaused *and* no active combat exists.
1146

1247
- **Setting `rtLinkPause` fixed**
13-
Adjusted its `onChange` handler to also use `!!game.combat`, eliminating sticky mismatches where toggling wouldnt update the runner state.
48+
Adjusted its `onChange` handler to also use `!!game.combat`, eliminating sticky mismatches where toggling wouldn't update the runner state.
1449

1550
- **UI text clarification**
1651
Updated hover text for `rtAutoPauseCombat` to:
17-
*Auto Pause at Combat Start/End* for clearer user intent.
52+
*"Auto Pause at Combat Start/End"* for clearer user intent.

lang/del

Lines changed: 0 additions & 1 deletion
This file was deleted.

lang/en.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,19 @@
3737
"about-time.display.advanceMidDay": "Advance to mid day",
3838
"about-time.display.advanceMidnight": "Advance to midnight",
3939

40-
"about-time.countDown.startStop": "Start/Stop pseudoclock."
40+
"about-time.countDown.startStop": "Start/Stop pseudoclock.",
41+
42+
"ATN.SETTINGS.EnableEventNotificationSound": "Enable Event Notification Sounds",
43+
"ATN.SETTINGS.EnableEventNotificationSoundHint": "Play a sound when an event fires and sends a chat message.",
44+
"ATN.SETTINGS.EventNotificationSoundSource": "Notification Sound Source",
45+
"ATN.SETTINGS.EventNotificationSoundSourceHint": "Choose between the built-in notification sound or a custom audio file.",
46+
"ATN.SETTINGS.SoundSourceBuiltin": "Built-in notification sound",
47+
"ATN.SETTINGS.SoundSourceCustom": "Custom file path",
48+
"ATN.SETTINGS.EventNotificationSoundPath": "Custom Sound File Path",
49+
"ATN.SETTINGS.EventNotificationSoundPathHint": "Path to a custom notification sound (only used when 'Custom file path' is selected). Defaults to ATN's included sounds.",
50+
"ATN.SETTINGS.EventNotificationVolume": "Notification Volume",
51+
"ATN.SETTINGS.EventNotificationVolumeHint": "Volume level for event notification sounds (0-100%).",
52+
"ATN.SETTINGS.TestNotificationSound": "Test Notification Sound",
53+
"ATN.SETTINGS.TestNotificationSoundButton": "Test Sound",
54+
"ATN.SETTINGS.TestNotificationSoundHint": "Play a test notification sound using your current settings."
4155
}

0 commit comments

Comments
 (0)