improve effects type checking

This commit is contained in:
Johannes Loher 2020-12-29 00:33:43 +01:00
parent aa0c4741d2
commit 082cd03b71
6 changed files with 13 additions and 8 deletions

View file

@ -26,8 +26,8 @@ export class DS4ItemSheet extends ItemSheet<DS4ItemDataType, DS4Item> {
/** @override */
getData(): ItemSheetData<DS4ItemDataType, DS4Item> {
console.log(this);
const data = { ...super.getData(), config: CONFIG.DS4 };
console.log(data);
return data;
}
@ -59,7 +59,7 @@ export class DS4ItemSheet extends ItemSheet<DS4ItemDataType, DS4Item> {
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);
});

View file

@ -1,10 +1,12 @@
import { DS4Actor } from "../actor/actor";
import { DS4ActorDataType } from "../actor/actor-data";
import { DS4ItemDataType } from "./item-data";
/**
* Extend the basic Item with some very simple modifications.
* @extends {Item}
*/
export class DS4Item extends Item<DS4ItemDataType> {
export class DS4Item extends Item<DS4ItemDataType, DS4ActorDataType, DS4Actor> {
/**
* Augment the basic Item data model with additional dynamic data.
*/