From 7a4cb7110b14ad3404b9958cde4d5b1b590db962 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20R=C3=BCmpelein?= Date: Mon, 28 Dec 2020 12:46:39 +0100 Subject: [PATCH 1/8] Make DS Ascii Art raw. --- src/module/config.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/module/config.ts b/src/module/config.ts index 4c7b53df..777c6a6b 100644 --- a/src/module/config.ts +++ b/src/module/config.ts @@ -1,11 +1,11 @@ export const DS4 = { // ASCII Artwork - ASCII: `_____________________________________________________________________________________________ - ____ _ _ _ _ ____ _____ ___ _ _ ____ _ _ __ _______ ____ ____ _ _ -| _ \\| | | | \\ | |/ ___| ____/ _ \\| \\ | / ___|| | / \\\\ \\ / / ____| _ \\/ ___| | || | -| | | | | | | \\| | | _| _|| | | | \\| \\___ \\| | / _ \\\\ V /| _| | |_) \\___ \\ | || |_ -| |_| | |_| | |\\ | |_| | |__| |_| | |\\ |___) | |___ / ___ \\| | | |___| _ < ___) | |__ _| -|____/ \\___/|_| \\_|\\____|_____\\___/|_| \\_|____/|_____/_/ \\_\\_| |_____|_| \\_\\____/ |_| + ASCII: String.raw`_____________________________________________________________________________________________ + ____ _ _ _ _ ____ _____ ___ _ _ ____ _ _ __ _______ ____ ____ _ _ +| _ \| | | | \ | |/ ___| ____/ _ \| \ | / ___|| | / \\ \ / / ____| _ \/ ___| | || | +| | | | | | | \| | | _| _|| | | | \| \___ \| | / _ \\ V /| _| | |_) \___ \ | || |_ +| |_| | |_| | |\ | |_| | |__| |_| | |\ |___) | |___ / ___ \| | | |___| _ < ___) | |__ _| +|____/ \___/|_| \_|\____|_____\___/|_| \_|____/|_____/_/ \_\_| |_____|_| \_\____/ |_| =============================================================================================`, /** From d9440b27a6e5fb3700ebdb5bc428e009b7984c36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20R=C3=BCmpelein?= Date: Mon, 28 Dec 2020 15:51:00 +0100 Subject: [PATCH 2/8] Type-ify Actor. --- src/module/actor/actor-data.ts | 26 +++++++++++++++++++++++++- src/module/actor/actor-sheet.ts | 6 +++--- src/module/actor/actor.ts | 13 ++++++------- src/module/item/item-sheet.ts | 2 +- 4 files changed, 35 insertions(+), 12 deletions(-) diff --git a/src/module/actor/actor-data.ts b/src/module/actor/actor-data.ts index d6575c24..1ddcb9c9 100644 --- a/src/module/actor/actor-data.ts +++ b/src/module/actor/actor-data.ts @@ -1,2 +1,26 @@ +export type DS4ActorDataType = EntityData; + // TODO: Actually add a type for data -export type DS4ActorDataType = unknown; +export class DS4ActorData { + public attributes: DS4ActorDataAttributes; + public traits: DS4ActorDataTraits; +} + +class DS4ActorDataAttributes { + public body: ExpandableAttribute; + public mobility: ExpandableAttribute; + public mind: ExpandableAttribute; +} + +class ExpandableAttribute { + public initial: T; +} + +class DS4ActorDataTraits { + public strength: ExpandableAttribute; + public constitution: ExpandableAttribute; + public agility: ExpandableAttribute; + public dexterity: ExpandableAttribute; + public intellect: ExpandableAttribute; + public aura: ExpandableAttribute; +} diff --git a/src/module/actor/actor-sheet.ts b/src/module/actor/actor-sheet.ts index 4a16bfa7..57128b34 100644 --- a/src/module/actor/actor-sheet.ts +++ b/src/module/actor/actor-sheet.ts @@ -21,9 +21,9 @@ export class DS4ActorSheet extends ActorSheet { /** @override */ getData(): ActorSheetData { - // TODO: replace ["..."] access with . const data = super.getData(); - data["dtypes"] = ["String", "Number", "Boolean"]; + const checkboxTypes = [typeof String, typeof Number, typeof Boolean]; + console.log(data.data["attributes"]); for (const attr of Object.values(data.data["attributes"])) { attr["isCheckbox"] = attr["dtype"] === "Boolean"; } @@ -99,7 +99,7 @@ export class DS4ActorSheet extends ActorSheet { const dataset = element.dataset; if (dataset.roll) { - const roll = new Roll(dataset.roll, this.actor.data.data as Record); + const roll = new Roll(dataset.roll, this.actor.data.data); const label = dataset.label ? `Rolling ${dataset.label}` : ""; roll.roll().toMessage({ speaker: ChatMessage.getSpeaker({ actor: this.actor }), diff --git a/src/module/actor/actor.ts b/src/module/actor/actor.ts index 38292ed7..e1f806b0 100644 --- a/src/module/actor/actor.ts +++ b/src/module/actor/actor.ts @@ -1,4 +1,4 @@ -import { DS4ActorDataType } from "./actor-data"; +import { DS4ActorData, DS4ActorDataType } from "./actor-data"; /** * Extend the base Actor entity by defining a custom roll data structure which is ideal for the Simple system. @@ -13,21 +13,20 @@ export class DS4Actor extends Actor { _prepareCombatValues(data: ActorData): void { const hitPointsModifier = getProperty(data, "data.combatValues.hitPoints.modifier") || 0; + // data.data seems to get initialized with the enitity's data + const actorData = (data.data as unknown) as DS4ActorData; setProperty( data, "data.combatValues.hitPoints.max", - data.data["attributes"]["body"].initial + // TODO: replace ["..."] - data.data["traits"]["constitution"].initial + // TODO: replace ["..."] - 10 + - hitPointsModifier, + actorData.attributes.body.initial + actorData.traits.constitution.initial + 10 + hitPointsModifier, ); const defenseModifier = getProperty(data, "data.combatValues.defense.modifier") || 0; setProperty( data, "data.combatValues.defense.value", - data.data["attributes"]["body"].initial + // TODO: replace ["..."] - data.data["traits"]["constitution"].initial + // TODO: replace ["..."] + actorData.attributes.body.initial + + actorData.traits.constitution.initial + this._getArmorValue() + defenseModifier, ); diff --git a/src/module/item/item-sheet.ts b/src/module/item/item-sheet.ts index d9258449..eff93c0d 100644 --- a/src/module/item/item-sheet.ts +++ b/src/module/item/item-sheet.ts @@ -6,7 +6,7 @@ import { DS4ItemDataType } from "./item-data"; * Extend the basic ItemSheet with some very simple modifications * @extends {ItemSheet} */ -export class DS4ItemSheet extends ItemSheet { +export class DS4ItemSheet extends ItemSheet { /** @override */ static get defaultOptions(): FormApplicationOptions { return mergeObject(super.defaultOptions, { From 525f3c670e1b24c5f25ecb3391de7bd9c829fdfa Mon Sep 17 00:00:00 2001 From: Johannes Loher Date: Mon, 28 Dec 2020 16:50:32 +0100 Subject: [PATCH 3/8] use fork of foundry-pc-types --- package-lock.json | 4 ++-- package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index deddd901..4bf17502 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2678,8 +2678,8 @@ } }, "foundry-pc-types": { - "version": "gitlab:foundry-projects/foundry-pc/foundry-pc-types#e9cca6fbbe811fb439a3d0cdba7433746530cd97", - "from": "gitlab:foundry-projects/foundry-pc/foundry-pc-types", + "version": "git+https://git.f3l.de/dungeonslayers/foundry-pc-types.git#a94b1270e74d5e139c7c5d361764d9b0bc505c6f", + "from": "git+https://git.f3l.de/dungeonslayers/foundry-pc-types.git#f3l-fixes", "dev": true, "requires": { "@types/jquery": "^3.5.1", diff --git a/package.json b/package.json index 1effb9f3..7099f55d 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "build:watch": "gulp watch", "link": "gulp link", "clean": "gulp clean && gulp link --clean", - "update": "npm install --save-dev gitlab:foundry-projects/foundry-pc/foundry-pc-types", + "update": "npm install --save-dev git+https://git.f3l.de/dungeonslayers/foundry-pc-types.git#f3l-fixes", "lint": "eslint 'src/**/*.ts' --cache", "lint:fix": "eslint 'src/**/*.ts' --cache --fix" }, @@ -23,7 +23,7 @@ "eslint": "^7.16.0", "eslint-config-prettier": "^7.1.0", "eslint-plugin-prettier": "^3.3.0", - "foundry-pc-types": "gitlab:foundry-projects/foundry-pc/foundry-pc-types", + "foundry-pc-types": "git+https://git.f3l.de/dungeonslayers/foundry-pc-types.git#f3l-fixes", "fs-extra": "^9.0.1", "gulp": "^4.0.2", "gulp-git": "^2.10.1", From 9385917edde75447880b755a11305df3ae5fe645 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20R=C3=BCmpelein?= Date: Mon, 28 Dec 2020 17:34:40 +0100 Subject: [PATCH 4/8] Update to new data bindings, everythings an interface now. --- package-lock.json | 2 +- src/module/actor/actor-data.ts | 38 ++++++++++++++++----------------- src/module/actor/actor-sheet.ts | 22 +++++-------------- src/module/actor/actor.ts | 9 ++++---- src/module/ds4.ts | 4 ++-- src/module/item/item-sheet.ts | 15 +++++++------ 6 files changed, 40 insertions(+), 50 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4bf17502..f9b1dfbe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2678,7 +2678,7 @@ } }, "foundry-pc-types": { - "version": "git+https://git.f3l.de/dungeonslayers/foundry-pc-types.git#a94b1270e74d5e139c7c5d361764d9b0bc505c6f", + "version": "git+https://git.f3l.de/dungeonslayers/foundry-pc-types.git#211c36bdde13400f02421dc0f911b255767dac76", "from": "git+https://git.f3l.de/dungeonslayers/foundry-pc-types.git#f3l-fixes", "dev": true, "requires": { diff --git a/src/module/actor/actor-data.ts b/src/module/actor/actor-data.ts index 1ddcb9c9..93bb7883 100644 --- a/src/module/actor/actor-data.ts +++ b/src/module/actor/actor-data.ts @@ -1,26 +1,26 @@ -export type DS4ActorDataType = EntityData; - -// TODO: Actually add a type for data -export class DS4ActorData { - public attributes: DS4ActorDataAttributes; - public traits: DS4ActorDataTraits; +export interface DS4ActorDataType { + attributes: DS4ActorDataAttributes; + traits: DS4ActorDataTraits; } -class DS4ActorDataAttributes { - public body: ExpandableAttribute; - public mobility: ExpandableAttribute; - public mind: ExpandableAttribute; +interface DS4ActorDataAttributes { + body: BodyAttribute; + mobility: ExtensibleData; + mind: ExtensibleData; } -class ExpandableAttribute { - public initial: T; +interface ExtensibleData { + initial: T; } -class DS4ActorDataTraits { - public strength: ExpandableAttribute; - public constitution: ExpandableAttribute; - public agility: ExpandableAttribute; - public dexterity: ExpandableAttribute; - public intellect: ExpandableAttribute; - public aura: ExpandableAttribute; +// Blueprint in case we need more detailed differentiation +type BodyAttribute = ExtensibleData; + +interface DS4ActorDataTraits { + strength: ExtensibleData; + constitution: ExtensibleData; + agility: ExtensibleData; + dexterity: ExtensibleData; + intellect: ExtensibleData; + aura: ExtensibleData; } diff --git a/src/module/actor/actor-sheet.ts b/src/module/actor/actor-sheet.ts index 57128b34..925dc37b 100644 --- a/src/module/actor/actor-sheet.ts +++ b/src/module/actor/actor-sheet.ts @@ -19,18 +19,6 @@ export class DS4ActorSheet extends ActorSheet { /* -------------------------------------------- */ - /** @override */ - getData(): ActorSheetData { - const data = super.getData(); - const checkboxTypes = [typeof String, typeof Number, typeof Boolean]; - console.log(data.data["attributes"]); - for (const attr of Object.values(data.data["attributes"])) { - attr["isCheckbox"] = attr["dtype"] === "Boolean"; - } - console.log(data); - return data; - } - /** @override */ activateListeners(html: JQuery): void { super.activateListeners(html); @@ -39,17 +27,17 @@ export class DS4ActorSheet extends ActorSheet { if (!this.options.editable) return; // Add Inventory Item - html.find(".item-create").click(this._onItemCreate.bind(this)); + html.find(".item-create").on("click", this._onItemCreate.bind(this)); // Update Inventory Item - html.find(".item-edit").click((ev) => { + html.find(".item-edit").on("click", (ev) => { const li = $(ev.currentTarget).parents(".item"); const item = this.actor.getOwnedItem(li.data("itemId")); item.sheet.render(true); }); // Delete Inventory Item - html.find(".item-delete").click((ev) => { + html.find(".item-delete").on("clock", (ev) => { const li = $(ev.currentTarget).parents(".item"); this.actor.deleteOwnedItem(li.data("itemId")); li.slideUp(200, () => this.render(false)); @@ -66,7 +54,7 @@ export class DS4ActorSheet extends ActorSheet { * @param {Event} event The originating click event * @private */ - _onItemCreate(event: JQuery.ClickEvent): Promise { + private _onItemCreate(event: JQuery.ClickEvent): Promise { event.preventDefault(); const header = event.currentTarget; // Get the type of item to create. @@ -93,7 +81,7 @@ export class DS4ActorSheet extends ActorSheet { * @param {Event} event The originating click event * @private */ - _onRoll(event: JQuery.ClickEvent): void { + private _onRoll(event: JQuery.ClickEvent): void { event.preventDefault(); const element = event.currentTarget; const dataset = element.dataset; diff --git a/src/module/actor/actor.ts b/src/module/actor/actor.ts index e1f806b0..5f67e96e 100644 --- a/src/module/actor/actor.ts +++ b/src/module/actor/actor.ts @@ -1,4 +1,4 @@ -import { DS4ActorData, DS4ActorDataType } from "./actor-data"; +import { DS4ActorDataType } from "./actor-data"; /** * Extend the base Actor entity by defining a custom roll data structure which is ideal for the Simple system. @@ -11,10 +11,9 @@ export class DS4Actor extends Actor { this._prepareCombatValues(data); } - _prepareCombatValues(data: ActorData): void { + private _prepareCombatValues(data: ActorData): void { const hitPointsModifier = getProperty(data, "data.combatValues.hitPoints.modifier") || 0; - // data.data seems to get initialized with the enitity's data - const actorData = (data.data as unknown) as DS4ActorData; + const actorData = data.data; setProperty( data, "data.combatValues.hitPoints.max", @@ -32,7 +31,7 @@ export class DS4Actor extends Actor { ); } - _getArmorValue(): number { + private _getArmorValue(): number { return this.data["items"] .filter((item) => ["armor", "shield"].includes(item.type)) .filter((item) => item.data.equipped) diff --git a/src/module/ds4.ts b/src/module/ds4.ts index bd76905c..002e9314 100644 --- a/src/module/ds4.ts +++ b/src/module/ds4.ts @@ -18,8 +18,8 @@ Hooks.once("init", async function () { CONFIG.DS4 = DS4; // Define custom Entity classes - CONFIG.Actor.entityClass = DS4Actor as typeof Actor; // TODO: Can we remove the casts? - CONFIG.Item.entityClass = DS4Item as typeof Item; // TODO: Can we remove the casts? + CONFIG.Actor.entityClass = DS4Actor as typeof Actor; + CONFIG.Item.entityClass = DS4Item as typeof Item; // Register sheet application classes Actors.unregisterSheet("core", ActorSheet); diff --git a/src/module/item/item-sheet.ts b/src/module/item/item-sheet.ts index eff93c0d..f9cb4022 100644 --- a/src/module/item/item-sheet.ts +++ b/src/module/item/item-sheet.ts @@ -1,4 +1,3 @@ -import { DS4ActorDataType } from "../actor/actor-data"; import { DS4Item } from "./item"; import { DS4ItemDataType } from "./item-data"; @@ -26,7 +25,7 @@ export class DS4ItemSheet extends ItemSheet { /* -------------------------------------------- */ /** @override */ - getData(): ItemSheetData { + getData(): ItemSheetData { const data = { ...super.getData(), config: CONFIG.DS4 }; console.log(data); return data; @@ -35,11 +34,15 @@ export class DS4ItemSheet extends ItemSheet { /* -------------------------------------------- */ /** @override */ - setPosition(options = {}): unknown { + setPosition(options: ApplicationPosition = {}): ApplicationPosition { const position = super.setPosition(options); - const sheetBody = (this.element as JQuery).find(".sheet-body"); // TODO: Why is the cast necessary? - const bodyHeight = position.height - 192; - sheetBody.css("height", bodyHeight); + if ("find" in this.element) { + const sheetBody = this.element.find(".sheet"); + const bodyHeight = position.height - 192; + sheetBody.css("height", bodyHeight); + } else { + console.log("Failure setting position."); + } return position; } From 4d00d8a481fcc0f3321475b347a5938e37e632c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20R=C3=BCmpelein?= Date: Mon, 28 Dec 2020 17:38:52 +0100 Subject: [PATCH 5/8] Fix typo in event handler. --- src/module/actor/actor-sheet.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/module/actor/actor-sheet.ts b/src/module/actor/actor-sheet.ts index 925dc37b..43af361c 100644 --- a/src/module/actor/actor-sheet.ts +++ b/src/module/actor/actor-sheet.ts @@ -37,7 +37,7 @@ export class DS4ActorSheet extends ActorSheet { }); // Delete Inventory Item - html.find(".item-delete").on("clock", (ev) => { + html.find(".item-delete").on("click", (ev) => { const li = $(ev.currentTarget).parents(".item"); this.actor.deleteOwnedItem(li.data("itemId")); li.slideUp(200, () => this.render(false)); From a84df2d80be99963e60fd882f8254536eea33bcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20R=C3=BCmpelein?= Date: Mon, 28 Dec 2020 17:44:30 +0100 Subject: [PATCH 6/8] Fix class name on jquery. --- src/module/item/item-sheet.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/module/item/item-sheet.ts b/src/module/item/item-sheet.ts index f9cb4022..f6e95420 100644 --- a/src/module/item/item-sheet.ts +++ b/src/module/item/item-sheet.ts @@ -37,7 +37,7 @@ export class DS4ItemSheet extends ItemSheet { setPosition(options: ApplicationPosition = {}): ApplicationPosition { const position = super.setPosition(options); if ("find" in this.element) { - const sheetBody = this.element.find(".sheet"); + const sheetBody = this.element.find(".sheet-body"); const bodyHeight = position.height - 192; sheetBody.css("height", bodyHeight); } else { From 1ef66a202312ab322ea1e71d415557eab0d523db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20R=C3=BCmpelein?= Date: Mon, 28 Dec 2020 18:24:13 +0100 Subject: [PATCH 7/8] Create types for items. --- src/module/config.ts | 2 +- src/module/item/item-data.ts | 38 ++++++++++++++++++++++++++++++++++- src/module/item/item-sheet.ts | 10 ++++----- src/template.json | 14 ++++++------- 4 files changed, 50 insertions(+), 14 deletions(-) diff --git a/src/module/config.ts b/src/module/config.ts index 777c6a6b..09bcfe5a 100644 --- a/src/module/config.ts +++ b/src/module/config.ts @@ -49,7 +49,7 @@ export const DS4 = { */ armorTypes: { body: "DS4.ArmorTypeBody", - helment: "DS4.ArmorTypeHelmet", + helmet: "DS4.ArmorTypeHelmet", vambrace: "DS4.ArmorTypeVambrace", greaves: "DS4.ArmorTypeGreaves", vambraceGreaves: "DS4.ArmorTypeVambraceGreaves", diff --git a/src/module/item/item-data.ts b/src/module/item/item-data.ts index 7cdfd20b..fed78643 100644 --- a/src/module/item/item-data.ts +++ b/src/module/item/item-data.ts @@ -1,2 +1,38 @@ // TODO: Actually add a type for data -export type DS4ItemDataType = unknown; +export type DS4ItemDataType = DS4Weapon | DS4Armor | DS4Shield | DS4Trinket | DS4Equipment; + +// types + +interface DS4Weapon extends DS4ItemBase, DS4ItemPhysical, DS4ItemEquipable { + attackType: "melee" | "ranged" | "meleeRanged"; + weaponBonus: number; + opponentDefense: number; +} + +interface DS4Armor extends DS4ItemBase, DS4ItemPhysical, DS4ItemEquipable, DS4ItemProtective { + armorMaterialType: "cloth" | "leather" | "chain" | "plate"; + armorType: "body" | "helmet" | "vambrace" | "greaves" | "vambraceGreaves"; +} + +interface DS4Shield extends DS4ItemBase, DS4ItemPhysical, DS4ItemEquipable, DS4ItemProtective {} +interface DS4Trinket extends DS4ItemBase, DS4ItemPhysical, DS4ItemEquipable {} +interface DS4Equipment extends DS4ItemBase, DS4ItemPhysical {} + +// templates + +interface DS4ItemBase { + description: string; +} +interface DS4ItemPhysical { + quantity: number; + price: number; + availability: "hamlet" | "village" | "city" | "elves" | "dwarves" | "none"; +} + +interface DS4ItemEquipable { + equipped: boolean; +} + +interface DS4ItemProtective { + armorValue: number; +} diff --git a/src/module/item/item-sheet.ts b/src/module/item/item-sheet.ts index f6e95420..27fb6a92 100644 --- a/src/module/item/item-sheet.ts +++ b/src/module/item/item-sheet.ts @@ -54,16 +54,16 @@ export class DS4ItemSheet extends ItemSheet { if (!this.options.editable) return; - html.find(".effect-create").click(this._onEffectCreate.bind(this)); + html.find(".effect-create").on("click", this._onEffectCreate.bind(this)); - html.find(".effect-edit").click((ev) => { + html.find(".effect-edit").on("click", (ev) => { const li = $(ev.currentTarget).parents(".effect"); console.log(li.data("effectId")); - const effect = this.item["effects"].get(li.data("effectId")); // TODO: replace ["..."] + const effect = this.item["effects"].get(li.data("effectId")); // effect.sheet.render(true); }); - html.find(".effect-delete").click(async (ev) => { + html.find(".effect-delete").on("click", async (ev) => { const li = $(ev.currentTarget).parents(".effect"); await this.item.deleteEmbeddedEntity("ActiveEffect", li.data("effectId")); }); @@ -74,7 +74,7 @@ export class DS4ItemSheet extends ItemSheet { * @param {Event} event The originating click event * @private */ - async _onEffectCreate(event: JQuery.ClickEvent): Promise { + private async _onEffectCreate(event: JQuery.ClickEvent): Promise { event.preventDefault(); const label = `New Effect`; diff --git a/src/template.json b/src/template.json index 196d74a8..f81bd603 100644 --- a/src/template.json +++ b/src/template.json @@ -50,24 +50,24 @@ }, "equipable": { "equipped": false + }, + "protective": { + "armorValue": 0 } }, "weapon": { "templates": ["base", "physical", "equipable"], "attackType": "melee", "weaponBonus": 0, - "opponentDefense": 0, - "properties": {} + "opponentDefense": 0 }, "armor": { - "templates": ["base", "physical", "equipable"], + "templates": ["base", "physical", "equipable", "protective"], "armorMaterialType": "cloth", - "armorType": "body", - "armorValue": 0 + "armorType": "body" }, "shield": { - "templates": ["base", "physical", "equipable"], - "armorValue": 0 + "templates": ["base", "physical", "equipable", "protective"] }, "trinket": { "templates": ["base", "physical", "equipable"] From 5a002b4cb47a8498b6c39f03777b761a5992e83d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20R=C3=BCmpelein?= Date: Mon, 28 Dec 2020 19:30:38 +0100 Subject: [PATCH 8/8] Re-add todo. --- src/module/item/item-sheet.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/module/item/item-sheet.ts b/src/module/item/item-sheet.ts index 27fb6a92..d6798804 100644 --- a/src/module/item/item-sheet.ts +++ b/src/module/item/item-sheet.ts @@ -59,7 +59,7 @@ export class DS4ItemSheet extends ItemSheet { html.find(".effect-edit").on("click", (ev) => { const li = $(ev.currentTarget).parents(".effect"); console.log(li.data("effectId")); - const effect = this.item["effects"].get(li.data("effectId")); // + const effect = this.item["effects"].get(li.data("effectId")); // TODO: replace ["..."] effect.sheet.render(true); });