Item Support #69
2 changed files with 3 additions and 0 deletions
|
|
@ -137,6 +137,7 @@ export class AttributeManager extends HandlebarsApplicationMixin(ApplicationV2)
|
||||||
const attrs = [];
|
const attrs = [];
|
||||||
for (const [id, data] of Object.entries(this.#attributes)) {
|
for (const [id, data] of Object.entries(this.#attributes)) {
|
||||||
if (data == null) { continue };
|
if (data == null) { continue };
|
||||||
|
// Remove with issue: Foundry/taf#54
|
||||||
if (game.release.generation >= 14 && data == _del) {continue}
|
if (game.release.generation >= 14 && data == _del) {continue}
|
||||||
attrs.push({
|
attrs.push({
|
||||||
id,
|
id,
|
||||||
|
|
@ -186,6 +187,7 @@ export class AttributeManager extends HandlebarsApplicationMixin(ApplicationV2)
|
||||||
static async #remove($e, element) {
|
static async #remove($e, element) {
|
||||||
const attribute = element.closest(`[data-attribute]`)?.dataset.attribute;
|
const attribute = element.closest(`[data-attribute]`)?.dataset.attribute;
|
||||||
if (!attribute) { return };
|
if (!attribute) { return };
|
||||||
|
// Remove with issue: Foundry/taf#54
|
||||||
if (game.release.generation < 14) {
|
if (game.release.generation < 14) {
|
||||||
delete this.#attributes[attribute];
|
delete this.#attributes[attribute];
|
||||||
this.#attributes[`-=${attribute}`] = null;
|
this.#attributes[`-=${attribute}`] = null;
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ export class TAFActor extends Actor {
|
||||||
// Assign the defaults from the world setting if they exist
|
// Assign the defaults from the world setting if they exist
|
||||||
const defaults = game.settings.get(__ID__, `actorDefaultAttributes`) ?? {};
|
const defaults = game.settings.get(__ID__, `actorDefaultAttributes`) ?? {};
|
||||||
if (!hasProperty(data, `system.attr`)) {
|
if (!hasProperty(data, `system.attr`)) {
|
||||||
|
// Remove with issue: Foundry/taf#55
|
||||||
const value = game.release.generation > 13 ? _replace(defaults) : defaults;
|
const value = game.release.generation > 13 ? _replace(defaults) : defaults;
|
||||||
this.updateSource({ "system.==attr": value });
|
this.updateSource({ "system.==attr": value });
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue