Merge branch 'master' into 004_equipment_tracking

This commit is contained in:
Gesina Schwalbe 2020-12-29 23:09:16 +01:00
commit f2724a13a1
6 changed files with 12 additions and 7 deletions

2
package-lock.json generated
View file

@ -2678,7 +2678,7 @@
}
},
"foundry-pc-types": {
"version": "git+https://git.f3l.de/dungeonslayers/foundry-pc-types.git#211c36bdde13400f02421dc0f911b255767dac76",
"version": "git+https://git.f3l.de/dungeonslayers/foundry-pc-types.git#4ae5653e74e79bb6b4bd23b094dee066a0c7723a",
"from": "git+https://git.f3l.de/dungeonslayers/foundry-pc-types.git#f3l-fixes",
"dev": true,
"requires": {

View file

@ -9,7 +9,7 @@ interface DS4ActorDataAttributes {
mind: ExtensibleData<number>;
}
interface ExtensibleData<T extends any> {
interface ExtensibleData<T> {
initial: T;
}

View file

@ -1,3 +1,4 @@
import { DS4ItemDataType } from "../item/item-data";
import { DS4Actor } from "./actor";
import { DS4ActorDataType } from "./actor-data";
@ -5,7 +6,7 @@ import { DS4ActorDataType } from "./actor-data";
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
export class DS4ActorSheet extends ActorSheet<DS4ActorDataType, DS4Actor> {
export class DS4ActorSheet extends ActorSheet<DS4ActorDataType, DS4Actor, DS4ItemDataType> {
/**
* This method returns the data for the template of the actor sheet.
* It explicitly adds the items of the object sorted by type in the
@ -88,7 +89,7 @@ export class DS4ActorSheet extends ActorSheet<DS4ActorDataType, DS4Actor> {
data: data,
};
// Remove the type from the dataset since it's in the itemData.type prop.
delete itemData.data["type"];
delete itemData.data.type;
// Finally, create the item!
return this.actor.createOwnedItem(itemData);

View file

@ -1,10 +1,12 @@
import { DS4Item } from "../item/item";
import { DS4ItemDataType } from "../item/item-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.
* @extends {Actor}
*/
export class DS4Actor extends Actor<DS4ActorDataType> {
export class DS4Actor extends Actor<DS4ActorDataType, DS4ItemDataType, DS4Item> {
/** @override */
prepareDerivedData(): void {
const data = this.data;

View file

@ -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.
*/