diff --git a/.gitignore b/.gitignore index 4beb05c..313026d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,10 +3,8 @@ node_modules/ *.bak.* references.txt references/ -/.*/ -!/.vscode/ -!/.github/ -/*.ref.* +.styles/ +/foundry.js *.lock *.zip diff --git a/.vscode/components.html-data.json b/.vscode/components.html-data.json deleted file mode 100644 index e1c3ebd..0000000 --- a/.vscode/components.html-data.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "version": 1.1, - "tags": [ - { - "name": "dd-incrementer", - "description": "A number input that allows more flexible increase/decrease buttons", - "attributes": [ - { "name": "value", "description": "The initial value to put in the input" }, - { "name": "name", "description": "The form name to use when this input is used to submit data" }, - { "name": "min", "description": "The minimum value that this input can contain" }, - { "name": "max", "description": "The maximum value that this input can contain" }, - { "name": "smallStep", "description": "The value that the input is changed by when clicking a delta button or using the up/down arrow key" }, - { "name": "largeStep", "description": "The value that the input is changed by when clicking a delta button with control held or using the page up/ page down arrow key" } - ] - }, - { - "name": "dd-icon", - "description": "Loads an icon asynchronously, caching the result for future uses", - "attributes": [ - { "name": "name", "description": "The name of the icon, this is relative to the assets folder of the dotdungeon system" }, - { "name": "path", "description": "The full path of the icon, this will only be used if `name` isn't provided or fails to fetch." } - ] - } - ], - "globalAttributes": [], - "valueSets": [] -} diff --git a/.vscode/settings.json b/.vscode/settings.json index 9cd44b8..36a383b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -12,8 +12,5 @@ "node_modules": true, "packs": true, ".gitattributes": true, - }, - "html.customData": [ - "./.vscode/components.html-data.json" - ] -} + } +} \ No newline at end of file diff --git a/assets/caret-down.svg b/assets/caret-down.svg new file mode 100644 index 0000000..415d3db --- /dev/null +++ b/assets/caret-down.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/caret-right.svg b/assets/caret-right.svg new file mode 100644 index 0000000..7d1d59b --- /dev/null +++ b/assets/caret-right.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/chat-bubble.svg b/assets/chat-bubble.svg new file mode 100644 index 0000000..8dde604 --- /dev/null +++ b/assets/chat-bubble.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/assets/close.svg b/assets/close.svg new file mode 100644 index 0000000..f6c80ed --- /dev/null +++ b/assets/close.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/ui/plus.svg b/assets/create.svg similarity index 100% rename from assets/ui/plus.svg rename to assets/create.svg diff --git a/assets/dice/d10.svg b/assets/dice/d10.svg index 3debc8e..96a39a1 100644 --- a/assets/dice/d10.svg +++ b/assets/dice/d10.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/assets/dice/d12.svg b/assets/dice/d12.svg index df2787c..dac2e4c 100644 --- a/assets/dice/d12.svg +++ b/assets/dice/d12.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/assets/dice/d20.svg b/assets/dice/d20.svg index a829cdf..82cf8b3 100644 --- a/assets/dice/d20.svg +++ b/assets/dice/d20.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/assets/dice/d4.svg b/assets/dice/d4.svg index f31809b..3388bda 100644 --- a/assets/dice/d4.svg +++ b/assets/dice/d4.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/assets/dice/d6.svg b/assets/dice/d6.svg index 00dfed7..bea7528 100644 --- a/assets/dice/d6.svg +++ b/assets/dice/d6.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/assets/dice/d8.svg b/assets/dice/d8.svg index 7731f96..ca3b00b 100644 --- a/assets/dice/d8.svg +++ b/assets/dice/d8.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/assets/edit.svg b/assets/edit.svg new file mode 100644 index 0000000..7cc344b --- /dev/null +++ b/assets/edit.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/garbage-bin.svg b/assets/garbage-bin.svg new file mode 100644 index 0000000..b9268a5 --- /dev/null +++ b/assets/garbage-bin.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/minus.svg b/assets/minus.svg new file mode 100644 index 0000000..171613e --- /dev/null +++ b/assets/minus.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/assets/sheet.svg b/assets/sheet.svg new file mode 100644 index 0000000..eaf555b --- /dev/null +++ b/assets/sheet.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/assets/sources.txt b/assets/sources.txt index 2896d5f..b002fc2 100644 --- a/assets/sources.txt +++ b/assets/sources.txt @@ -1,15 +1,12 @@ -Disclaimer: - All icons included in this repo have been scaled and optimized as needed. - Amer Alamer - ui/caret/right.svg (https://thenounproject.com/icon/arrow-caret-right-1143917/) - ui/caret/down.svg (https://thenounproject.com/icon/arrow-caret-down-1143911/) + caret-right.svg (https://thenounproject.com/icon/arrow-caret-right-1143917/) + caret-down.svg (https://thenounproject.com/icon/arrow-caret-down-1143911/) Alice Design: - ui/garbage-bin.svg (https://thenounproject.com/icon/garbage-2025492/) + garbage-bin.svg (https://thenounproject.com/icon/garbage-2025492/) zapesicon: - ui/chat-bubble.svg (https://thenounproject.com/icon/chat-6423186/) + chat-bubble.svg (https://thenounproject.com/icon/chat-6423186/) Fritz Duggan: dice/d4.svg (https://thenounproject.com/icon/d4-4570604/) @@ -20,19 +17,21 @@ Fritz Duggan: dice/d20.svg (https://thenounproject.com/icon/d20-4570607/) Landan Lloyd: - ui/plus.svg (https://thenounproject.com/icon/create-1447560/) + create.svg (https://thenounproject.com/icon/create-1447560/) Bismillah - ui/minus.svg (https://thenounproject.com/icon/minus-1727966/) + minus.svg (https://thenounproject.com/icon/minus-1727966/) Rokhman Kharis: - ui/close.svg (https://thenounproject.com/icon/close-4996834/) + close.svg (https://thenounproject.com/icon/close-4996834/) Athok: - ui/sheet.svg (https://thenounproject.com/icon/sheet-5939348/) + sheet.svg (https://thenounproject.com/icon/sheet-5939348/) Icon Depot: - ui/pencil.svg (https://thenounproject.com/icon/edit-1489252/) + edit.svg (https://thenounproject.com/icon/edit-1489252/) -Muhammad Ahsanu Nadia: - ui/help.svg (https://thenounproject.com/icon/help-6778522/) +Oliver Akins: + chat-bubble.svg : Scaling + create.svg : Scaling, Optimization + sheet.svg : Scaling \ No newline at end of file diff --git a/assets/ui/caret/down.svg b/assets/ui/caret/down.svg deleted file mode 100644 index 5c15836..0000000 --- a/assets/ui/caret/down.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/ui/caret/right.svg b/assets/ui/caret/right.svg deleted file mode 100644 index 3b19a49..0000000 --- a/assets/ui/caret/right.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/ui/chat-bubble.svg b/assets/ui/chat-bubble.svg deleted file mode 100644 index a9182c1..0000000 --- a/assets/ui/chat-bubble.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/ui/close.svg b/assets/ui/close.svg deleted file mode 100644 index 3082802..0000000 --- a/assets/ui/close.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/ui/garbage-bin.svg b/assets/ui/garbage-bin.svg deleted file mode 100644 index dd96a44..0000000 --- a/assets/ui/garbage-bin.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/ui/help.svg b/assets/ui/help.svg deleted file mode 100644 index bd06071..0000000 --- a/assets/ui/help.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/ui/minus.svg b/assets/ui/minus.svg deleted file mode 100644 index d1d3e94..0000000 --- a/assets/ui/minus.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/ui/pencil.svg b/assets/ui/pencil.svg deleted file mode 100644 index 455379f..0000000 --- a/assets/ui/pencil.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/ui/sheet.svg b/assets/ui/sheet.svg deleted file mode 100644 index 32a3268..0000000 --- a/assets/ui/sheet.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/augments.d.ts b/augments.d.ts deleted file mode 100644 index df16590..0000000 --- a/augments.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -interface Actor { - /** The system-specific data */ - system: any; -}; - -interface Item { - /** The system-specific data */ - system: any; -}; diff --git a/jsconfig.json b/jsconfig.json deleted file mode 100644 index 2304d94..0000000 --- a/jsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "types": [ - "./augments.d.ts" - ] - } -} \ No newline at end of file diff --git a/langs/en-ca.2.json b/langs/en-ca.2.json index dce0efa..460fbaf 100644 --- a/langs/en-ca.2.json +++ b/langs/en-ca.2.json @@ -68,39 +68,13 @@ "rare": "Rare", "legendary": "Legendary" }, - "location": { - "unknown": "@dotdungeon.common.empty", - "inventory": "Inventory", - "equipped": "Equipped", - "storage": "Storage" - }, "default": { "name": "(Unnamed @TYPES.{document}.{type})" }, "common": { "send-to-chat": "Send to Chat", "edit": "Edit", - "delete": "Delete", - "reset": "Reset", - "empty": "---", - "help": "Help", - "gm": "Server", - "view-larger": "View Larger" - }, - "sheet-names": { - "*DataSheet": "Data Sheet" - }, - "help-tooltips": { - "calculated-capacity": { - "title": "What is Calculated Capacity?", - "content": "

The calculated capacity is how much space in your inventory that the item will take up, the way it is calculated is determined by the item. Usually the main thing that affects the capacity is the item's quantity, but this can be turned off by the @dotdungeon.common.gm, which means that no matter the quantity it will only use up one capacity. The @dotdungeon.common.gm can also entirely disable capacity usage which will make the used capacity always be zero.

" - } - }, - "delete": { - "ActiveEffect": { - "title": "Delete Effect", - "content": "

Are you sure you would like to delete the active effect: {name}

" - } + "delete": "Delete" } }, "TYPES": { @@ -121,9 +95,6 @@ "legendaryItem": "Legendary Item", "spell": "Spell", "untyped": "Custom" - }, - "ActiveEffect": { - "base": "Effect" } } } \ No newline at end of file diff --git a/module/components/icon.mjs b/module/components/icon.mjs deleted file mode 100644 index 8c70d40..0000000 --- a/module/components/icon.mjs +++ /dev/null @@ -1,125 +0,0 @@ -import { StyledShadowElement } from "./mixins/Styles.mjs"; - -/** -Attributes: -@property {string} name - The name of the icon, takes precedence over the path -@property {string} path - The path of the icon file -*/ -export class DotDungeonIcon extends StyledShadowElement(HTMLElement) { - static elementName = `dd-icon`; - static formAssociated = false; - - /* Stuff for the mixin to use */ - static _stylePath = `v3/components/icon.css`; - - - static _cache = new Map(); - #container; - /** @type {null | string} */ - _name; - /** @type {null | string} */ - _path; - - /* Stored IDs for all of the hooks that are in this component */ - #svgHmr; - - constructor() { - super(); - // this._shadow = this.attachShadow({ mode: `open`, delegatesFocus: true }); - - this.#container = document.createElement(`div`); - this._shadow.appendChild(this.#container); - }; - - _mounted = false; - async connectedCallback() { - super.connectedCallback(); - if (this._mounted) return; - - this._name = this.getAttribute(`name`); - this._path = this.getAttribute(`path`); - - /* - This converts all of the double-dash prefixed properties on the element to - CSS variables so that they don't all need to be provided by doing style="" - */ - for (const attrVar of this.attributes) { - if (attrVar.name?.startsWith(`var:`)) { - const prop = attrVar.name.replace(`var:`, ``); - this.style.setProperty(`--` + prop, attrVar.value); - }; - }; - - /* - Try to retrieve the icon if it isn't present, try the path then default to - the slot content, as then we can have a default per-icon usage - */ - let content; - if (this._name) { - content = await this.#getIcon(`./systems/dotdungeon/assets/${this._name}.svg`); - }; - - if (this._path && !content) { - content = await this.#getIcon(this._path); - }; - - if (content) { - this.#container.appendChild(content.cloneNode(true)); - }; - - /* - This is so that when we get an HMR event from Foundry we can appropriately - handle it using our logic to update the component and the icon cache. - */ - if (game.settings.get(`dotdungeon`, `devMode`)) { - this.#svgHmr = Hooks.on(`dd-hmr:svg`, (iconName, data) => { - if (this._name === iconName || this._path?.endsWith(data.path)) { - const svg = this.#parseSVG(data.content); - this.constructor._cache.set(iconName, svg); - this.#container.replaceChildren(svg.cloneNode(true)); - }; - }); - }; - - this._mounted = true; - }; - - disconnectedCallback() { - super.disconnectedCallback(); - if (!this._mounted) return; - - Hooks.off(`dd-hmr:svg`, this.#svgHmr); - - this._mounted = false; - }; - - async #getIcon(path) { - // Cache hit! - if (this.constructor._cache.has(path)) { - console.debug(`.dungeon | Icon ${path} cache hit`); - return this.constructor._cache.get(path); - }; - - const r = await fetch(path); - switch (r.status) { - case 200: - case 201: - break; - default: - console.error(`.dungeon | Failed to fetch icon: ${path}`); - return; - }; - - console.debug(`.dungeon | Adding icon ${path} to the cache`); - const svg = this.#parseSVG(await r.text()); - this.constructor._cache.set(path, svg); - return svg; - }; - - /** Takes an SVG string and returns it as a DOM node */ - #parseSVG(content) { - const temp = document.createElement(`div`); - temp.innerHTML = content; - return temp.querySelector(`svg`); - }; -}; diff --git a/module/components/incrementer.mjs b/module/components/incrementer.mjs deleted file mode 100644 index 68e426a..0000000 --- a/module/components/incrementer.mjs +++ /dev/null @@ -1,149 +0,0 @@ -import { DotDungeonIcon } from "./icon.mjs"; -import { StyledShadowElement } from "./mixins/Styles.mjs"; - -/** -Attributes: -@property {string} name - The path to the value to update -@property {number} value - The actual value of the input -@property {number} min - The minimum value of the input -@property {number} max - The maximum value of the input -@property {number?} smallStep - The step size used for the buttons and arrow keys -@property {number?} largeStep - The step size used for the buttons + Ctrl and page up / down - -Styling: -- `--height`: Controls the height of the element + the width of the buttons (default: 1.25rem) -- `--width`: Controls the width of the number input (default 50px) -*/ -export class DotDungeonIncrementer extends StyledShadowElement(HTMLElement) { - static elementName = `dd-incrementer`; - static formAssociated = true; - - static _stylePath = `v3/components/incrementer.css`; - - _internals; - #input; - - _min; - _max; - _smallStep; - _largeStep; - - constructor() { - super(); - - // Form internals - this._internals = this.attachInternals(); - this._internals.role = `spinbutton`; - }; - - get form() { - return this._internals.form; - } - - get name() { - return this.getAttribute(`name`); - } - set name(value) { - this.setAttribute(`name`, value); - } - - get value() { - return this.getAttribute(`value`); - }; - set value(value) { - this.setAttribute(`value`, value); - }; - - get type() { - return `number`; - } - - connectedCallback() { - super.connectedCallback(); - this.replaceChildren(); - - // Attribute parsing / registration - const value = this.getAttribute(`value`); - this._min = parseInt(this.getAttribute(`min`) ?? 0); - this._max = parseInt(this.getAttribute(`max`) ?? 0); - this._smallStep = parseInt(this.getAttribute(`smallStep`) ?? 1); - this._largeStep = parseInt(this.getAttribute(`largeStep`) ?? 5); - - this._internals.ariaValueMin = this._min; - this._internals.ariaValueMax = this._max; - - const container = document.createElement(`div`); - - // The input that the user can see / modify - const input = document.createElement(`input`); - this.#input = input; - input.type = `number`; - input.ariaHidden = true; - input.min = this.getAttribute(`min`); - input.max = this.getAttribute(`max`); - input.addEventListener(`change`, this.#updateValue.bind(this)); - input.value = value; - - // plus button - const increment = document.createElement(DotDungeonIcon.elementName); - increment.setAttribute(`name`, `ui/plus`); - increment.setAttribute(`var:size`, `0.75rem`); - increment.setAttribute(`var:fill`, `currentColor`); - increment.ariaHidden = true; - increment.classList.value = `increment`; - increment.addEventListener(`mousedown`, this.#increment.bind(this)); - - // minus button - const decrement = document.createElement(DotDungeonIcon.elementName); - decrement.setAttribute(`name`, `ui/minus`); - decrement.setAttribute(`var:size`, `0.75rem`); - decrement.setAttribute(`var:fill`, `currentColor`); - decrement.ariaHidden = true; - decrement.classList.value = `decrement`; - decrement.addEventListener(`mousedown`, this.#decrement.bind(this)); - - // Construct the DOM - container.appendChild(decrement); - container.appendChild(input); - container.appendChild(increment); - this._shadow.appendChild(container); - - /* - This converts all of the namespace prefixed properties on the element to - CSS variables so that they don't all need to be provided by doing style="" - */ - for (const attrVar of this.attributes) { - if (attrVar.name?.startsWith(`var:`)) { - const prop = attrVar.name.replace(`var:`, ``); - this.style.setProperty(`--` + prop, attrVar.value); - }; - }; - }; - - #updateValue() { - let value = parseInt(this.#input.value); - if (this.getAttribute(`min`)) value = Math.max(this._min, value); - if (this.getAttribute(`max`)) value = Math.min(this._max, value); - this.#input.value = value; - this.value = value; - this.dispatchEvent(new Event(`change`, { bubbles: true })); - }; - - /** @param {Event} $e */ - #increment($e) { - $e.preventDefault(); - let value = parseInt(this.#input.value); - value += $e.ctrlKey ? this._largeStep : this._smallStep; - this.#input.value = value; - this.#updateValue(); - }; - - /** @param {Event} $e */ - #decrement($e) { - $e.preventDefault(); - let value = parseInt(this.#input.value); - value -= $e.ctrlKey ? this._largeStep : this._smallStep; - this.#input.value = value; - this.#updateValue(); - }; -}; diff --git a/module/components/index.mjs b/module/components/index.mjs deleted file mode 100644 index f4d39e9..0000000 --- a/module/components/index.mjs +++ /dev/null @@ -1,23 +0,0 @@ -import { DotDungeonIncrementer } from "./incrementer.mjs"; -import { DotDungeonIcon } from "./icon.mjs"; - -const components = [ - DotDungeonIcon, - DotDungeonIncrementer, -]; - -export function registerCustomComponents() { - (CONFIG.CACHE ??= {}).componentListeners ??= []; - for (const component of components) { - if (!window.customElements.get(component.elementName)) { - console.debug(`.dungeon | Registering component "${component.elementName}"`); - window.customElements.define( - component.elementName, - component - ); - if (component.formAssociated) { - CONFIG.CACHE.componentListeners.push(component.elementName); - } - }; - } -}; diff --git a/module/components/mixins/Styles.mjs b/module/components/mixins/Styles.mjs deleted file mode 100644 index 33d5eb5..0000000 --- a/module/components/mixins/Styles.mjs +++ /dev/null @@ -1,80 +0,0 @@ -/** - * @param {HTMLElement} Base - */ -export function StyledShadowElement(Base) { - return class extends Base { - /** - * The path to the CSS that is loaded - * @type {string} - */ - static _stylePath; - - /** - * The stringified CSS to use - * @type {string} - */ - static _styles; - - /** - * The HTML element of the stylesheet - * @type {HTMLStyleElement} - */ - _style; - - /** @type {ShadowRoot} */ - _shadow; - - /** - * The hook ID for this element's CSS hot reload - * @type {number} - */ - #cssHmr; - - constructor() { - super(); - - this._shadow = this.attachShadow({ mode: `open` }); - this._style = document.createElement(`style`); - this._shadow.appendChild(this._style); - }; - - #mounted = false; - connectedCallback() { - if (this.#mounted) return; - - this._getStyles(); - - if (game.settings.get(`dotdungeon`, `devMode`)) { - this.#cssHmr = Hooks.on(`dd-hmr:css`, (data) => { - if (data.path.endsWith(this.constructor._stylePath)) { - this._style.innerHTML = data.content; - }; - }); - }; - - this.#mounted = true; - }; - - disconnectedCallback() { - if (!this.#mounted) return; - if (this.#cssHmr != null) { - Hooks.off(`dd-hmr:css`, this.#cssHmr); - this.#cssHmr = null; - }; - this.#mounted = false; - }; - - _getStyles() { - if (this.constructor._styles) { - this._style.innerHTML = this.constructor._styles; - } else { - fetch(`./systems/dotdungeon/.styles/${this.constructor._stylePath}`) - .then(r => r.text()) - .then(t => { - this.constructor._styles = t; - this._style.innerHTML = t; - }); - } - }; - }; -}; diff --git a/module/config.mjs b/module/config.mjs index 56a0fb4..591fd84 100644 --- a/module/config.mjs +++ b/module/config.mjs @@ -34,10 +34,8 @@ export const skills = { export const defaultItemTier = `simple`; export const itemTiers = [ - { value: `simple`, label: `dotdungeon.rarity.simple` }, - { value: `greater`, label: `dotdungeon.rarity.greater` }, - { value: `rare`, label: `dotdungeon.rarity.rare` }, - { value: `legendary`, label: `dotdungeon.rarity.legendary` }, + `simple`, `greater`, + `rare`, `legendary` ]; export const syncMilestones = [ diff --git a/module/dialogs/DiceList.mjs b/module/dialogs/DiceList.mjs index 3c305c8..f9793de 100644 --- a/module/dialogs/DiceList.mjs +++ b/module/dialogs/DiceList.mjs @@ -12,7 +12,7 @@ export class DiceList extends GenericDialog { }; static get defaultOptions() { - const opts = foundry.utils.mergeObject({ + const opts = mergeObject({ ...super.defaultOptions, template: `systems/dotdungeon/templates/dialogs/diceList.hbs`, width: 275, diff --git a/module/dialogs/PopoutTextEditor.mjs b/module/dialogs/PopoutTextEditor.mjs new file mode 100644 index 0000000..fc74b62 --- /dev/null +++ b/module/dialogs/PopoutTextEditor.mjs @@ -0,0 +1,51 @@ +export class PopoutTextEditor extends FormApplication { + + /** + * Creates a form + */ + static create(value) {}; + + /** @override */ + constructor(actor, property, options = {}) { + super(actor, options); + this.property = property; + }; + + static get defaultOptions() { + const opts = mergeObject({ + ...super.defaultOptions, + title: `Rich Text Editor`, + template: `systems/dotdungeon/templates/dialogs/text-editor.hbs`, + width: 500, + height: 600, + submitOnClose: false, + resizable: true, + }); + return opts; + }; + + async getData() { + const ctx = await super.getData(); + + ctx.editor = { + engine: `prosemirror`, + collaborate: true, + content: await TextEditor.enrichHTML( + await getProperty(this.document, this.property), + { + relativeTo: this.object, + secrets: this.object.isOwner, + async: true + } + ), + target: this.property, + }; + + return ctx; + }; + + async _updateObject(_event, formData) { + console.log(formData); + this.document.update({ [this.property]: formData["text"] }) + }; +}; diff --git a/module/documents/ActiveEffect/GenericActiveEffect.mjs b/module/documents/ActiveEffect/GenericActiveEffect.mjs deleted file mode 100644 index 8ee70f3..0000000 --- a/module/documents/ActiveEffect/GenericActiveEffect.mjs +++ /dev/null @@ -1,7 +0,0 @@ -export class DotDungeonActiveEffect extends ActiveEffect { - - // Invert the logic of the disabled property so it's easier to modify via - // embedded controls - get enabled() { return !this.disabled }; - set enabled(newValue) { this.disabled = !newValue }; -}; diff --git a/module/documents/ActiveEffect/_proxy.mjs b/module/documents/ActiveEffect/_proxy.mjs deleted file mode 100644 index 4b51b54..0000000 --- a/module/documents/ActiveEffect/_proxy.mjs +++ /dev/null @@ -1,42 +0,0 @@ -import { DotDungeonActiveEffect } from "./GenericActiveEffect.mjs"; - -const classes = {}; - -const defaultClass = DotDungeonActiveEffect; - -export const ActiveEffectProxy = new Proxy(function () {}, { - construct(target, args) { - const [data] = args; - - if (!classes.hasOwnProperty(data.type)) { - return new defaultClass(...args); - } - - return new classes[data.type](...args); - }, - get(target, prop, receiver) { - - if (["create", "createDocuments"].includes(prop)) { - return function (data, options) { - if (data.constructor === Array) { - return data.map(i => ActiveEffectProxy.create(i, options)) - } - - if (!classes.hasOwnProperty(data.type)) { - return defaultClass.create(data, options); - } - - return classes[data.type].create(data, options); - }; - }; - - if (prop == Symbol.hasInstance) { - return function (instance) { - if (instance instanceof defaultClass) return true; - return Object.values(classes).some(i => instance instanceof i); - }; - }; - - return defaultClass[prop]; - }, -}); diff --git a/module/documents/Actor/GenericActor.mjs b/module/documents/Actor/GenericActor.mjs index 171af63..d52b185 100644 --- a/module/documents/Actor/GenericActor.mjs +++ b/module/documents/Actor/GenericActor.mjs @@ -1,15 +1,4 @@ export class DotDungeonActor extends Actor { - - /* - Using this to take a "snapshot" of the system data prior to applying AE's so - that the inputs can still have the non-modified value in them, while we still - provide all that data to AE's without needing to disable any inputs. - */ - prepareEmbeddedDocuments() { - this.preAE = foundry.utils.deepClone(this.system); - super.prepareEmbeddedDocuments(); - }; - async createEmbeddedItem(defaults, opts = {}) { let items = await this.createEmbeddedDocuments(`Item`, defaults); if (!Array.isArray(items)) items = items ? [items] : []; diff --git a/module/documents/Actor/Player.mjs b/module/documents/Actor/Player.mjs index 2c5840d..ff54481 100644 --- a/module/documents/Actor/Player.mjs +++ b/module/documents/Actor/Player.mjs @@ -1,22 +1,8 @@ import { DotDungeonActor } from "./GenericActor.mjs"; +import { DotDungeonItem } from "../Item/GenericItem.mjs"; export class Player extends DotDungeonActor { - applyActiveEffects() { - super.applyActiveEffects(); - - /* - These are the (groups of) fields that ActiveEffects may modify safely and - remain editable in the sheet. This needs to be done because of default - Foundry behaviour that otherwise prevents these fields from being edited. - The deletes must use optional chaining otherwise they can cause issues - during the document preparation lifecycle as an actor with no AE's affecting - anything in one of these areas will result in these paths being undefined. - */ - delete this.overrides.system?.stats; - delete this.overrides.system?.skills; - }; - async createCustomPet() { const body = new URLSearchParams({ number: 1, diff --git a/module/documents/Actor/Sync.mjs b/module/documents/Actor/Sync.mjs index 171a67c..1542b3e 100644 --- a/module/documents/Actor/Sync.mjs +++ b/module/documents/Actor/Sync.mjs @@ -1,5 +1,4 @@ import { DotDungeonActor } from "./GenericActor.mjs"; -import { syncMilestones } from "../../config.mjs"; export class Sync extends DotDungeonActor { async useRestDie() { diff --git a/module/documents/Item/GenericItem.mjs b/module/documents/Item/GenericItem.mjs index 786824e..b52ddcd 100644 --- a/module/documents/Item/GenericItem.mjs +++ b/module/documents/Item/GenericItem.mjs @@ -6,19 +6,13 @@ export class DotDungeonItem extends Item { }; get usedCapacity() { - if (!this.system.uses_inventory_slot) return 0; - if (!this.system.quantity_affects_used_capacity) { - return 1; + let capacity = 0; + if (this.system.uses_inventory_slot && this.system.quantity > 0) { + capacity = 1; }; - return this.system.quantity; - }; - - get availableLocations() { - return [ - { value: null, label: `dotdungeon.location.unknown` }, - { value: `inventory`, label: `dotdungeon.location.inventory` }, - { value: `equipped`, label: `dotdungeon.location.equipped` }, - { value: `storage`, label: `dotdungeon.location.storage` }, - ]; + if (this.system.quantity_affects_used_capacity) { + capacity = this.system.quantity; + }; + return capacity; }; }; diff --git a/module/documents/Item/Material.mjs b/module/documents/Item/Material.mjs index c6c5b72..15d2a58 100644 --- a/module/documents/Item/Material.mjs +++ b/module/documents/Item/Material.mjs @@ -5,11 +5,4 @@ export class Material extends DotDungeonItem { let affects = game.settings.get(`dotdungeon`, `materialsAffectCapacity`); return affects ? super.usedCapacity : 0; }; - - get availableLocations() { - return [ - { value: null, label: `dotdungeon.location.unknown` }, - { value: `inventory`, label: `dotdungeon.location.inventory` }, - ]; - }; }; diff --git a/module/dotdungeon.mjs b/module/dotdungeon.mjs index 8731314..b4c597f 100644 --- a/module/dotdungeon.mjs +++ b/module/dotdungeon.mjs @@ -10,7 +10,6 @@ import { SyncData } from "./models/Actor/Sync.mjs"; import { MobData } from "./models/Actor/Mob.mjs"; // Main Documents -import { ActiveEffectProxy } from "./documents/ActiveEffect/_proxy.mjs"; import { ActorProxy } from "./documents/Actor/_proxy.mjs"; import { ItemProxy } from "./documents/Item/_proxy.mjs"; @@ -33,15 +32,12 @@ import * as hbs from "./handlebars.mjs"; import "./hooks/hotReload.mjs"; // Misc Imports -import { registerCustomComponents } from "./components/index.mjs"; import loadSettings from "./settings/index.mjs"; -import { devInit } from "./hooks/devInit.mjs"; import DOTDUNGEON from "./config.mjs"; Hooks.once(`init`, async () => { console.debug(`.dungeon | Initializing`); - CONFIG.ActiveEffect.legacyTransferral = false; loadSettings(); @@ -57,7 +53,6 @@ Hooks.once(`init`, async () => { CONFIG.Item.dataModels.pet = PetItemData; CONFIG.Actor.documentClass = ActorProxy; CONFIG.Item.documentClass = ItemProxy; - CONFIG.ActiveEffect.documentClass = ActiveEffectProxy; CONFIG.DOTDUNGEON = DOTDUNGEON; @@ -106,13 +101,12 @@ Hooks.once(`init`, async () => { label: "dotdungeon.sheet-names.PetSheet" }); - if (true || game.settings.get(`dotdungeon`, `devMode`)) { - devInit(); - }; hbs.registerHandlebarsHelpers(); hbs.preloadHandlebarsTemplates(); - registerCustomComponents(); + + CONFIG.CACHE = {}; + CONFIG.CACHE.icons = await hbs.preloadIcons(); }); diff --git a/module/handlebars.mjs b/module/handlebars.mjs index cdaa1b7..596f9dd 100644 --- a/module/handlebars.mjs +++ b/module/handlebars.mjs @@ -30,19 +30,31 @@ export const partials = [ `actors/char-sheet/v2/partials/inventory/items/untyped.v2.pc.hbs`, `actors/char-sheet/v2/partials/inventory/items/aspect.v2.pc.hbs`, `actors/char-sheet/v2/partials/inventory/items/weapon.v2.pc.hbs`, - `actors/char-sheet/v2/partials/inventory/items/pet.v2.pc.hbs`, - - // The v2 Untyped sheet partials - `items/untyped/v2/tabs/general.v2.untyped.hbs`, - `items/untyped/v2/tabs/details.v2.untyped.hbs`, - `items/untyped/v2/tabs/effects.v2.untyped.hbs`, - `items/untyped/v2/tabs/settings.v2.untyped.hbs`, ]; export const preAliasedPartials = { "dotdungeon.pc.v2.foil": "actors/char-sheet/v2/partials/inventory/items/untyped.v2.pc.hbs", }; +export const icons = [ + `caret-right.svg`, + `caret-down.svg`, + `garbage-bin.svg`, + `chat-bubble.svg`, + `dice/d4.svg`, + `dice/d6.svg`, + `dice/d8.svg`, + `dice/d10.svg`, + `dice/d12.svg`, + `dice/d20.svg`, + `create.svg`, + `close.svg`, + `edit.svg`, + `sheet.svg`, + `minus.svg`, +]; + + export async function registerHandlebarsHelpers() { Handlebars.registerHelper(helpers); }; @@ -78,3 +90,38 @@ export async function preloadHandlebarsTemplates() { console.groupEnd(); return loadTemplates(paths); }; + +/** + * Loads all of the icons that are needed in the handlebars templating to make + * the sheet look nicer. + * + * @returns An object containing icon names to the corresponding HTML data for + * displaying the icon + */ +export async function preloadIcons() { + const pathPrefix = `systems/dotdungeon/assets/` + const parsedIcons = {}; + + for (const icon of icons) { + const iconName = icon.split(`/`).slice(-1)[0].slice(0, -4); + if (icon.endsWith(`.svg`)) { + try { + const response = await fetchWithTimeout(`${pathPrefix}${icon}`); + if (response.status !== 200) { continue }; + const svgData = await response.text(); + parsedIcons[iconName] = svgData; + } catch { + console.error(`.dungeon | Failed to fetch/parse icon: ${icon}`); + continue; + }; + } + else if (icon.endsWith(`.png`)) { + parsedIcons[iconName] = ``; + } + else { + console.warn(`.dungeon | Icon "${icon}" failed to be handled by a loader`) + }; + }; + + return parsedIcons; +}; diff --git a/module/helpers/index.mjs b/module/helpers/index.mjs index b48baa3..ee573e7 100644 --- a/module/helpers/index.mjs +++ b/module/helpers/index.mjs @@ -2,7 +2,7 @@ import { schemaOptions } from "./schemaOptions.mjs"; import { createArray } from "./createArray.mjs"; import { detailsExpanded } from "./detailsExpanded.mjs"; import { objectValue } from "./objectValue.mjs"; -import { handlebarsLocalizer, localizer } from "../utils/localizer.mjs"; +import { handlebarsLocalizer } from "../utils/localizer.mjs"; import { options } from "./options.mjs"; export default { @@ -19,7 +19,7 @@ export default { "dd-stringify": v => JSON.stringify(v, null, ` `), "dd-empty": v => v.length == 0, "dd-set-has": (s, k) => s.has(k), - "dd-empty-state": (v) => v ?? localizer(`dotdungeon.common.empty`), + "dd-empty-state": (v) => v ?? `--`, // Logic helpers "eq": (a, b) => a == b, diff --git a/module/hooks/devInit.mjs b/module/hooks/devInit.mjs deleted file mode 100644 index b7ef326..0000000 --- a/module/hooks/devInit.mjs +++ /dev/null @@ -1,27 +0,0 @@ -/* -Initialization of dev-specific features for the init hook, this is primarily -used to register all of the data sheets of various entity types. -*/ - -import { GroupDataSheet } from "../sheets/Datasheets/GroupDataSheet.mjs"; -import { UntypedDataSheet } from "../sheets/Datasheets/UntypedDataSheet.mjs"; - -export function devInit() { - Items.registerSheet( - `dotdungeon`, - UntypedDataSheet, - { - types: [`untyped`, `foil`], - label: `dotdungeon.sheet-names.*DataSheet`, - } - ); - - Actors.registerSheet( - `dotdungeon`, - GroupDataSheet, - { - types: [`sync`], - label: `dotdungeon.sheet-names.*DataSheet`, - } - ); -}; diff --git a/module/hooks/hotReload.mjs b/module/hooks/hotReload.mjs index 8c44a46..b183196 100644 --- a/module/hooks/hotReload.mjs +++ b/module/hooks/hotReload.mjs @@ -3,8 +3,8 @@ import * as hbs from "../handlebars.mjs"; const loaders = { svg(data) { const iconName = data.path.split(`/`).slice(-1)[0].slice(0, -4); - console.debug(`.dungeon | hot-reloading icon: ${iconName}`); - Hooks.call(`dd-hmr:svg`, iconName, data); + console.log(`.dungeon | hot-reloading icon: ${iconName}`); + CONFIG.CACHE.icons[iconName] = data.content; }, hbs(data) { if (!hbs.partials.some(p => data.path.endsWith(p))) { @@ -35,10 +35,6 @@ const loaders = { }, js() {window.location.reload()}, mjs() {window.location.reload()}, - css(data) { - console.debug(`.dungeon | Hot-reloading CSS: ${data.path}`); - Hooks.call(`dd-hmr:css`, data); - }, }; Hooks.on(`hotReload`, async (data) => { diff --git a/module/models/Actor/Player.mjs b/module/models/Actor/Player.mjs index 244c887..3d75709 100644 --- a/module/models/Actor/Player.mjs +++ b/module/models/Actor/Player.mjs @@ -1,3 +1,4 @@ +import { MappingField } from "../fields/MappingField.mjs"; import DOTDUNGEON from "../../config.mjs"; function diceChoiceField() { @@ -20,6 +21,22 @@ function trainingLevelField() { }); }; +function weaponDamageTypeField() { + return new foundry.data.fields.StringField({ + initial: ``, + blank: true, + options: [ ``, ...DOTDUNGEON.damageTypes ], + }); +}; + +function ammoTypeField() { + return new foundry.data.fields.StringField({ + initial: ``, + blank: true, + options: [ ``, ...DOTDUNGEON.ammoTypes ], + }); +}; + export class PlayerData extends foundry.abstract.TypeDataModel { static defineSchema() { const fields = foundry.data.fields; @@ -75,18 +92,65 @@ export class PlayerData extends foundry.abstract.TypeDataModel { piloting: trainingLevelField(), }) }), - // ! Delete + aspect: new fields.SchemaField({ + name: new fields.StringField({ blank: true, trim: true }), + description: new fields.StringField({ blank: true, trim: true }), + deactivateAfter: new fields.NumberField({ min: 0, integer: true}), + used: new fields.BooleanField(), + }), roles: new fields.SchemaField({ r1: new fields.StringField({ blank: true, trim: true }), r2: new fields.StringField({ blank: true, trim: true }), r3: new fields.StringField({ blank: true, trim: true }), r4: new fields.StringField({ blank: true, trim: true }), }), + weapon: new fields.SchemaField({ + mainHand: new fields.SchemaField({ + name: new fields.StringField({ initial: ``, blank: true, trim: true }), + damage: weaponDamageTypeField(), + ranged: new fields.BooleanField({ initial: false }), + scope: new fields.BooleanField({ initial: false }), + ammo: ammoTypeField(), + }), + offHand: new fields.SchemaField({ + name: new fields.StringField({ initial: ``, blank: true, trim: true }), + damage: weaponDamageTypeField(), + ranged: new fields.BooleanField({ initial: false }), + scope: new fields.BooleanField({ initial: false }), + ammo: ammoTypeField(), + }), + ammo: new fields.SchemaField({ + quivers: new fields.NumberField({ min: 0, max: 10, integer: true }), + mags: new fields.NumberField({ min: 0, max: 10, integer: true }), + cells: new fields.NumberField({ min: 0, max: 10, integer: true }), + }), + }), supplies: new fields.NumberField({ initial: 0, min: 0, integer: true }), + materials: new fields.NumberField({ + initial: 0, + min: 0, + integer: true + }), + pet: new fields.SchemaField({ + name: new fields.StringField(), + info: new fields.StringField(), + }), + transport: new fields.SchemaField({ + name: new fields.StringField(), + upkeep: new fields.NumberField({ min: 0, integer: true }), + info: new fields.StringField(), + }), + spells: new MappingField( + new fields.SchemaField({ + name: new fields.StringField({ initial: ``, blank: true, trim: true }), + cost: new fields.NumberField({ initial: 0, min: 0 }), + info: new fields.StringField({ initial: ``, blank: true, trim: true }), + }) + ), respawns: new fields.SchemaField({ r1: new fields.BooleanField(), r2: new fields.BooleanField(), @@ -97,6 +161,7 @@ export class PlayerData extends foundry.abstract.TypeDataModel { integer: true, initial: 0, }), + inventoryString: new fields.StringField({ blank: true, trim: true }), }; }; }; diff --git a/module/models/Item/Aspect.mjs b/module/models/Item/Aspect.mjs index 92b3eac..eb1ffed 100644 --- a/module/models/Item/Aspect.mjs +++ b/module/models/Item/Aspect.mjs @@ -10,7 +10,7 @@ export class AspectItemData extends DescribedItemData { delete parentSchema.quantity_affects_used_capacity; delete parentSchema.usage_cost; - return foundry.utils.mergeObject(parentSchema, { + return mergeObject(parentSchema, { used: new fields.BooleanField({ initial: false }), /** The number of seconds that the effect of the aspect stays */ deactivateAfter: new fields.NumberField({ nullable: true }), diff --git a/module/models/Item/CommonItemData.mjs b/module/models/Item/CommonItemData.mjs index 9e11800..82b72bf 100644 --- a/module/models/Item/CommonItemData.mjs +++ b/module/models/Item/CommonItemData.mjs @@ -31,19 +31,19 @@ export class CommonItemData extends foundry.abstract.TypeDataModel { tier: new fields.StringField({ initial: DOTDUNGEON.defaultItemTier, nullable: false, - choices: DOTDUNGEON.itemTiers.map(tier => tier.value), - }), - /* - If this property is set to true, the item will be shown in the combat tab - list of items. This is shown whether or not the item is marked as "equipped". - */ - combat_relevant: new fields.BooleanField({ - initial: false, - nullable: false, + choices: DOTDUNGEON.itemTiers, }), location: new fields.StringField({ - initial: "", - nullable: false, + initial: null, + nullable: true, + /* + "equipped" = on player, actively having an effect (e.g. armour + is worn, weapon is held), not all items have an equipped state + "inventory" = on player, equivalent to being put in a backpack + "storage" = not on player at all, in a chest in their house or + smth, these items should be displayed in the storage tab + */ + choices: ["equipped", "inventory", "storage"], }), }; }; diff --git a/module/models/Item/DescribedItemData.mjs b/module/models/Item/DescribedItemData.mjs index eb913a0..ebfce48 100644 --- a/module/models/Item/DescribedItemData.mjs +++ b/module/models/Item/DescribedItemData.mjs @@ -3,7 +3,7 @@ import { CommonItemData } from "./CommonItemData.mjs"; export class DescribedItemData extends CommonItemData { static defineSchema() { const fields = foundry.data.fields; - return foundry.utils.mergeObject(super.defineSchema(), { + return mergeObject(super.defineSchema(), { description: new fields.StringField({ initial: ``, blank: true, diff --git a/module/models/Item/Equipment.mjs b/module/models/Item/Equipment.mjs index 309fd3b..82b58de 100644 --- a/module/models/Item/Equipment.mjs +++ b/module/models/Item/Equipment.mjs @@ -3,6 +3,6 @@ import { DescribedItemData } from "./DescribedItemData.mjs"; export class EquipmentItemData extends DescribedItemData { static defineSchema() { const fields = foundry.data.fields; - return foundry.utils.mergeObject(super.defineSchema(), {}); + return mergeObject(super.defineSchema(), {}); }; }; diff --git a/module/models/Item/Pet.mjs b/module/models/Item/Pet.mjs index 34c6de5..7d46e94 100644 --- a/module/models/Item/Pet.mjs +++ b/module/models/Item/Pet.mjs @@ -3,13 +3,7 @@ import { DescribedItemData } from "./DescribedItemData.mjs"; export class PetItemData extends DescribedItemData { static defineSchema() { const fields = foundry.data.fields; - const parentSchema = super.defineSchema(); - - delete parentSchema.quantity; - delete parentSchema.quantity_affects_used_capacity; - delete parentSchema.usage_cost; - - return foundry.utils.mergeObject(parentSchema, { + return mergeObject(super.defineSchema(), { upkeep: new fields.NumberField({ initial: null, nullable: true }), pokeballd: new fields.BooleanField({ initial: true }), }); diff --git a/module/models/Item/Spell.mjs b/module/models/Item/Spell.mjs index f96381f..6bd90f6 100644 --- a/module/models/Item/Spell.mjs +++ b/module/models/Item/Spell.mjs @@ -4,7 +4,7 @@ import DOTDUNGEON from "../../config.mjs"; export class SpellItemData extends DescribedItemData { static defineSchema() { const fields = foundry.data.fields; - return foundry.utils.mergeObject(super.defineSchema(), { + return mergeObject(super.defineSchema(), { skill: new fields.StringField({ initial: ``, blank: true, diff --git a/module/models/Item/Weapon.mjs b/module/models/Item/Weapon.mjs index 20db6b7..5b9cf67 100644 --- a/module/models/Item/Weapon.mjs +++ b/module/models/Item/Weapon.mjs @@ -4,7 +4,7 @@ import DOTDUNGEON from "../../config.mjs"; export class WeaponItemData extends DescribedItemData { static defineSchema() { const fields = foundry.data.fields; - return foundry.utils.mergeObject(super.defineSchema(), { + return mergeObject(super.defineSchema(), { damage: new fields.StringField({ initial: null, nullable: true, diff --git a/module/models/template.mjs b/module/models/template.mjs index 77340ee..f3cea2a 100644 --- a/module/models/template.mjs +++ b/module/models/template.mjs @@ -3,7 +3,7 @@ import { DescribedItemData } from "./DescribedItemData.mjs"; export class TemplateData extends DescribedItemData { static defineSchema() { const fields = foundry.data.fields; - return foundry.utils.mergeObject(super.defineSchema(), { + return mergeObject(super.defineSchema(), { }); }; }; diff --git a/module/sheets/Actors/PC/PlayerSheetV2.mjs b/module/sheets/Actors/PC/PlayerSheetV2.mjs index ac1a378..63fe44a 100644 --- a/module/sheets/Actors/PC/PlayerSheetV2.mjs +++ b/module/sheets/Actors/PC/PlayerSheetV2.mjs @@ -2,11 +2,10 @@ import { GenericActorSheet } from "../../GenericActorSheet.mjs"; import DOTDUNGEON from "../../../config.mjs"; import { localizer } from "../../../utils/localizer.mjs"; import { modifierToString } from "../../../utils/modifierToString.mjs"; -import { GenericContextMenu } from "../../../utils/GenericContextMenu.mjs"; export class PlayerSheetv2 extends GenericActorSheet { static get defaultOptions() { - let opts = foundry.utils.mergeObject( + let opts = mergeObject( super.defaultOptions, { template: `systems/dotdungeon/templates/actors/char-sheet/v2/sheet.hbs`, @@ -26,7 +25,6 @@ export class PlayerSheetv2 extends GenericActorSheet { ], } ); - opts.classes.push(`style-v3`); return opts; }; @@ -39,8 +37,9 @@ export class PlayerSheetv2 extends GenericActorSheet { html.find(`.create-ae`).on(`click`, async ($e) => { console.debug(`Creating an ActiveEffect?`); - const ae = this.actor.createEmbeddedDocuments(`ActiveEffect`, [{name: "Default AE"}]); - ae.sheet.render(true); + ActiveEffect.implementation.create({ + name: "Default AE", + }, { parent: this.actor, renderSheet: true }); }); html.find(`[data-filter-toggle]`).on(`change`, ($e) => { const target = $e.delegateTarget; @@ -48,24 +47,6 @@ export class PlayerSheetv2 extends GenericActorSheet { this.toggleItemFilter(filter); this._renderInner(); }); - - // Make materials be able to be edited/deleted - new GenericContextMenu(html, `.material`, [ - { - name: localizer(`dotdungeon.common.edit`), - callback: (html) => { - const data = html[0].dataset; - this.openEmbeddedSheet.bind(this)(data.embeddedId); - }, - }, - { - name: localizer(`dotdungeon.common.delete`), - callback: (html) => { - const data = html[0].dataset; - this.genericEmbeddedDelete.bind(this)(data.embeddedId); - }, - }, - ]); }; async getData() { @@ -73,7 +54,6 @@ export class PlayerSheetv2 extends GenericActorSheet { /** @type {ActorHandler} */ const actor = this.actor; - ctx.preAE = actor.preAE; ctx.system = actor.system; ctx.flags = actor.flags; ctx.items = this.actor.itemTypes; @@ -97,7 +77,6 @@ export class PlayerSheetv2 extends GenericActorSheet { const stat = { key: statName, name: localizer(`dotdungeon.stat.${statName}`), - original: this.actor.preAE.stats[statName], value: this.actor.system.stats[statName], }; @@ -112,7 +91,7 @@ export class PlayerSheetv2 extends GenericActorSheet { return { value: die, label: localizer(`dotdungeon.die.${die}`, { stat: statName }), - disabled: usedDice.has(die) && this.actor.preAE.stats[statName] !== die, + disabled: usedDice.has(die) && this.actor.system.stats[statName] !== die, }; }) ]; @@ -128,9 +107,8 @@ export class PlayerSheetv2 extends GenericActorSheet { key: skill, name: game.i18n.format(`dotdungeon.skills.${skill}`), value, - original: this.actor.preAE.skills[statName][skill], formula: `1` + stat.value + modifierToString(value, { spaces: true }), - rollDisabled: this.actor.preAE.skills[statName][skill] === -1, + rollDisabled: value === -1, }); }; @@ -139,7 +117,7 @@ export class PlayerSheetv2 extends GenericActorSheet { return stats; }; - _itemTypesHidden = new Set([`armour`, `equipment`, `structure`, `service`]); + _itemTypesHidden = new Set([`pet`, `armour`, `equipment`, `structure`, `service`]); toggleItemFilter(filterName) { if (this._itemTypesHidden.has(filterName)) { this._itemTypesHidden.delete(filterName); @@ -169,4 +147,9 @@ export class PlayerSheetv2 extends GenericActorSheet { max: this.actor.system.inventory_slots, }; }; -} + + _updateObject(...args) { + console.log(args) + super._updateObject(...args); + }; +} \ No newline at end of file diff --git a/module/sheets/Datasheets/GroupDataSheet.mjs b/module/sheets/Datasheets/GroupDataSheet.mjs deleted file mode 100644 index 6c9527a..0000000 --- a/module/sheets/Datasheets/GroupDataSheet.mjs +++ /dev/null @@ -1,31 +0,0 @@ -export class GroupDataSheet extends ActorSheet { - static get defaultOptions() { - let opts = foundry.utils.mergeObject( - super.defaultOptions, - { - template: `systems/dotdungeon/templates/datasheets/actor/group.hbs`, - width: 200, - height: 275 - }, - ); - opts.classes.push(`dotdungeon`, `style-v3`); - return opts; - }; - - async getData() { - const ctx = {}; - - ctx.actor = this.actor; - ctx.system = this.actor.system; - - ctx.computed = { - milestones_hit_viewable: [...this.actor.system.milestones_hit.values()].join(`, `) - } - - ctx.meta = { - idp: this.actor.uuid, - }; - - return ctx; - }; -}; diff --git a/module/sheets/Datasheets/UntypedDataSheet.mjs b/module/sheets/Datasheets/UntypedDataSheet.mjs deleted file mode 100644 index c3d7702..0000000 --- a/module/sheets/Datasheets/UntypedDataSheet.mjs +++ /dev/null @@ -1,27 +0,0 @@ -export class UntypedDataSheet extends ItemSheet { - static get defaultOptions() { - let opts = foundry.utils.mergeObject( - super.defaultOptions, - { - template: `systems/dotdungeon/templates/datasheets/untyped.hbs`, - width: 650, - height: 700 - }, - ); - opts.classes.push(`dotdungeon`, `style-v3`); - return opts; - }; - - async getData() { - const ctx = {}; - - ctx.item = this.item; - ctx.system = this.item.system; - - ctx.meta = { - idp: this.item.uuid, - }; - - return ctx; - }; -}; diff --git a/module/sheets/GenericActorSheet.mjs b/module/sheets/GenericActorSheet.mjs index 2010304..660233e 100644 --- a/module/sheets/GenericActorSheet.mjs +++ b/module/sheets/GenericActorSheet.mjs @@ -3,7 +3,7 @@ import DOTDUNGEON from "../config.mjs"; export class GenericActorSheet extends ActorSheet { static get defaultOptions() { - let opts = foundry.utils.mergeObject( + let opts = mergeObject( super.defaultOptions, { scrollY: [`.scrollable`], @@ -40,7 +40,7 @@ export class GenericActorSheet extends ActorSheet { ctx.actor = this.actor; ctx.config = DOTDUNGEON; - ctx.icons = {}; + ctx.icons = CONFIG.CACHE.icons; return ctx; }; @@ -52,17 +52,6 @@ export class GenericActorSheet extends ActorSheet { if (!this.isEditable) return; console.debug(`.dungeon | Generic sheet adding listeners`); - /* - Custom element event listeners because Foundry doesn't listen to them by - default. - */ - html.find( - CONFIG.CACHE.componentListeners.map(n => `${n}[name]`).join(`,`) - ).on(`change`, () => this._onChangeInput.bind(this)); - - /* - Utility event listeners that apply - */ html.find(`[data-collapse-id]`).on(`click`, this._handleSummaryToggle.bind(this)); html.find(`[data-roll-formula]`).on(`click`, this._handleRoll.bind(this)); html.find(`[data-embedded-update-on="change"]`) @@ -70,19 +59,13 @@ export class GenericActorSheet extends ActorSheet { html.find(`[data-embedded-update-on="blur"]`) .on(`blur`, this.genericEmbeddedUpdate.bind(this)); html.find(`[data-embedded-delete]`) - .on(`click`, ($e) => { - const id = $e.currentTarget.dataset.embeddedDelete; - this.genericEmbeddedDelete.bind(this)(id); - }); + .on(`click`, this.genericEmbeddedDelete.bind(this)); html.find(`[data-embedded-create]`) .on(`click`, this.genericEmbeddedCreate.bind(this)); html.find(`[data-message-type]`) .on(`click`, this.genericSendToChat.bind(this)); html.find(`[data-embedded-edit]`) - .on(`click`, ($e) => { - const id = $e.currentTarget.dataset.embeddedEdit; - this.openEmbeddedSheet.bind(this)(id); - }) + .on(`click`, this.openEmbeddedSheet.bind(this)); html.find(`button[data-increment]`) .on(`click`, this._incrementValue.bind(this)); html.find(`button[data-decrement]`) @@ -146,8 +129,10 @@ export class GenericActorSheet extends ActorSheet { }; }; - async openEmbeddedSheet(item_id) { - let item = await fromUuid(item_id); + async openEmbeddedSheet($event) { + const data = $event.currentTarget.dataset; + let item = await fromUuid(data.embeddedEdit); + console.log(data) item?.sheet.render(true); }; @@ -201,8 +186,9 @@ export class GenericActorSheet extends ActorSheet { await item?.update({ [data.embeddedDecrement]: value - 1 }); }; - async genericEmbeddedDelete(item_uuid) { - let item = await fromUuid(item_uuid); + async genericEmbeddedDelete($event) { + let data = $event.currentTarget.dataset; + let item = await fromUuid(data.embeddedId); if (!item) { ui.notifications.error( diff --git a/module/sheets/Items/AspectSheet.mjs b/module/sheets/Items/AspectSheet.mjs index 2bf8638..c43a01c 100644 --- a/module/sheets/Items/AspectSheet.mjs +++ b/module/sheets/Items/AspectSheet.mjs @@ -2,7 +2,7 @@ import { GenericItemSheet } from "./GenericItemSheet.mjs"; export class AspectSheet extends GenericItemSheet { static get defaultOptions() { - let opts = foundry.utils.mergeObject( + let opts = mergeObject( super.defaultOptions, { template: `systems/dotdungeon/templates/items/aspect.hbs`, diff --git a/module/sheets/Items/GenericItemSheet.mjs b/module/sheets/Items/GenericItemSheet.mjs index 936bd6c..ab67779 100644 --- a/module/sheets/Items/GenericItemSheet.mjs +++ b/module/sheets/Items/GenericItemSheet.mjs @@ -1,4 +1,3 @@ -import { DialogManager } from "../../utils/DialogManager.mjs"; import DOTDUNGEON from "../../config.mjs"; export class GenericItemSheet extends ItemSheet { @@ -11,6 +10,13 @@ export class GenericItemSheet extends ItemSheet { `resourcesOrSupplies`, ]; + activateListeners(html) { + super.activateListeners(html); + + if (!this.isEditable) return; + console.debug(`.dungeon | Adding event listeners for Generic Item: ${this.id}`); + }; + async getData() { const ctx = {}; @@ -30,57 +36,10 @@ export class GenericItemSheet extends ItemSheet { ctx.item = this.item; ctx.system = this.item.system; ctx.flags = this.item.flags; - ctx.effects = this.item.effects; ctx.config = DOTDUNGEON; - ctx.icons = {}; + ctx.icons = CONFIG.CACHE.icons; return ctx; }; - - activateListeners(html) { - super.activateListeners(html); - - if (!this.isEditable) return; - console.debug(`.dungeon | Adding event listeners for Generic Item: ${this.id}`); - html.find(`button[data-increment]`) - .on(`click`, this._incrementValue.bind(this)); - html.find(`button[data-decrement]`) - .on(`click`, this._decrementValue.bind(this)); - - - html.find(`[data-help-id]`) - .on(`click`, this._helpPopup.bind(this)); - }; - - async _incrementValue($e) { - const target = $e.currentTarget; - const data = target.dataset; - const value = getProperty(this.actor, data.increment); - if (typeof value != "number") { - return; - }; - this.actor.update({ [data.increment]: value + 1 }); - }; - - async _decrementValue($e) { - const target = $e.currentTarget; - const data = target.dataset; - const value = getProperty(this.actor, data.decrement); - if (typeof value != "number") { - return; - }; - this.actor.update({ [data.decrement]: value - 1 }); - }; - - async _helpPopup($e) { - const target = $e.currentTarget; - const data = target.dataset; - if (!data.helpId) return; - DialogManager.helpDialog( - data.helpId, - data.helpContent, - data.helpTitle - ); - }; }; diff --git a/module/sheets/Items/PetSheet.mjs b/module/sheets/Items/PetSheet.mjs index a2db3b9..169516c 100644 --- a/module/sheets/Items/PetSheet.mjs +++ b/module/sheets/Items/PetSheet.mjs @@ -2,7 +2,7 @@ import { GenericItemSheet } from "./GenericItemSheet.mjs"; export class PetSheet extends GenericItemSheet { static get defaultOptions() { - let opts = foundry.utils.mergeObject( + let opts = mergeObject( super.defaultOptions, { template: `systems/dotdungeon/templates/items/pet.hbs`, diff --git a/module/sheets/Items/SpellSheet.mjs b/module/sheets/Items/SpellSheet.mjs index 8e92831..cabf2db 100644 --- a/module/sheets/Items/SpellSheet.mjs +++ b/module/sheets/Items/SpellSheet.mjs @@ -2,7 +2,7 @@ import { GenericItemSheet } from "./GenericItemSheet.mjs"; export class SpellSheet extends GenericItemSheet { static get defaultOptions() { - let opts = foundry.utils.mergeObject( + let opts = mergeObject( super.defaultOptions, { template: `systems/dotdungeon/templates/items/spell.hbs`, diff --git a/module/sheets/Items/UntypedItemSheet.mjs b/module/sheets/Items/UntypedItemSheet.mjs index 5ae0f24..f1562c9 100644 --- a/module/sheets/Items/UntypedItemSheet.mjs +++ b/module/sheets/Items/UntypedItemSheet.mjs @@ -1,116 +1,21 @@ -import { GenericContextMenu } from "../../utils/GenericContextMenu.mjs"; -import { DialogManager } from "../../utils/DialogManager.mjs"; import { GenericItemSheet } from "./GenericItemSheet.mjs"; -import { localizer } from "../../utils/localizer.mjs"; export class UntypedItemSheet extends GenericItemSheet { static get defaultOptions() { - let opts = foundry.utils.mergeObject( + let opts = mergeObject( super.defaultOptions, { - template: `systems/dotdungeon/templates/items/untyped/v2/index.hbs`, - width: 300, + template: `systems/dotdungeon/templates/items/custom.hbs`, + width: 280, height: 340, - tabs: [ - { - group: `page`, - navSelector: `nav.page`, - contentSelector: `.page-content`, - initial: `general`, - }, - ], } ); - opts.classes.push(`dotdungeon`, `style-v3`); + opts.classes.push(`dotdungeon`); return opts; }; - activateListeners(html) { - super.activateListeners(html); - - new GenericContextMenu(html, `.photo.panel`, [ - { - name: localizer(`dotdungeon.common.view-larger`), - callback: () => { - (new ImagePopout(this.item.img)).render(true); - }, - }, - { - name: localizer(`dotdungeon.common.edit`), - condition: () => this.isEditable, - callback: () => { - const fp = new FilePicker({ - callback: (path) => { - this.item.update({"img": path}); - }, - }); - fp.render(true); - }, - }, - { - name: localizer(`dotdungeon.common.reset`), - condition: () => this.isEditable, - callback: () => { - console.log(`.dungeon | Reset Item Image`) - }, - } - ]); - - if (!this.isEditable) return; - console.debug(`.dungeon | Adding event listeners for Untyped Item: ${this.item.id}`); - - html.find(`.create-ae`).on(`click`, async () => { - await this.item.createEmbeddedDocuments( - `ActiveEffect`, - [{name: localizer(`dotdungeon.default.name`, { document: `ActiveEffect`, type: `base` })}], - { renderSheet: true } - ); - }); - - new GenericContextMenu(html, `.effect.panel`, [ - { - name: localizer(`dotdungeon.common.edit`), - callback: async (html) => { - (await fromUuid(html.closest(`.effect`)[0].dataset.embeddedId))?.sheet.render(true); - }, - }, - { - name: localizer(`dotdungeon.common.delete`), - callback: async (html) => { - const target = html.closest(`.effect`)[0]; - const data = target.dataset; - const id = data.embeddedId; - const doc = await fromUuid(id); - DialogManager.createOrFocus( - `${doc.uuid}-delete`, - { - title: localizer(`dotdungeon.delete.ActiveEffect.title`, doc), - content: localizer(`dotdungeon.delete.ActiveEffect.content`, doc), - buttons: { - yes: { - label: localizer(`Yes`), - callback() { - doc.delete(); - }, - }, - no: { - label: localizer(`No`), - } - } - } - ); - }, - } - ]); - }; - async getData() { const ctx = await super.getData(); - - ctx.meta.showSettingsTab = ctx.isGM || this.item.isOwned; - ctx.meta.isEmbedded = this.item.isOwned; - ctx.meta.isEditable = this.isEditable; - return ctx; }; }; diff --git a/module/sheets/MVPPCSheet.mjs b/module/sheets/MVPPCSheet.mjs index a5f05f5..3572b25 100644 --- a/module/sheets/MVPPCSheet.mjs +++ b/module/sheets/MVPPCSheet.mjs @@ -5,7 +5,7 @@ export class MVPPCSheet extends GenericActorSheet { /** @override {ActorHandler} actor */ static get defaultOptions() { - let opts = foundry.utils.mergeObject( + let opts = mergeObject( super.defaultOptions, { template: `systems/dotdungeon/templates/actors/char-sheet-mvp/sheet.hbs` diff --git a/module/sheets/MobSheet.mjs b/module/sheets/MobSheet.mjs index b2f2213..cb6412c 100644 --- a/module/sheets/MobSheet.mjs +++ b/module/sheets/MobSheet.mjs @@ -1,9 +1,10 @@ import { GenericActorSheet } from "./GenericActorSheet.mjs"; import { DiceList } from "../dialogs/DiceList.mjs"; +import { PopoutTextEditor } from "../dialogs/PopoutTextEditor.mjs"; export class MobSheet extends GenericActorSheet { static get defaultOptions() { - let opts = foundry.utils.mergeObject( + let opts = mergeObject( super.defaultOptions, { template: `systems/dotdungeon/templates/actors/mobs/main.hbs`, @@ -27,6 +28,14 @@ export class MobSheet extends GenericActorSheet { let d = new DiceList(this.actor); d.render(true); }); + html.find(`[data-text-editor]`) + .on(`click`, () => { + let editor = new PopoutTextEditor( + this.actor, + `system.description` + ); + editor.render(true); + }); }; async getData() { diff --git a/module/sheets/SyncVariations/AbstractSyncSheet.mjs b/module/sheets/SyncVariations/AbstractSyncSheet.mjs index 80e372b..53bfdf1 100644 --- a/module/sheets/SyncVariations/AbstractSyncSheet.mjs +++ b/module/sheets/SyncVariations/AbstractSyncSheet.mjs @@ -2,7 +2,7 @@ import { GenericActorSheet } from "../GenericActorSheet.mjs"; export class AbstractSyncSheet extends GenericActorSheet { static get defaultOptions() { - let opts = foundry.utils.mergeObject( + let opts = mergeObject( super.defaultOptions, { width: 200, diff --git a/module/utils/DialogManager.mjs b/module/utils/DialogManager.mjs deleted file mode 100644 index 7c40407..0000000 --- a/module/utils/DialogManager.mjs +++ /dev/null @@ -1,83 +0,0 @@ -import { localizer } from "./localizer.mjs"; - -/** - * A utility class that allows managing Dialogs that are created for various - * purposes such as deleting items, help popups, etc. This is a singleton class - * that upon instantiating after the first time will just return the first instance - */ -export class DialogManager { - - /** @type {Map} */ - static #dialogs = new Map(); - - /** - * Focuses a dialog if it already exists, or creates a new one and renders it. - * - * @param {string} dialogId The ID to associate with the dialog, should be unique - * @param {object} data The data to pass to the Dialog constructor - * @param {DialogOptions} opts The options to pass to the Dialog constructor - * @returns {Dialog} The Dialog instance - */ - static async createOrFocus(dialogId, data, opts = {}) { - if (DialogManager.#dialogs.has(dialogId)) { - const dialog = DialogManager.#dialogs.get(dialogId); - dialog.bringToTop(); - return dialog; - }; - - /* - This makes sure that if I provide a close function as a part of the data, - that the dialog still gets removed from the set once it's closed, otherwise - it could lead to dangling references that I don't care to keep. Or if I don't - provide the close function, it just sets the function as there isn't anything - extra that's needed to be called. - */ - if (data?.close) { - const provided = data.close; - data.close = () => { - DialogManager.#dialogs.delete(dialogId); - provided(); - }; - } - else { - data.close = () => DialogManager.#dialogs.delete(dialogId); - }; - - // Create the Dialog with the modified data - const dialog = new Dialog(data, opts); - DialogManager.#dialogs.set(dialogId, dialog); - dialog.render(true); - return dialog; - }; - - /** - * Closes a dialog if it is rendered - * - * @param {string} dialogId The ID of the dialog to close - */ - static async close(dialogId) { - const dialog = DialogManager.#dialogs.get(dialogId); - dialog?.close(); - }; - - static async helpDialog( - helpId, - helpContent, - helpTitle = `dotdungeon.common.help`, - localizationData = {}, - ) { - DialogManager.createOrFocus( - helpId, - { - title: localizer(helpTitle, localizationData), - content: localizer(helpContent, localizationData), - buttons: {}, - }, - { resizable: true, } - ); - }; - - static get size() { - return DialogManager.#dialogs.size; - } -}; diff --git a/module/utils/GenericContextMenu.mjs b/module/utils/GenericContextMenu.mjs deleted file mode 100644 index 9749b4f..0000000 --- a/module/utils/GenericContextMenu.mjs +++ /dev/null @@ -1,6 +0,0 @@ -export class GenericContextMenu extends ContextMenu { - constructor(element, selector, menuItems, opts = {}) { - super(element, selector, menuItems, opts); - this.menuItems.forEach(i => i.icon ??= ``); - }; -}; diff --git a/module/utils/localizer.mjs b/module/utils/localizer.mjs index 7cfebb0..550c1cb 100644 --- a/module/utils/localizer.mjs +++ b/module/utils/localizer.mjs @@ -18,20 +18,12 @@ export function localizer(key, args = {}, depth = 0) { return localized; }; - /* - Helps prevent recursion on the same key so that we aren't doing excess work. - */ - const localizedSubkeys = new Map(); for (const match of subkeys) { const subkey = match.groups.key; - if (localizedSubkeys.has(subkey)) continue; - localizedSubkeys.set(subkey, localizer(subkey, args, depth + 1)); + localized = + localized.slice(0, match.index) + + localizer(subkey, args, depth + 1) + + localized.slice(match.index + subkey.length + 1) }; - - return localized.replace( - localizerConfig.subKeyPattern, - (_fullMatch, subkey) => { - return localizedSubkeys.get(subkey); - } - ); + return localized; }; diff --git a/styles/dialog/DiceList.scss b/styles/dialog/DiceList.scss index c7833bc..469539e 100644 --- a/styles/dialog/DiceList.scss +++ b/styles/dialog/DiceList.scss @@ -1,9 +1,9 @@ -.dotdungeon:not(.style-v3):has(.dialog--dice-list) { +.dotdungeon:has(.dialog--dice-list) { max-width: 275px; min-width: 275px; } -.dotdungeon:not(.style-v3) .dialog--dice-list { +.dotdungeon .dialog--dice-list { padding: 8px; .dice { diff --git a/styles/dialog/text-editor.scss b/styles/dialog/text-editor.scss new file mode 100644 index 0000000..1c581c6 --- /dev/null +++ b/styles/dialog/text-editor.scss @@ -0,0 +1,5 @@ +.dialog--text-editor { + [role="application"] { + height: 100%; + } +} \ No newline at end of file diff --git a/styles/generic.scss b/styles/generic.scss index 92cfb3e..00a474a 100644 --- a/styles/generic.scss +++ b/styles/generic.scss @@ -8,7 +8,7 @@ Enabling scrollbar customization on a per-sheet basis, with a relatively low specificity to allow easier overriding without artificially increasing it. */ -.dotdungeon:not(.style-v3) { +.dotdungeon { --scrollbar-width: 5px; --scrollbar-handle-color: #782e22; --scrollbar-handle-border-color: var(--color-border-highlight); @@ -24,7 +24,7 @@ specificity to allow easier overriding without artificially increasing it. } // Reset the parts of Foundry's styling which gets in the way of what I want -.dotdungeon:not(.style-v3) > .window-content { +.dotdungeon > .window-content { h2, h3, h4, h5, h6 { @include fvtt_reset; @@ -74,7 +74,7 @@ specificity to allow easier overriding without artificially increasing it. } // Styling that doesn't belong to any particular part of my sheet -.dotdungeon.dotdungeon.dotdungeon.dotdungeon:not(.style-v3) { +.dotdungeon.dotdungeon.dotdungeon.dotdungeon { container-type: size; > .window-content { diff --git a/styles/global/buttons.scss b/styles/global/buttons.scss index 77531b3..0159a03 100644 --- a/styles/global/buttons.scss +++ b/styles/global/buttons.scss @@ -2,7 +2,7 @@ @use "sass:color" as color; -.dotdungeon.dotdungeon:not(.style-v3) > .window-content { +.dotdungeon.dotdungeon > .window-content { button { border-radius: 4px; box-sizing: border-box; diff --git a/styles/global/design-v2.scss b/styles/global/design-v2.scss index 5c22fe1..e9985a1 100644 --- a/styles/global/design-v2.scss +++ b/styles/global/design-v2.scss @@ -1,5 +1,5 @@ -.item--custom:not(.style-v3), -.actor--mob:not(.style-v3) { +.item--custom, +.actor--mob { input { border: 2px solid black; background: none; diff --git a/styles/global/icons.scss b/styles/global/icons.scss index 3d62ada..500ebca 100644 --- a/styles/global/icons.scss +++ b/styles/global/icons.scss @@ -1,6 +1,6 @@ $iconSizes: 12, 14, 16, 18, 20, 22, 24; -.dotdungeon.dotdungeon.dotdungeon.dotdungeon:not(.style-v3) { +.dotdungeon.dotdungeon.dotdungeon.dotdungeon { .icon { display: inline-flex; justify-content: center; @@ -14,4 +14,4 @@ $iconSizes: 12, 14, 16, 18, 20, 22, 24; }; } } -} +} \ No newline at end of file diff --git a/styles/mixins/_partials.scss b/styles/mixins/_partials.scss index e006802..8932b3e 100644 --- a/styles/mixins/_partials.scss +++ b/styles/mixins/_partials.scss @@ -18,9 +18,9 @@ @mixin sub-nav($parent, $group, $display) { nav.#{$group} { @include material.elevate(1); - display: none !important; + display: none; } &:has(nav.#{$parent} .active[data-tab="#{$group}"]) nav.#{$group} { - display: #{$display} !important; + display: #{$display}; } } diff --git a/styles/root.scss b/styles/root.scss index 8ff6cdf..65c8cd5 100644 --- a/styles/root.scss +++ b/styles/root.scss @@ -9,6 +9,7 @@ @use "./global/design-v2.scss"; @use "./dialog/DiceList.scss"; +@use "./dialog/text-editor.scss"; @use "./sheets/partials/stat.scss"; @use "./sheets/partials/skill.scss"; @@ -21,8 +22,4 @@ @use "./sheets/items/custom.scss"; @use "./sheets/items/aspect.scss"; @use "./sheets/items/spell.scss"; -@use "./sheets/items/pet.scss"; - -/* NEW BETTER SCOPED CSS ONLY BELOW HERE */ - -@use "./v3/index.scss"; \ No newline at end of file +@use "./sheets/items/pet.scss"; \ No newline at end of file diff --git a/styles/sheets/actor/char-sheet/v2/pages/inventory.scss b/styles/sheets/actor/char-sheet/v2/pages/inventory.scss index 57626fd..8581328 100644 --- a/styles/sheets/actor/char-sheet/v2/pages/inventory.scss +++ b/styles/sheets/actor/char-sheet/v2/pages/inventory.scss @@ -49,11 +49,11 @@ &__list { &--material { display: grid; - grid-template-columns: repeat(2, minmax(0, 1fr)); + grid-template-columns: 1fr 1fr; gap: 8px; } - &--untyped, &--aspect, &--foil, &--weapon, &--pet { + &--untyped, &--aspect { display: flex; gap: 8px; flex-direction: column; @@ -68,7 +68,7 @@ .bytes-panel { display: grid; - grid-template-columns: 1fr auto; + grid-template-columns: 1fr min-content 50px min-content; gap: 8px; align-items: center; @@ -164,8 +164,8 @@ @include material.elevate(1); padding: 8px; gap: 8px; - display: flex; - justify-content: space-between; + display: grid; + grid-template-columns: 1fr min-content 50px min-content; align-items: center; border-radius: 4px; @@ -218,7 +218,7 @@ } } - .untyped, .aspect, .weapon, .pet { + .untyped, .aspect, .weapon { @include material.elevate(1); padding: 8px; border-radius: 4px; diff --git a/styles/sheets/actor/mob/mob.scss b/styles/sheets/actor/mob/mob.scss index 11634b2..fd3e063 100644 --- a/styles/sheets/actor/mob/mob.scss +++ b/styles/sheets/actor/mob/mob.scss @@ -1,7 +1,7 @@ @use "../../../vars" as *; @use "avatar" as *; -.dotdungeon:not(.style-v3) .actor--mob { +.dotdungeon .actor--mob { --gap: 8px; --avatar-size: 100px; --row-height: calc((var(--avatar-size) - var(--gap)) / 2); diff --git a/styles/sheets/actor/mob/v2.scss b/styles/sheets/actor/mob/v2.scss deleted file mode 100644 index d7f0a5c..0000000 --- a/styles/sheets/actor/mob/v2.scss +++ /dev/null @@ -1,123 +0,0 @@ -@use "../../../vars" as *; -@use "avatar" as *; - -.dotdungeon:not(.style-v3) .actor--mob2 { - --gap: 8px; - --avatar-size: 100px; - --row-height: calc((var(--avatar-size) - var(--gap)) / 2); - padding: var(--gap); - display: grid; - grid-template-columns: var(--avatar-size) repeat(2, minmax(0, 1fr)); - grid-template-rows: repeat(5, var(--row-height)) minmax(var(--row-height), 1fr); - gap: var(--gap); - grid-template-areas: - "avatar . ." - "avatar . ." - "dice tabs tabs" - "dice tabs tabs" - "dice tabs tabs" - "dice tabs tabs"; - - label, .dice { - border: 2px solid black; - border-radius: 4px; - gap: 4px; - padding: 4px; - } - - input.masked { - border: 2px solid black; - background: none; - box-shadow: none; - &:focus { - transform: scale(102%); - } - } - - label.mask-input { - display: flex; - flex-direction: row; - align-items: center; - transition: all ease-in-out 50ms; - - &:focus-within { - transform: scale(102%); - } - - input { - text-align: right; - border: none; - background: none; - border-radius: 0; - border-bottom: 1px solid black; - &:focus, &:focus-visible { - box-shadow: none; - } - } - - input.left { - text-align: left; - } - } - - .wide { - grid-column: span 2; - } - - .mask-textarea { - display: flex; - flex-direction: column; - transition: all ease-in-out 50ms; - - &:focus-within { - transform: scale(102%); - } - - textarea { - flex-grow: 1; - resize: none; - border: none; - box-shadow: none; - background: none; - } - } - .name { - height: 100%; - font-size: 1.5rem; - input { - height: 100%; - } - } - - .dice { - grid-area: dice; - display: flex; - flex-direction: column; - - .die { - display: flex; - flex-direction: row; - width: 100%; - border: 2px solid black; - border-radius: 4px; - - .formula { - flex-grow: 1; - align-self: center; - } - } - } - - .tabs { grid-area: tabs; } - .stunts { - grid-area: stunts; - } - .description { - grid-area: description; - } - - .avatar { - @include avatar; - border-radius: 4px; - } -} \ No newline at end of file diff --git a/styles/sheets/actor/mvp.scss b/styles/sheets/actor/mvp.scss index 4193a24..087e744 100644 --- a/styles/sheets/actor/mvp.scss +++ b/styles/sheets/actor/mvp.scss @@ -1,7 +1,7 @@ @use "../../vars.scss" as *; @use "../../mixins/breakpoints" as *; -.dotdungeon:not(.style-v3) .actor--pc-mvp { +.dotdungeon .actor--pc-mvp { display: grid; grid-template-areas: "profile stats stats" @@ -270,7 +270,7 @@ @include bp-m { - .dotdungeon:not(.style-v3) { + .dotdungeon { .actor--pc-mvp { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(15, min-content); @@ -310,7 +310,7 @@ } @include bp-s { - .dotdungeon:not(.style-v3) { + .dotdungeon { .actor--pc-mvp { grid-template-columns: 1fr; grid-template-rows: repeat(12, min-content); diff --git a/styles/sheets/actor/sync/basic.scss b/styles/sheets/actor/sync/basic.scss index 904d093..6f412be 100644 --- a/styles/sheets/actor/sync/basic.scss +++ b/styles/sheets/actor/sync/basic.scss @@ -1,6 +1,6 @@ @use "../../../mixins/breakpoints" as *; -:not(.style-v3).dotdungeon { +.dotdungeon { .actor--basic-sync { display: flex; justify-content: center; @@ -52,7 +52,7 @@ } @include bp-xs { - :not(.style-v3).dotdungeon { + .dotdungeon { &--sync-sheet { header { .configure-sheet { diff --git a/styles/sheets/items/aspect.scss b/styles/sheets/items/aspect.scss index 8f355fe..2461b9b 100644 --- a/styles/sheets/items/aspect.scss +++ b/styles/sheets/items/aspect.scss @@ -1,6 +1,6 @@ @use "../../vars" as *; -.dotdungeon:not(.style-v3) .item--aspect { +.dotdungeon .item--aspect { padding: 4px; input[type=text] { diff --git a/styles/sheets/items/custom.scss b/styles/sheets/items/custom.scss index 9c5bc96..0899a91 100644 --- a/styles/sheets/items/custom.scss +++ b/styles/sheets/items/custom.scss @@ -1,4 +1,4 @@ -.item--custom:not(.style-v3) { +.item--custom { padding: 8px; display: grid; grid-template-columns: 1fr 1fr; diff --git a/styles/sheets/items/pet.scss b/styles/sheets/items/pet.scss index 10e4d51..8cfc8e5 100644 --- a/styles/sheets/items/pet.scss +++ b/styles/sheets/items/pet.scss @@ -1,6 +1,6 @@ @use "../../vars" as *; -.dotdungeon:not(.style-v3) .item--pet { +.dotdungeon .item--pet { padding: 4px; input[type=text] { diff --git a/styles/sheets/items/spell.scss b/styles/sheets/items/spell.scss index 8d4405f..21ba81b 100644 --- a/styles/sheets/items/spell.scss +++ b/styles/sheets/items/spell.scss @@ -1,6 +1,6 @@ @use "../../vars" as *; -.dotdungeon:not(.style-v3) .item--spell { +.dotdungeon .item--spell { padding: 4px; input[type=text] { diff --git a/styles/sheets/partials/panel.scss b/styles/sheets/partials/panel.scss index 2ebf74c..eb77497 100644 --- a/styles/sheets/partials/panel.scss +++ b/styles/sheets/partials/panel.scss @@ -2,7 +2,7 @@ @use "../../mixins/foundry" as *; @use "../../vars" as *; -.dotdungeon:not(.style-v3) .actor--pc-mvp .panel { +.dotdungeon .actor--pc-mvp .panel { display: grid; grid-template-rows: min-content 1fr; @@ -39,7 +39,7 @@ } @include bp-s { - .dotdungeon:not(.style-v3) .panel__header .icon { + .dotdungeon .panel__header .icon { display: none; visibility: hidden; } diff --git a/styles/sheets/partials/skill.scss b/styles/sheets/partials/skill.scss index 6034e86..40b43de 100644 --- a/styles/sheets/partials/skill.scss +++ b/styles/sheets/partials/skill.scss @@ -1,4 +1,4 @@ -.dotdungeon:not(.style-v3) .skill { +.dotdungeon .skill { display: flex; flex-direction: row; justify-content: center; diff --git a/styles/sheets/partials/stat.scss b/styles/sheets/partials/stat.scss index 0cfbe76..1937854 100644 --- a/styles/sheets/partials/stat.scss +++ b/styles/sheets/partials/stat.scss @@ -1,4 +1,4 @@ -.dotdungeon:not(.style-v3) .actor--pc-mvp .stat { +.dotdungeon .actor--pc-mvp .stat { display: flex; flex-direction: column; align-items: center; diff --git a/styles/v3/components/common.scss b/styles/v3/components/common.scss deleted file mode 100644 index 59f812d..0000000 --- a/styles/v3/components/common.scss +++ /dev/null @@ -1,7 +0,0 @@ -// Disclaimer: This CSS is used by a custom web component and is scoped to JUST -// the corresponding web component. This should only be imported by web component -// style files. - -:host { - display: inline-block; -} diff --git a/styles/v3/components/icon.scss b/styles/v3/components/icon.scss deleted file mode 100644 index 012593f..0000000 --- a/styles/v3/components/icon.scss +++ /dev/null @@ -1,23 +0,0 @@ -/* -Disclaimer: This CSS is used by a custom web component and is scoped to JUST -the corresponding web component. Importing this into other files is forbidden -*/ - -$default-size: 1rem; - -@use "./common.scss"; - -div { - display: flex; - justify-content: center; - align-items: center; - width: 100%; - height: 100%; -} - -svg { - width: var(--size, $default-size); - height: var(--size, $default-size); - fill: var(--fill); - stroke: var(--stroke); -} diff --git a/styles/v3/components/incrementer.scss b/styles/v3/components/incrementer.scss deleted file mode 100644 index abe9478..0000000 --- a/styles/v3/components/incrementer.scss +++ /dev/null @@ -1,63 +0,0 @@ -/* -Disclaimer: This CSS is used by a custom web component and is scoped to JUST -the corresponding web component. Importing this into other files is forbidden -*/ - -$default-border-radius: 4px; -$default-height: 1.5rem; - -@use "../mixins/material"; -@use "./common.scss"; - -div { - display: grid; - grid-template-columns: var(--height, $default-height) var(--width, 50px) var(--height, $default-height); - grid-template-rows: var(--height, 1fr); - border-radius: var(--border-radius, $default-border-radius); - @include material.elevate(2); - - &:hover { - @include material.elevate(4); - } - - &:focus-within { - @include material.elevate(6); - } -} - -span, input { - border: none; - outline: none; - background: none; - color: inherit; -} - -input { - font-family: var(--font-family, inherit); - text-align: center; - font-size: var(--font-size, inherit); - padding: 2px 4px; - - &::-webkit-inner-spin-button, &::-webkit-outer-spin-button { - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - margin: 0 - } -} - -.increment, .decrement { - aspect-ratio: 1 / 1; - padding: 0; - display: flex; - justify-content: center; - align-items: center; - cursor: pointer; -} - -.increment { - border-radius: 0 var(--border-radius, $default-border-radius) var(--border-radius, 4px) 0; -} -.decrement { - border-radius: var(--border-radius, $default-border-radius) 0 0 var(--border-radius, $default-border-radius); -} diff --git a/styles/v3/elements/button.scss b/styles/v3/elements/button.scss deleted file mode 100644 index 33ad097..0000000 --- a/styles/v3/elements/button.scss +++ /dev/null @@ -1,46 +0,0 @@ -@use "../mixins/material" as material; - -.dotdungeon.style-v3 > .window-content { - button, a.button { - @include material.elevate(2); - align-items: center; - border-radius: 4px; - border: none; - box-sizing: border-box; - color: inherit; - cursor: pointer; - display: inline-flex; - font-family: sans-serif; - gap: 4px; - justify-content: center; - margin: 0; - outline: none; - padding: 4px 8px; - transition: all 200ms ease-in-out; - width: initial; - - &:hover, &:focus-visible { - @include material.elevate(4); - text-shadow: none; - } - &:active { - @include material.elevate(6); - } - - &:disabled { - opacity: 50%; - cursor: default; - } - - /* Icon buttons don't use Material styling */ - &.icon { - @include material.undo; - padding: 4px; - - &:focus-visible { - @include material.undo; - // TODO : Accessible focus state - } - } - } -} diff --git a/styles/v3/elements/checkbox.scss b/styles/v3/elements/checkbox.scss deleted file mode 100644 index d3bae5f..0000000 --- a/styles/v3/elements/checkbox.scss +++ /dev/null @@ -1,24 +0,0 @@ -.dotdungeon.style-v3 { - input[type="checkbox"] { - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - border-radius: 2px; - margin: 0; - cursor: pointer; - - background: var(--elevation-8dp-bg); - position: relative; - &:checked::before { - content: ""; - background: var(--checkbox-checked); - border-radius: 3px; - $margin: 4px; - top: $margin; - bottom: $margin; - left: $margin; - right: $margin; - position: absolute; - } - } -} diff --git a/styles/v3/elements/headers.scss b/styles/v3/elements/headers.scss deleted file mode 100644 index 0174901..0000000 --- a/styles/v3/elements/headers.scss +++ /dev/null @@ -1,10 +0,0 @@ -.dotdungeon.style-v3 > .window-content { - h1, h2, h3, h4, h5, h6 { - border: none; - font-size: 1rem; - margin: 0; - } - h1, .h1 { - font-size: 1.5rem; - } -} diff --git a/styles/v3/elements/hr.scss b/styles/v3/elements/hr.scss deleted file mode 100644 index 3f23a68..0000000 --- a/styles/v3/elements/hr.scss +++ /dev/null @@ -1,6 +0,0 @@ -.dotdungeon.style-v3 > .window-content hr { - border-color: black; - opacity: 25%; - width: 100%; - grid-column: 1 / -1; -} diff --git a/styles/v3/elements/icons.scss b/styles/v3/elements/icons.scss deleted file mode 100644 index 0a44997..0000000 --- a/styles/v3/elements/icons.scss +++ /dev/null @@ -1,17 +0,0 @@ -$iconSizes: 12, 14, 16, 18, 20, 22, 24; - -.dotdungeon.style-v3 > .window-content { - .icon { - display: inline-flex; - justify-content: center; - align-items: center; - - // The various icon sizes - @each $size in $iconSizes { - &--#{$size} { - height: #{$size}px; - width: #{$size}px; - }; - } - } -} diff --git a/styles/v3/elements/label.scss b/styles/v3/elements/label.scss deleted file mode 100644 index 12e3afb..0000000 --- a/styles/v3/elements/label.scss +++ /dev/null @@ -1,9 +0,0 @@ -@use "../mixins/material"; - -.dotdungeon.style-v3 > .window-content label { - cursor: pointer; - - &.justify-start { - justify-self: start; - } -} diff --git a/styles/v3/elements/nav.scss b/styles/v3/elements/nav.scss deleted file mode 100644 index 6046e41..0000000 --- a/styles/v3/elements/nav.scss +++ /dev/null @@ -1,11 +0,0 @@ -@use "../mixins/material" as material; - -.dotdungeon.style-v3 > .window-content { - nav:not(#context-menu) { - display: flex; - flex-direction: row; - overflow-x: auto; - gap: 8px; - padding: 8px; - } -} diff --git a/styles/v3/elements/number-input.scss b/styles/v3/elements/number-input.scss deleted file mode 100644 index ad9ce74..0000000 --- a/styles/v3/elements/number-input.scss +++ /dev/null @@ -1,20 +0,0 @@ -@use "../mixins/material"; - -.dotdungeon.style-v3 > .window-content input[type=number] { - outline: none; - border: none; - @include material.elevate(3); - padding: 4px 8px; - color: white; - transition: all 200ms ease-in-out; - text-align: center; - line-height: 1rem; - - &:hover { - @include material.elevate(4); - } - - &:focus-visible { - @include material.elevate(6); - } -} diff --git a/styles/v3/elements/panel.scss b/styles/v3/elements/panel.scss deleted file mode 100644 index de7cf9f..0000000 --- a/styles/v3/elements/panel.scss +++ /dev/null @@ -1,21 +0,0 @@ -@use "../mixins/material" as material; - -.dotdungeon.style-v3 > .window-content { - .panel { - @include material.elevate(2); - border-radius: 4px; - padding: var(--gap); - - &--row { - @extend .panel; - display: flex; - flex-direction: row; - gap: var(--gap); - align-items: center; - - &.space-between { - justify-content: space-between; - } - } - } -} diff --git a/styles/v3/elements/select.scss b/styles/v3/elements/select.scss deleted file mode 100644 index 55125ac..0000000 --- a/styles/v3/elements/select.scss +++ /dev/null @@ -1,26 +0,0 @@ -@use "../mixins/material"; - -.dotdungeon.style-v3 > .window-content { - select { - outline: none; - border: none; - @include material.elevate(3); - padding: 4px 8px; - color: white; - transition: all 200ms ease-in-out; - width: 6.25rem; - - &:hover { - @include material.elevate(4); - } - - &:focus-visible { - @include material.elevate(6); - } - } - - option { - background: var(--surface); - color: var(--on-surface); - } -} diff --git a/styles/v3/elements/text-input.scss b/styles/v3/elements/text-input.scss deleted file mode 100644 index 4c066ed..0000000 --- a/styles/v3/elements/text-input.scss +++ /dev/null @@ -1,20 +0,0 @@ -@use "../mixins/material"; - -.dotdungeon.style-v3 > .window-content input[type=text] { - outline: none; - border: none; - @include material.elevate(3); - padding: 4px 8px; - color: white; - transition: all 200ms ease-in-out; - width: auto; - height: auto; - - &:hover { - @include material.elevate(4); - } - - &:focus-visible { - @include material.elevate(6); - } -} diff --git a/styles/v3/elements/textarea.scss b/styles/v3/elements/textarea.scss deleted file mode 100644 index bc8adcd..0000000 --- a/styles/v3/elements/textarea.scss +++ /dev/null @@ -1,24 +0,0 @@ -@use "../mixins/material" as material; - -.dotdungeon.style-v3 > .window-content textarea { - outline: none; - border: none; - @include material.elevate(3); - color: white; - transition: all 200ms ease-in-out; - font-family: inherit; - font-size: 0.9rem; - - &:hover { - @include material.elevate(4); - } - - &:focus-visible { - @include material.elevate(6); - } - - &.no-resize { - @extend textarea; - resize: none; - } -} diff --git a/styles/v3/elements/utilities.scss b/styles/v3/elements/utilities.scss deleted file mode 100644 index 32cc792..0000000 --- a/styles/v3/elements/utilities.scss +++ /dev/null @@ -1,12 +0,0 @@ -.dotdungeon.style-v3 > .window-content { - .grow { - flex-grow: 1; - } - - .text-center { - text-align: center; - } - .text-right { - text-align: right; - } -} diff --git a/styles/v3/index.scss b/styles/v3/index.scss deleted file mode 100644 index 85ec4bf..0000000 --- a/styles/v3/index.scss +++ /dev/null @@ -1,52 +0,0 @@ -/* Themes */ -@use "./themes/material.css"; -@use "./themes/dark.css"; - -/* Element-Styling */ -@use "./elements/utilities.scss"; -@use "./elements/button.scss"; -@use "./elements/checkbox.scss"; -@use "./elements/select.scss"; -@use "./elements/text-input.scss"; -@use "./elements/number-input.scss"; -@use "./elements/textarea.scss"; -@use "./elements/headers.scss"; -@use "./elements/hr.scss"; -@use "./elements/icons.scss"; -@use "./elements/nav.scss"; -@use "./elements/panel.scss"; -@use "./elements/label.scss"; - -/* Sheet Layouts */ -@use "./layouts/datasheet.scss"; -@use "./layouts/items/untyped/v2.scss"; - -/* Sheet Options */ -.dotdungeon.style-v3 { - --scrollbar-width: 5px; - --scrollbar-handle-color: #782e22; - --scrollbar-handle-border-color: var(--color-border-highlight); - --color-checkbox-checked: inherit; - ::-webkit-scrollbar { - width: var(--scrollbar-width); - } - ::-webkit-scrollbar-thumb { - background: var(--scrollbar-handle-color); - border-color: var(--scrollbar-handle-border-color); - border-radius: 5px; - } - - container-type: size; - - > .window-content { - padding: 0; - background: var(--sheet); - color: var(--on-sheet); - - .debug-data { - opacity: 60%; - font-family: sans-serif; - word-break: break-all; - } - } -} diff --git a/styles/v3/layouts/datasheet.scss b/styles/v3/layouts/datasheet.scss deleted file mode 100644 index aa91e4d..0000000 --- a/styles/v3/layouts/datasheet.scss +++ /dev/null @@ -1,6 +0,0 @@ -.dotdungeon.style-v3 .datasheet { - display: flex; - flex-direction: column; - gap: 8px; - margin: 8px; -} diff --git a/styles/v3/layouts/items/untyped/v2.scss b/styles/v3/layouts/items/untyped/v2.scss deleted file mode 100644 index d94bf49..0000000 --- a/styles/v3/layouts/items/untyped/v2.scss +++ /dev/null @@ -1,81 +0,0 @@ -@use "../../../mixins/material"; -@use "../../../mixins/utils"; - -.dotdungeon.style-v3 .item--untyped { - --gap: 8px; - - .nav-bar { - @include material.elevate(8); - position: absolute; - bottom: 0; - left: 0; - right: 6px; - - nav { - display: flex; - flex-direction: row; - gap: var(--gap); - padding: var(--gap); - } - } - - .page-content { - padding: calc(var(--gap) * 1); - padding-bottom: 60px; - height: 100%; - - > .tab { - height: 100%; - gap: var(--gap); - } - } - - @include utils.tab("general") { - display: grid; - --height: 50px; - grid-template-columns: var(--height) 1fr; - grid-template-rows: var(--height) 1fr; - - .description { - grid-column: 1 / -1; - } - } - - %flex-col { - display: flex; - flex-direction: column; - gap: 8px; - } - - @include utils.tab("details") { - @extend %flex-col; - - .number { - display: grid; - grid-template-columns: 1fr 55px; - align-items: center; - } - } - - @include utils.tab("effects") { - @extend %flex-col; - } - - @include utils.tab("settings") { - @extend %flex-col; - - .capacity-usage, .quantity-capacity, .combat-relevant { - display: flex; - align-items: center; - } - - .capacity { - &--calculated { - display: flex; - flex-direction: row; - align-items: center; - gap: 8px; - } - } - } -} diff --git a/styles/v3/mixins/_material.scss b/styles/v3/mixins/_material.scss deleted file mode 100644 index a869640..0000000 --- a/styles/v3/mixins/_material.scss +++ /dev/null @@ -1,13 +0,0 @@ -@mixin elevate($height) { - background-color: var(--elevation-#{$height}dp-bg); - -webkit-box-shadow: 0px 0px #{$height * 1.75}px 0px rgba(0,0,0,0.75); - -moz-box-shadow: 0px 0px #{$height * 1.75}px 0px rgba(0,0,0,0.75); - box-shadow: 0px 0px #{$height * 1.75}px 0px rgba(0,0,0,0.75); -} - -@mixin undo { - background-color: transparent; - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none; -} diff --git a/styles/v3/mixins/_utils.scss b/styles/v3/mixins/_utils.scss deleted file mode 100644 index 02818c0..0000000 --- a/styles/v3/mixins/_utils.scss +++ /dev/null @@ -1,5 +0,0 @@ -@mixin tab($name) { - .tab.active[data-tab="#{$name}"] { - @content; - } -} diff --git a/styles/v3/themes/dark.css b/styles/v3/themes/dark.css deleted file mode 100644 index 374056f..0000000 --- a/styles/v3/themes/dark.css +++ /dev/null @@ -1,9 +0,0 @@ -.dotdungeon.style-v3 { - --sheet: #0a0a0a; - --on-sheet: white; - - --surface: #121212; - --on-surface: white; - - --checkbox-checked: #00d300; -} diff --git a/styles/v3/themes/material.css b/styles/v3/themes/material.css deleted file mode 100644 index 7c934dc..0000000 --- a/styles/v3/themes/material.css +++ /dev/null @@ -1,27 +0,0 @@ -/* -These CSS variables are all used in order to try following Material design as -best as I can. -*/ - -.dotdungeon.style-v3 { - --elevation-0dp-bg: var(--surface); - --elevation-0dp-text: var(--on-surface); - --elevation-1dp-bg: color-mix(in lab, transparent, white 5%); - --elevation-1dp-text: white; - --elevation-2dp-bg: color-mix(in lab, transparent, white 7%); - --elevation-2dp-text: white; - --elevation-3dp-bg: color-mix(in lab, transparent, white 8%); - --elevation-3dp-text: white; - --elevation-4dp-bg: color-mix(in lab, transparent, white 9%); - --elevation-4dp-text: white; - --elevation-6dp-bg: color-mix(in lab, transparent, white 11%); - --elevation-6dp-text: white; - --elevation-8dp-bg: color-mix(in lab, transparent, white 12%); - --elevation-8dp-text: white; - --elevation-12dp-bg: color-mix(in lab, transparent, white 14%); - --elevation-12dp-text: white; - --elevation-16dp-bg: color-mix(in lab, transparent, white 15%); - --elevation-16dp-text: white; - --elevation-24dp-bg: color-mix(in lab, transparent, white 16%); - --elevation-24dp-text: white; -} \ No newline at end of file diff --git a/system.json b/system.json index 5d3387c..3c80e4b 100644 --- a/system.json +++ b/system.json @@ -2,7 +2,7 @@ "id": "dotdungeon", "title": ".dungeon", "description": "", - "version": "0.0.9", + "version": "0.0.7", "download": "https://github.com/Oliver-Akins/foundry.dungeon/releases/latest/download/dotdungeon.zip", "manifest": "https://github.com/Oliver-Akins/foundry.dungeon/releases/latest/download/system.json", "url": "https://github.com/Oliver-Akins/foundry.dungeon", diff --git a/templates/actors/char-sheet/v2/partials/inventory/inventory.v2.pc.hbs b/templates/actors/char-sheet/v2/partials/inventory/inventory.v2.pc.hbs index f4e2bd5..0468990 100644 --- a/templates/actors/char-sheet/v2/partials/inventory/inventory.v2.pc.hbs +++ b/templates/actors/char-sheet/v2/partials/inventory/inventory.v2.pc.hbs @@ -1,4 +1,4 @@
{{> dotdungeon.pc.v2.storage }} {{> dotdungeon.pc.v2.player }} -
+ \ No newline at end of file diff --git a/templates/actors/char-sheet/v2/partials/inventory/item-list.v2.pc.hbs b/templates/actors/char-sheet/v2/partials/inventory/item-list.v2.pc.hbs index 73926f9..b3905eb 100644 --- a/templates/actors/char-sheet/v2/partials/inventory/item-list.v2.pc.hbs +++ b/templates/actors/char-sheet/v2/partials/inventory/item-list.v2.pc.hbs @@ -11,13 +11,16 @@

{{filter.label}}


@@ -31,4 +34,4 @@ {{/if}} {{/each}} - + \ No newline at end of file diff --git a/templates/actors/char-sheet/v2/partials/inventory/items/aspect.v2.pc.hbs b/templates/actors/char-sheet/v2/partials/inventory/items/aspect.v2.pc.hbs index ff106e6..9381ec4 100644 --- a/templates/actors/char-sheet/v2/partials/inventory/items/aspect.v2.pc.hbs +++ b/templates/actors/char-sheet/v2/partials/inventory/items/aspect.v2.pc.hbs @@ -8,12 +8,14 @@ >

{{item.name}} @@ -30,6 +32,7 @@ type="checkbox" {{checked item.system.used}} id="{{meta.idp}}-{{item.uuid}}-used" + value="{{item.system.used}}" data-embedded-id="{{item.uuid}}" data-embedded-update="system.used" data-embedded-update-on="change" @@ -83,7 +86,8 @@ data-tooltip="{{dd-i18n 'dotdungeon.common.delete'}}" data-tooltip-direction="RIGHT" class="aspect__button--delete" - data-embedded-delete="{{item.uuid}}" + data-embedded-delete + data-embedded-id="{{item.uuid}}" > + \ No newline at end of file diff --git a/templates/actors/char-sheet/v2/sheet.hbs b/templates/actors/char-sheet/v2/sheet.hbs index b32fac7..ac8702a 100644 --- a/templates/actors/char-sheet/v2/sheet.hbs +++ b/templates/actors/char-sheet/v2/sheet.hbs @@ -1,6 +1,6 @@
{{!-- All panels here --}} -
+
Avatar
{{> dotdungeon.pc.v2.stats }}
Combat
@@ -8,7 +8,7 @@
Spells
Settings
{{> dotdungeon.pc.v2.effects }} -
+ {{!-- Tab list here --}} diff --git a/templates/actors/mobs/main.v2.hbs b/templates/actors/mobs/main.v2.hbs deleted file mode 100644 index 3e701f2..0000000 --- a/templates/actors/mobs/main.v2.hbs +++ /dev/null @@ -1,32 +0,0 @@ - -
- -
- Dice: - - - -
- -
-
-
-
Combat
-
About
-
-
- Combat Tab -
-
-
\ No newline at end of file diff --git a/templates/actors/sync/basic.hbs b/templates/actors/sync/basic.hbs index 209e064..93a0e84 100644 --- a/templates/actors/sync/basic.hbs +++ b/templates/actors/sync/basic.hbs @@ -1,6 +1,6 @@