diff --git a/README.md b/README.md index 064c09a..4c0ae2c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# The Mill's Fabula - v0.1.0 +# The Mill's Fabula - v0.2.0 This little [FoundryVTT](https://foundryvtt.com/) module is a collection of compendiums and functionalities to power our Fabula Ultima campaigns. @@ -17,9 +17,9 @@ https://git.tfk-astrodome.net/trotFunky/TheMillsFabula/raw/branch/release/module # Features This module is an aggregate of different things that are useful for us or that the GM wanted -to play with, so they don't necessarily connect with each other. +to play with, so they don't necessarily connect with each other and can be disabled if wanted. -They are described below in their own secions. +They are described below in their own sections. ## Combat border diff --git a/lang/en.json b/lang/en.json index c438434..12be337 100644 --- a/lang/en.json +++ b/lang/en.json @@ -4,6 +4,10 @@ "MF": { "Border": { "Settings": { + "BorderEnabled": { + "Name": "Enable borders ?", + "Hint": "Should dynamic combat status borders be displayed ?" + }, "BaseBorder": { "Name": "Base border", "Hint": "The image to use as a border for player tokens at all times." diff --git a/lang/fr.json b/lang/fr.json index dd036a2..b0dc8f5 100644 --- a/lang/fr.json +++ b/lang/fr.json @@ -4,6 +4,10 @@ "MF": { "Border": { "Settings": { + "BorderEnabled": { + "Name": "Activer les bordures ?", + "Hint": "Les bordures de combat dynamiques devraient-elles être affichées ?" + }, "BaseBorder": { "Name": "Bordure par défaut", "Hint": "L'image à utiliser comme bordure pour les jetons joueurs, présente en permanence." diff --git a/module.json b/module.json index 5bc184b..4145ab5 100644 --- a/module.json +++ b/module.json @@ -2,7 +2,7 @@ "id": "the-mills-fabula", "title": "Fabula Moletrina", "description": "A module implementing our idiosyncratic ideas for the Mill's campaigns.", - "version": "0.1.0", + "version": "0.2.0", "compatibility": { "minimum": "12", "verified": "12", @@ -72,5 +72,5 @@ "readme": "README.md", "url": "https://git.tfk-astrodome.net/trotFunky/TheMillsFabula/src/branch/release", "manifest": "https://git.tfk-astrodome.net/trotFunky/TheMillsFabula/raw/branch/release/module.json", - "download": "https://git.tfk-astrodome.net/trotFunky/TheMillsFabula/archive/v0.1.0.zip" + "download": "https://git.tfk-astrodome.net/trotFunky/TheMillsFabula/archive/v0.2.0.zip" } diff --git a/packs/macros/000069.log b/packs/macros/000071.log similarity index 100% rename from packs/macros/000069.log rename to packs/macros/000071.log diff --git a/packs/macros/CURRENT b/packs/macros/CURRENT index 284d53f..bcf1079 100644 --- a/packs/macros/CURRENT +++ b/packs/macros/CURRENT @@ -1 +1 @@ -MANIFEST-000068 +MANIFEST-000070 diff --git a/packs/macros/LOG b/packs/macros/LOG index a1ba921..900fce7 100644 --- a/packs/macros/LOG +++ b/packs/macros/LOG @@ -1,3 +1,3 @@ -2025/05/09-18:11:40.073652 7253c0dec6c0 Recovering log #66 -2025/05/09-18:11:40.092496 7253c0dec6c0 Delete type=3 #64 -2025/05/09-18:11:40.092522 7253c0dec6c0 Delete type=0 #66 +2025/05/28-18:53:04.916656 7f11a31ec6c0 Recovering log #69 +2025/05/28-18:53:04.935350 7f11a31ec6c0 Delete type=0 #69 +2025/05/28-18:53:04.935382 7f11a31ec6c0 Delete type=3 #68 diff --git a/packs/macros/LOG.old b/packs/macros/LOG.old index 53e9bd4..a1ba921 100644 --- a/packs/macros/LOG.old +++ b/packs/macros/LOG.old @@ -1,7 +1,3 @@ -2025/05/09-17:35:50.464775 7253c1dee6c0 Recovering log #62 -2025/05/09-17:35:50.483617 7253c1dee6c0 Delete type=3 #60 -2025/05/09-17:35:50.483640 7253c1dee6c0 Delete type=0 #62 -2025/05/09-18:11:37.487216 7253ae46b6c0 Level-0 table #67: started -2025/05/09-18:11:37.487234 7253ae46b6c0 Level-0 table #67: 0 bytes OK -2025/05/09-18:11:37.498365 7253ae46b6c0 Delete type=0 #65 -2025/05/09-18:11:37.548398 7253ae46b6c0 Manual compaction at level-0 from '!macros!AXWjXCoFJKa5KmSU' @ 72057594037927935 : 1 .. '!macros!AXWjXCoFJKa5KmSU' @ 0 : 0; will stop at (end) +2025/05/09-18:11:40.073652 7253c0dec6c0 Recovering log #66 +2025/05/09-18:11:40.092496 7253c0dec6c0 Delete type=3 #64 +2025/05/09-18:11:40.092522 7253c0dec6c0 Delete type=0 #66 diff --git a/packs/macros/MANIFEST-000068 b/packs/macros/MANIFEST-000070 similarity index 66% rename from packs/macros/MANIFEST-000068 rename to packs/macros/MANIFEST-000070 index a1413e8..d3eb9f1 100644 Binary files a/packs/macros/MANIFEST-000068 and b/packs/macros/MANIFEST-000070 differ diff --git a/scripts/token_combat_border.mjs b/scripts/token_combat_border.mjs index 1ffa328..7dd4753 100644 --- a/scripts/token_combat_border.mjs +++ b/scripts/token_combat_border.mjs @@ -18,6 +18,7 @@ const SocketMessages = Object.freeze({ }) const BorderSettings = Object.freeze({ + BorderEnabled: "borderEnabled", BaseBorderPath: "baseBorderPath", PlayedBorderPath: "playedBorderPath", }) @@ -151,11 +152,23 @@ function combat_hook_update_token_borders(combat, data) { function combat_border_main() { Hooks.once("init", () => { + game.settings.register(MillsFabula.id, BorderSettings.BorderEnabled, { + name: game.i18n.localize('MF.Border.Settings.BorderEnabled.Name'), + hint: game.i18n.localize('MF.Border.Settings.BorderEnabled.Hint'), + type: Boolean, + config: true, + scope: 'world', + requiresReload: true, + default: true + }); + + // Only show the settings if the borders are enabled. + let borders_enabled = game.settings.get(MillsFabula.id, BorderSettings.BorderEnabled); game.settings.register(MillsFabula.id, BorderSettings.BaseBorderPath, { name: game.i18n.localize('MF.Border.Settings.BaseBorder.Name'), hint: game.i18n.localize('MF.Border.Settings.BaseBorder.Hint'), type: String, - config: true, + config: borders_enabled, scope: 'world', requiresReload: true, filePicker: 'image', @@ -166,7 +179,7 @@ function combat_border_main() { name: game.i18n.localize('MF.Border.Settings.PlayedBorder.Name'), hint: game.i18n.localize('MF.Border.Settings.PlayedBorder.Hint'), type: String, - config: true, + config: borders_enabled, scope: 'world', requiresReload: true, filePicker: 'image', @@ -186,6 +199,10 @@ function combat_border_main() { // Create the borders from defined textures and add them to the tokens when they are first created on canvas. // FIXME: Does not work on scene change ! Hooks.on("drawToken", (drawn_token) => { + // FIXME: Handle deactivation properly + if (!game.settings.get(MillsFabula.id, BorderSettings.BorderEnabled)) { + return; + } // Only apply the borders to player tokens if (drawn_token.actor?.type !== "character") return; @@ -207,6 +224,10 @@ function combat_border_main() { Hooks.on("ready", () => { + // FIXME: Handle deactivation properly + if (!game.settings.get(MillsFabula.id, BorderSettings.BorderEnabled)) { + return; + } // Players cannot run the combat hooks used here, which trigger for the GM no matter what. // So register them for the GM only, who will execute the updates for players via SocketLib. if (!game.user?.isGM) {