diff --git a/changelog.md b/changelog.md index c5a5c4fa..c5187987 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,4 @@ -### 0.9.6-7 +### 0.9.6-7-8 - Bug fix on hooks diff --git a/package.json b/package.json index 2071c274..d110642c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "tidy5e-sheet", "title": "Tidy5e Sheet", "description": "Replaces the default D&D 5e character and NPC sheet with an alternate layout focused on a cleaner UI", - "version": "0.9.7", + "version": "0.9.8", "main": "module.js", "license": "SEE LICENSE IN LICENSE", "private": true, diff --git a/src/lang/zh-tw.json b/src/lang/zh-tw.json index c57584b6..1046c029 100644 --- a/src/lang/zh-tw.json +++ b/src/lang/zh-tw.json @@ -1,4 +1,3 @@ - { "TIDY5E.Tidy5eSheet": "Tidy 5e Character Sheet", "TIDY5E.Tidy5eNPC": "Tidy 5e NPC Sheet", diff --git a/src/module.js b/src/module.js index 2bc0b1fe..e886ba4b 100644 --- a/src/module.js +++ b/src/module.js @@ -22,13 +22,12 @@ import { import { Tidy5eSheetVehicleInitialize } from "./scripts/tidy5e-vehicle"; Hooks.once("init", async () => { + // init user settings menu + Tidy5eUserSettings.init(); debug(`module | init | start`); // Preload tidy5e Handlebars Templates preloadTidy5eHandlebarsTemplates(); - // init user settings menu - Tidy5eUserSettings.init(); - Tidy5eSheetInitialize(); Tidy5eSheetNPCInitialize(); Tidy5eSheetVehicleInitialize(); @@ -37,6 +36,7 @@ Hooks.once("init", async () => { }); Hooks.once("ready", async (app, html, data) => { + // Tidy5eUserSettings.init(); debug(`module | ready | start`); if (!game.modules.get("colorsettings")?.active && game.user?.isGM) { let word = "install and activate"; @@ -55,6 +55,7 @@ Hooks.once("ready", async (app, html, data) => { /** perform some necessary operations on character sheet **/ Hooks.on("renderActorSheet", (app, html, data) => { + // Tidy5eUserSettings.init(); debug(`module | renderActorSheet | start`); // Temporary Patch for module incompatibility with https://github.com/misthero/dnd5e-custom-skills // Issue https://github.com/sdenec/tidy5e-sheet/issues/662 @@ -80,35 +81,43 @@ Hooks.on("renderActorSheet", (app, html, data) => { // Hooks.on("updateActor", function (actorEntity, update, options, userId) {}); Hooks.on(`dnd5e.restCompleted`, (actorEntity, data) => { + // Tidy5eUserSettings.init(); Tidy5eExhaustionDnd5eRestCompleted(actorEntity, data); }); Hooks.on("applyActiveEffect", (actor, effect, options) => { + // Tidy5eUserSettings.init(); Tidy5eSheetApplyActiveEffect(actor, effect, options); }); Hooks.on(`createActiveEffect`, (activeEffect, _config, options) => { + // Tidy5eUserSettings.init(); Tidy5eSheetCreateActiveEffect(activeEffect, _config, options); Tidy5eExhaustionCreateActiveEffect(activeEffect, _config, options); }); Hooks.on("updateActiveEffect", (activeEffect, _config, options) => { + // Tidy5eUserSettings.init(); Tidy5eSheetUpdateActiveEffect(activeEffect, _config, options); }); Hooks.on(`deleteActiveEffect`, (activeEffect, _config, options) => { + // Tidy5eUserSettings.init(); Tidy5eSheetDeleteActiveEffect(activeEffect, _config, options); Tidy5eExhaustionDeleteActiveEffect(activeEffect, _config, options); }); Hooks.on("renderTidy5eUserSettings", () => { + // Tidy5eUserSettings.init(); Tidy5eSettingsGmOnlySetup(); }); Hooks.on("dnd5e.preItemUsageConsumption", (item, config, options) => { + // Tidy5eUserSettings.init(); Tidy5eHBUpcastFreeSpellsDnd5ePreItemUsageConsumption(item, config, options); }); Hooks.on("renderAbilityUseDialog", (app, html, options) => { + // Tidy5eUserSettings.init(); Tidy5eSheetRenderAbilityUseDialog(app, html, options); }); diff --git a/src/module.json b/src/module.json index eaa9b409..8b2df06f 100644 --- a/src/module.json +++ b/src/module.json @@ -2,7 +2,7 @@ "id": "tidy5e-sheet", "title": "Tidy5e Sheet", "description": "Replaces the default D&D 5e character and NPC sheet with an alternate layout focused on a cleaner UI", - "version": "0.9.7", + "version": "0.9.8", "authors": [ { "name": "sednec#3813" @@ -20,10 +20,7 @@ } ], "esmodules": ["module.js"], - "styles": [ - "styles/tidy-icons.css", - "styles/tidy5e.css", - "styles/dark/tidy5e-dark.css"], + "styles": ["styles/tidy-icons.css", "styles/tidy5e.css", "styles/dark/tidy5e-dark.css"], "languages": [ { "lang": "en", @@ -88,8 +85,8 @@ }, "manifestPlusVersion": "1.2.1", "url": "https://github.com/sdenec/tidy5e-sheet", - "manifest": "https://github.com/sdenec/tidy5e-sheet/releases/download/0.9.7/module.json", - "download": "https://github.com/sdenec/tidy5e-sheet/releases/download/0.9.7/module.zip", + "manifest": "https://github.com/sdenec/tidy5e-sheet/releases/download/0.9.8/module.json", + "download": "https://github.com/sdenec/tidy5e-sheet/releases/download/0.9.8/module.zip", "readme": "https://github.com/sdenec/tidy5e-sheet/blob/master/README.md", "changelog": "https://github.com/sdenec/tidy5e-sheet/blob/master/changelog.md", "bugs": "https://github.com/sdenec/tidy5e-sheet/issues", diff --git a/src/scripts/app/settings.js b/src/scripts/app/settings.js index 1c4495c4..38d1b343 100644 --- a/src/scripts/app/settings.js +++ b/src/scripts/app/settings.js @@ -3,8 +3,13 @@ import { settingsList } from "./settingsList.js"; import { debug } from "./tidy5e-logger-util.js"; export class Tidy5eUserSettings extends FormApplication { + // static isInitialized = false; + static init() { + // if(!Tidy5eUserSettings.isInitialized){ settingsList(); + // Tidy5eUserSettings.isInitialized = true; + // } } // settings template diff --git a/src/scripts/app/tidy5e-logger-util.js b/src/scripts/app/tidy5e-logger-util.js index 314b3dd3..73e07260 100644 --- a/src/scripts/app/tidy5e-logger-util.js +++ b/src/scripts/app/tidy5e-logger-util.js @@ -6,13 +6,13 @@ import CONSTANTS from "./constants.js"; // export let debugEnabled = 0; // 0 = none, warnings = 1, debug = 2, all = 3 export function debug(msg, args = "") { - // if (game.settings.get(CONSTANTS.MODULE_ID, "debug")) { - console.log(`DEBUG | ${CONSTANTS.MODULE_ID} | ${msg}`, args); - //@ts-ignore - if (game.modules.get("_dev-mode")?.api?.getPackageDebugValue(CONSTANTS.MODULE_ID)) { - console.log(CONSTANTS.MODULE_ID, "|", ...args); + if (game.settings.get(CONSTANTS.MODULE_ID, "debug")) { + console.log(`DEBUG | ${CONSTANTS.MODULE_ID} | ${msg}`, args); + //@ts-ignore + if (game.modules.get("_dev-mode")?.api?.getPackageDebugValue(CONSTANTS.MODULE_ID)) { + console.log(CONSTANTS.MODULE_ID, "|", ...args); + } } - // } return msg; } export function log(message, args = "") { diff --git a/src/styles/partials/_item-with-spells.scss b/src/styles/partials/_item-with-spells.scss index d7351b7e..200a6a64 100644 --- a/src/styles/partials/_item-with-spells.scss +++ b/src/styles/partials/_item-with-spells.scss @@ -1,62 +1,62 @@ .tidy5e.sheet { - .items-with-spells-items-list { - .items-header { - height: 28px; - margin: 2px 0; - padding: 0; - align-items: center; - background: rgba(0, 0, 0, 0.05); - border: 2px groove #eeede0; - font-weight: bold; - >* { - font-size: 12px; - text-align: center; - } - h3 { - padding-left: 5px; - font-family: "Modesto Condensed", "Palatino Linotype", serif; - font-size: 20px; - font-weight: 700; - text-align: left; - font-size: 16px; - } - .item-name { - margin: 0px; - border: none; - } - } - .item { - .item-name { - .item-image { - flex: 0 0 30px; - height: 30px; - background-size: cover; - background-position: 50% 0; - border: none; - margin-right: 5px; - } - } - } - padding: 0px; - .item-list { - padding: 0px; - } - .item-control { - text-align: center; - } - } - .traits { - .tag.tool { - h4 { - font-weight: normal; - } - } - } + .items-with-spells-items-list { + .items-header { + height: 28px; + margin: 2px 0; + padding: 0; + align-items: center; + background: rgba(0, 0, 0, 0.05); + border: 2px groove #eeede0; + font-weight: bold; + > * { + font-size: 12px; + text-align: center; + } + h3 { + padding-left: 5px; + font-family: "Modesto Condensed", "Palatino Linotype", serif; + font-size: 20px; + font-weight: 700; + text-align: left; + font-size: 16px; + } + .item-name { + margin: 0px; + border: none; + } + } + .item { + .item-name { + .item-image { + flex: 0 0 30px; + height: 30px; + background-size: cover; + background-position: 50% 0; + border: none; + margin-right: 5px; + } + } + } + padding: 0px; + .item-list { + padding: 0px; + } + .item-control { + text-align: center; + } + } + .traits { + .tag.tool { + h4 { + font-weight: normal; + } + } + } } .tidy5e-sheet { - &:not(.items-footer) { - >.item-create { - display: none; - } - } + &:not(.items-footer) { + > .item-create { + display: none; + } + } }