diff --git a/dev/dev.mjs b/dev/dev.mjs deleted file mode 100644 index 186743f..0000000 --- a/dev/dev.mjs +++ /dev/null @@ -1 +0,0 @@ -import "./hooks/renderSettings.mjs"; diff --git a/dev/hooks/renderSettings.mjs b/dev/hooks/renderSettings.mjs deleted file mode 100644 index ad11762..0000000 --- a/dev/hooks/renderSettings.mjs +++ /dev/null @@ -1,5 +0,0 @@ -Hooks.on(`renderSettings`, (app, html, ctx, options) => { - /** @type {HTMLElement|undefined} */ - const coreUpdateTooltip = html.querySelector(`.build .value a`); - coreUpdateTooltip?.remove(); -}); diff --git a/langs/en-ca.json b/langs/en-ca.json index 43dcbb0..149bb72 100644 --- a/langs/en-ca.json +++ b/langs/en-ca.json @@ -67,11 +67,6 @@ "macro-is-in-use": "The Macro is used by {count} items/attributes in the world or Actors, the items will lose their ability to use the macro.", "roll": "Roll", "use": "Use", - "version": "Version {version}", - "whats-new": "What's New", - "releases": "Releases", - "wiki": "Wiki", - "issues": "Issues", "item": { "weight": "Weight", "quantity": "Quantity", diff --git a/module/apps/PlayerSheet.mjs b/module/apps/PlayerSheet.mjs index 5dfab59..74830d6 100644 --- a/module/apps/PlayerSheet.mjs +++ b/module/apps/PlayerSheet.mjs @@ -1,8 +1,8 @@ import { __ID__, filePath } from "../consts.mjs"; -import { createContextMenuOption, deleteItemFromElement, editItemFromElement } from "./utils.mjs"; +import { deleteItemFromElement, editItemFromElement } from "./utils.mjs"; import { config } from "../config.mjs"; import { Logger } from "../utils/Logger.mjs"; -import { TAFDocumentSheetConfig } from "./overrides/TAFDocumentSheetConfig.mjs"; +import { TAFDocumentSheetConfig } from "./TAFDocumentSheetConfig.mjs"; import { TAFDocumentSheetMixin } from "./mixins/TAFDocumentSheetMixin.mjs"; import { TAFActor } from "../documents/Actor.mjs"; @@ -226,24 +226,24 @@ export class PlayerSheet extends this.element, `[data-item-uuid]`, [ - createContextMenuOption({ + { label: _loc(`taf.misc.edit`), - visible: (el) => { + condition: (el) => { const itemUuid = el.dataset.itemUuid; const itemExists = itemUuid != null && itemUuid !== ``; return this.isEditable && itemExists; }, onClick: editItemFromElement, - }), - createContextMenuOption({ + }, + { label: _loc(`taf.misc.delete`), - visible: (el) => { + condition: (el) => { const itemUuid = el.dataset.itemUuid; const itemExists = itemUuid != null && itemUuid !== ``; return this.isEditable && itemExists; }, onClick: deleteItemFromElement, - }), + }, ], { jQuery: false, fixed: true }, ); diff --git a/module/apps/overrides/TAFDocumentSheetConfig.mjs b/module/apps/TAFDocumentSheetConfig.mjs similarity index 96% rename from module/apps/overrides/TAFDocumentSheetConfig.mjs rename to module/apps/TAFDocumentSheetConfig.mjs index f31f585..c35b8f6 100644 --- a/module/apps/overrides/TAFDocumentSheetConfig.mjs +++ b/module/apps/TAFDocumentSheetConfig.mjs @@ -1,6 +1,6 @@ -import { __ID__, filePath } from "../../consts.mjs"; -import { getDefaultSizing } from "../../utils/getSizing.mjs"; -import { localizer } from "../../utils/localizer.mjs"; +import { __ID__, filePath } from "../consts.mjs"; +import { getDefaultSizing } from "../utils/getSizing.mjs"; +import { localizer } from "../utils/localizer.mjs"; const { diffObject, expandObject, flattenObject } = foundry.utils; const { DocumentSheetConfig } = foundry.applications.apps; diff --git a/module/apps/overrides/TAFSettingsSidebar.mjs b/module/apps/overrides/TAFSettingsSidebar.mjs deleted file mode 100644 index b33bbb8..0000000 --- a/module/apps/overrides/TAFSettingsSidebar.mjs +++ /dev/null @@ -1,30 +0,0 @@ -import { filePath } from "../../consts.mjs"; - -const { renderTemplate } = foundry.applications.handlebars; -const { Settings } = foundry.applications.sidebar.tabs; - -export class TAFSettingsSidebar extends Settings { - // #region Lifecycle - async _onRender() { - // remove the row from the HTML - const systemRow = this.element.querySelector(`.info .system`); - systemRow?.remove(); - - // add the more customized system info into the sidebar - const systemBlock = this.element.querySelector(`section.system`); - if (!systemBlock) { - const htmlString = await renderTemplate( - filePath(`templates/settings-sidebar-addition.hbs`), - { system: game.system, }, - ); - - const temp = document.createElement(`div`); - temp.innerHTML = htmlString; - const rendered = temp.firstChild; - - const info = this.element.querySelector(`section.info`); - info.insertAdjacentElement(`afterend`, rendered); - }; - }; - // #endregion Lifecycle -}; diff --git a/module/apps/utils.mjs b/module/apps/utils.mjs index b883ddf..de8edcc 100644 --- a/module/apps/utils.mjs +++ b/module/apps/utils.mjs @@ -3,25 +3,6 @@ This file contains utility methods used by Applications in order to be DRYer */ -/** - * A helper function that takes a v14-compatible ContextMenuEntry option - * and adjusts it for v13 if required - * - * @param {ContextMenuEntry} option The v14+ compatible menu entry option - * @returns {ContextMenuEntry} The v14+ or option.onClick(null, target), - }; - }; - - return option; -}; - /** * @param {Event} _event The click event * @param {HTMLElement} target The element to operate on diff --git a/module/hooks/init.mjs b/module/hooks/init.mjs index b06467e..e898f46 100644 --- a/module/hooks/init.mjs +++ b/module/hooks/init.mjs @@ -26,7 +26,6 @@ import helpers from "../handlebarsHelpers/_index.mjs"; import { Logger } from "../utils/Logger.mjs"; import { registerCustomComponents } from "../apps/elements/_index.mjs"; import { registerSockets } from "../sockets/_index.mjs"; -import { TAFSettingsSidebar } from "../apps/overrides/TAFSettingsSidebar.mjs"; Hooks.on(`init`, () => { Logger.debug(`Initializing`); @@ -45,10 +44,6 @@ Hooks.on(`init`, () => { CONFIG.Item.dataModels.attribute = AttributeItemData; // #endregion Data Models - // #region App Overrides - CONFIG.ui.settings = TAFSettingsSidebar; - // #endregion App Overrides - // #region Sheets foundry.documents.collections.Actors.registerSheet( __ID__, diff --git a/styles/Apps/TAFSettingsSidebar.css b/styles/Apps/TAFSettingsSidebar.css deleted file mode 100644 index 010d6b4..0000000 --- a/styles/Apps/TAFSettingsSidebar.css +++ /dev/null @@ -1,29 +0,0 @@ -#settings > .system { - .version-info { - display: flex; - justify-content: center; - align-items: center; - flex-direction: row; - gap: 8px; - - .whats-new { - font-size: smaller; - } - } - - .links { - display: flex; - justify-content: center; - align-items: center; - flex-direction: row; - flex-wrap: wrap; - gap: 8px; - list-style-type: none; - padding: 0; - margin: 0; - - li { - margin: 0; - } - } -} diff --git a/styles/main.css b/styles/main.css index 682b25d..627b546 100644 --- a/styles/main.css +++ b/styles/main.css @@ -31,4 +31,3 @@ @import url("./Apps/PlayerSheet.css") layer(apps); @import url("./Apps/QueryStatus.css") layer(apps); @import url("./Apps/TAFDocumentSheetConfig.css") layer(apps); -@import url("./Apps/TAFSettingsSidebar.css") layer(apps); diff --git a/system.json b/system.json index 22a301f..8e186b1 100644 --- a/system.json +++ b/system.json @@ -2,7 +2,7 @@ "id": "taf", "title": "Text-Based Actors", "description": "An intentionally minimalist system that enables you to play rules-light games without getting in your way!", - "version": "3.0.2", + "version": "3.0.1", "download": "", "manifest": "", "url": "https://git.varify.ca/Foundry/taf", @@ -15,8 +15,7 @@ { "name": "Oliver" } ], "esmodules": [ - "module/main.mjs", - "dev/dev.mjs" + "module/main.mjs" ], "styles": [ { @@ -55,7 +54,6 @@ }, "socket": true, "flags": { - "forgejo_api": "https://git.varify.ca/api/v1", "hotReload": { "extensions": ["css", "hbs", "json", "js", "mjs", "svg"], "paths": ["templates", "langs", "styles", "module", "assets"] diff --git a/templates/settings-sidebar-addition.hbs b/templates/settings-sidebar-addition.hbs deleted file mode 100644 index 71fed2b..0000000 --- a/templates/settings-sidebar-addition.hbs +++ /dev/null @@ -1,48 +0,0 @@ -
-

- {{ system.title }} -

-
- - {{localize "taf.misc.version" version=system.version}} - - - {{localize "taf.misc.whats-new"}} - -
- -