Skip to content

Commit 94ac9fd

Browse files
committed
v13.5.0.0: Remove Auto-detect option and improve notifications
- Removed 'Auto-detect' from calendar dropdown (neutral selection handles this automatically) - Changed default from 'auto' to 'none' - Added automatic migration from 'auto' to 'none' for existing users - Simplified getActive() logic (no more auto-detection branching) - Added notification when canceling dialog only if user is on 'none' with options available - Updated README to remove 'Auto-detect' references and clarify neutral selection - Calendar selection is now explicit: users choose from available calendars or stay on 'None'
1 parent e4831e1 commit 94ac9fd

File tree

3 files changed

+24
-21
lines changed

3 files changed

+24
-21
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ It supports **D&D 5e v5.2+ native calendar**, **Seasons & Stars**, **Simple Cale
2121
```
2222

2323
2. Enable the module in your world.
24-
3. (Optional) Configure calendar system in settings: Auto-detect (default), D&D 5e Calendar, Simple Calendar Reborn, Seasons & Stars, or None.
24+
3. (Optional) Configure calendar system in settings: D&D 5e Calendar, Simple Calendar Reborn, Seasons & Stars, or None (default).
2525

2626
> Compatibility: Designed for FVTT v13 (min 13, max 13.x).
2727
> **Calendar Support:** D&D 5e v5.2+ native calendar, Seasons & Stars, Simple Calendar Reborn, and core time fallback.
@@ -38,16 +38,16 @@ About Time Next uses a **calendar adapter system** to integrate with multiple ca
3838
- **Seasons & Stars**: Full integration with formatted date/time display.
3939
- **Simple Calendar Reborn**: Full integration with time authority model. Simple Calendar has been reborn as Simple Calendar Reborn (maintained by Arctis Fireblight for Foundry v13+), and we have integrated it with complete time management support.
4040

41-
**Auto-Detection (Default):**
42-
When set to "Auto-detect", the module uses neutral selection logic:
41+
**Neutral Calendar Selection:**
42+
The module uses neutral selection logic with no automatic favoritism:
4343
- **0 calendars available** → Uses "None" (Foundry core time)
44-
- **1 calendar available** → Auto-selects that calendar (no favoritism)
44+
- **1 calendar available** → Auto-selects that calendar
4545
- **2+ calendars available** → Uses "None" and shows selection dialog
4646

4747
All supported calendars (D&D 5e, Simple Calendar Reborn, Seasons & Stars) are treated equally. The module never automatically picks one third-party calendar over another.
4848

4949
**Calendar Integration Settings:**
50-
- Dropdown shows **only detected** calendars (plus "Auto-detect" and "None")
50+
- Dropdown shows **only detected** calendars (plus "None")
5151
- Detection info panel shows **all calendars** with ✓/✗ status
5252
- If your selected calendar becomes unavailable, module falls back automatically
5353

module/calendar/CalendarAdapter.js

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -108,34 +108,36 @@ export class CalendarAdapter {
108108

109109

110110
// Get user's calendar system preference
111-
let preference = "auto";
111+
let preference = "none"; // Default to none (neutral selection)
112112
try {
113-
preference = game.settings.get(MODULE_ID, "calendar-system") || "auto";
113+
preference = game.settings.get(MODULE_ID, "calendar-system") || "none";
114+
115+
// Migrate legacy "auto" to "none" (auto-detect removed in v13.5.0.0)
116+
if (preference === "auto") {
117+
preference = "none";
118+
try {
119+
game.settings.set(MODULE_ID, "calendar-system", "none");
120+
} catch {
121+
// Ignore migration error
122+
}
123+
}
114124
} catch (e) {
115125
// Setting doesn't exist yet (during migration/first run)
116126
// Fall back to legacy setting
117127
try {
118128
const legacyUseSC = game.settings.get(MODULE_ID, "use-simple-calendar");
119129
if (legacyUseSC === false) preference = "none";
120-
// If true, let auto-detection handle it
130+
// If true, let neutral selection handle it
121131
} catch {
122-
// No settings at all, use auto
132+
// No settings at all, use none
123133
}
124134
}
125135

126136
// Detect available calendar systems
127137
const available = CalendarAdapter.detectAvailable();
128138

129-
// Resolve "auto" preference - only auto-select when exactly one calendar available
130-
// If multiple calendars available, use "none" and let checkForCalendarChanges() prompt user
139+
// Use preference directly (neutral selection via checkForCalendarChanges dialog)
131140
let choice = preference;
132-
if (choice === "auto") {
133-
if (available.length === 1) {
134-
choice = available[0];
135-
} else {
136-
choice = "none"; // 0 or 2+ calendars: use core time, prompt user to choose
137-
}
138-
}
139141

140142
// If user chose a system that's not available, fall back to first available
141143
if (choice !== "none" && !available.includes(choice)) {
@@ -475,6 +477,9 @@ export class CalendarAdapter {
475477
console.error(`${MODULE_ID} | Failed to switch calendar:`, e);
476478
ui.notifications.error("Failed to switch calendar system");
477479
}
480+
} else if (!confirmed && (selected === "none" || selected === "auto") && available.length > 0) {
481+
// Only show notification when canceling if user is on "none" and other options exist
482+
ui.notifications.info("Calendar system remains set to None");
478483
}
479484

480485
resolve();

module/settings.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export const registerSettings = function () {
1414

1515
const calendarLabelFor = (value) => {
1616
const names = {
17-
auto: "Auto-detect",
1817
none: "None (Foundry Core Time)",
1918
dnd5e: "D&D 5e Calendar (v5.2+)",
2019
"simple-calendar-reborn": "Simple Calendar Reborn",
@@ -173,14 +172,13 @@ export const registerSettings = function () {
173172
config: true,
174173
type: String,
175174
choices: {
176-
"auto": "Auto-detect",
177175
"none": "None (Foundry Core Time)",
178176
"dnd5e": "D&D 5e Calendar (v5.2+)",
179177
"simple-calendar-reborn": "Simple Calendar Reborn",
180178
// "simple-calendar": "Simple Calendar (Legacy)", // ARCHIVED - v13 incompatible
181179
"seasons-and-stars": "Seasons & Stars"
182180
},
183-
default: "auto",
181+
default: "none",
184182
requiresReload: false,
185183
onChange: value => {
186184
// Always-on basic status (users can confirm what they selected).

0 commit comments

Comments
 (0)