Lint and cleanup unused code
This commit is contained in:
parent
de1b976b12
commit
5d951d043b
5 changed files with 6 additions and 7 deletions
|
|
@ -5,7 +5,7 @@ import { PlayerSheet } from "./apps/PlayerSheet.mjs";
|
||||||
import { QueryStatus } from "./apps/QueryStatus.mjs";
|
import { QueryStatus } from "./apps/QueryStatus.mjs";
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
import { toID, isValidID, } from "./utils/toID.mjs";
|
import { isValidID, toID } from "./utils/toID.mjs";
|
||||||
import { attributeSorter } from "./utils/attributeSort.mjs";
|
import { attributeSorter } from "./utils/attributeSort.mjs";
|
||||||
import { DialogManager } from "./utils/DialogManager.mjs";
|
import { DialogManager } from "./utils/DialogManager.mjs";
|
||||||
import { localizer } from "./utils/localizer.mjs";
|
import { localizer } from "./utils/localizer.mjs";
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import { TAFDocumentSheetMixin } from "./mixins/TAFDocumentSheetMixin.mjs";
|
||||||
|
|
||||||
const { HandlebarsApplicationMixin } = foundry.applications.api;
|
const { HandlebarsApplicationMixin } = foundry.applications.api;
|
||||||
const { ItemSheetV2 } = foundry.applications.sheets;
|
const { ItemSheetV2 } = foundry.applications.sheets;
|
||||||
const { setProperty } = foundry.utils;
|
|
||||||
|
|
||||||
export class AttributeItemSheet extends
|
export class AttributeItemSheet extends
|
||||||
TAFDocumentSheetMixin(
|
TAFDocumentSheetMixin(
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,6 @@ export class PlayerSheet extends
|
||||||
* they occur.
|
* they occur.
|
||||||
*/
|
*/
|
||||||
#expandedItems = new Set();
|
#expandedItems = new Set();
|
||||||
#collapsedAttributeGroups = new Set();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is used in order to ensure that when we hide specific
|
* This method is used in order to ensure that when we hide specific
|
||||||
|
|
@ -317,7 +316,7 @@ export class PlayerSheet extends
|
||||||
for (const attr of attrs) {
|
for (const attr of attrs) {
|
||||||
if (attr.system.aboveTheFold) { continue };
|
if (attr.system.aboveTheFold) { continue };
|
||||||
|
|
||||||
const groupName = attr.system.group ?? "Attributes";
|
const groupName = attr.system.group ?? `Attributes`;
|
||||||
if (!groups.has(groupName)) {
|
if (!groups.has(groupName)) {
|
||||||
groups.set(groupName, {
|
groups.set(groupName, {
|
||||||
name: groupName.titleCase(),
|
name: groupName.titleCase(),
|
||||||
|
|
@ -374,7 +373,7 @@ export class PlayerSheet extends
|
||||||
for (const item of items) {
|
for (const item of items) {
|
||||||
summedWeight += item.system.quantifiedWeight ?? 0;
|
summedWeight += item.system.quantifiedWeight ?? 0;
|
||||||
const data = await this._prepareItem(item);
|
const data = await this._prepareItem(item);
|
||||||
if (data) preparedItems.push(data);
|
if (data) { preparedItems.push(data) };
|
||||||
};
|
};
|
||||||
totalWeight += summedWeight;
|
totalWeight += summedWeight;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ export class AttributeItemData extends foundry.abstract.TypeDataModel {
|
||||||
const max = getProperty(data, `system.max`) ?? this.max;
|
const max = getProperty(data, `system.max`) ?? this.max;
|
||||||
|
|
||||||
let min = getProperty(data, `system.min`) ?? this.min;
|
let min = getProperty(data, `system.min`) ?? this.min;
|
||||||
if (max != null) { min ??= 0; };
|
if (max != null) { min ??= 0 };
|
||||||
|
|
||||||
setProperty(data, `system.value`, clamp(min, value, max));
|
setProperty(data, `system.value`, clamp(min, value, max));
|
||||||
};
|
};
|
||||||
|
|
@ -106,6 +106,7 @@ export class AttributeItemData extends foundry.abstract.TypeDataModel {
|
||||||
if (this.isRange) {
|
if (this.isRange) {
|
||||||
return this.min ?? 0;
|
return this.min ?? 0;
|
||||||
};
|
};
|
||||||
|
return null;
|
||||||
};
|
};
|
||||||
// #endregion Methods
|
// #endregion Methods
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ export class TAFActor extends Actor {
|
||||||
`modifyTokenAttribute`,
|
`modifyTokenAttribute`,
|
||||||
{ attribute, value, isDelta, isBar, isEmbedded: true },
|
{ attribute, value, isDelta, isBar, isEmbedded: true },
|
||||||
updates,
|
updates,
|
||||||
this
|
this,
|
||||||
);
|
);
|
||||||
|
|
||||||
return allowed !== false ? await attr.update(updates) : this;
|
return allowed !== false ? await attr.update(updates) : this;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue