From e7282a4b88994c29274faad6ea1c72b8ef932e66 Mon Sep 17 00:00:00 2001 From: Anthony Correa Date: Mon, 3 Feb 2025 08:15:21 -0600 Subject: [PATCH] Fix template load bug and rename main script file - Updated `module.json` to reflect version change from 0.5.2 to 0.5.3. - Renamed `main.js` to `asc-session-title-suggestions.js` for better clarity and consistency. - Modified script path in `module.json` to align with the new file name. - Refactored template loading logic to consolidate into a single call, improving code readability. --- src/module.json | 6 +++--- src/scripts/{main.js => asc-session-title-suggestions.js} | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) rename src/scripts/{main.js => asc-session-title-suggestions.js} (96%) diff --git a/src/module.json b/src/module.json index 3ed545c..c3b6130 100644 --- a/src/module.json +++ b/src/module.json @@ -20,11 +20,11 @@ "path": "lang/en.json" } ], - "download": "https://github.com/anthonyscorrea/asc-session-title-suggestions/releases/download/0.5.2/module.zip", + "download": "https://github.com/anthonyscorrea/asc-session-title-suggestions/releases/download/0.5.3/module.zip", "manifest": "https://github.com/anthonyscorrea/asc-session-title-suggestions/releases/latest/download/module.json", - "version": "0.5.2", + "version": "0.5.3", "scripts": [ - "scripts/main.js" + "scripts/asc-session-title-suggestions.js" ], "esmodules":[ ], diff --git a/src/scripts/main.js b/src/scripts/asc-session-title-suggestions.js similarity index 96% rename from src/scripts/main.js rename to src/scripts/asc-session-title-suggestions.js index 6a882d8..30ef2fa 100644 --- a/src/scripts/main.js +++ b/src/scripts/asc-session-title-suggestions.js @@ -101,8 +101,10 @@ function registerCustomChatCommands() { Hooks.on("init", function() { //This code runs once the Foundry VTT software begins its initialization workflow registerClipboardCopyButton(); - Object.values(TEMPLATES.suggestion).forEach((template_path)=>loadTemplates(template_path)) - Object.values(TEMPLATES.suggestionList).forEach((template_path)=>loadTemplates(template_path)) + loadTemplates([ + ...Object.values(TEMPLATES.suggestion), + ...Object.values(TEMPLATES.suggestionList) + ]) game.settings.register("asc-session-title-suggestions", "titleListCommandRole", { name: game.i18n.localize("SESSION_TITLE_SUGGESTIONS.SETTING_ROLE_NAME"), scope: "world",