Make the system use Proxy and proper subclassing instead of the weird middle-ground polymorphism (closes #86)
This commit is contained in:
parent
745824f6cc
commit
cd98e66484
17 changed files with 322 additions and 351 deletions
|
|
@ -2,8 +2,13 @@ import { GenericActorSheet } from "../../GenericActorSheet.mjs";
|
|||
import DOTDUNGEON from "../../../config.mjs";
|
||||
import { localizer } from "../../../utils/localizer.mjs";
|
||||
import { modifierToString } from "../../../utils/modifierToString.mjs";
|
||||
import { Player } from "../../../documents/Actor2/Player.mjs";
|
||||
|
||||
export class PlayerSheetv2 extends GenericActorSheet {
|
||||
|
||||
/** @type {Player | null} */
|
||||
actor;
|
||||
|
||||
static get defaultOptions() {
|
||||
let opts = mergeObject(
|
||||
super.defaultOptions,
|
||||
|
|
@ -61,7 +66,7 @@ export class PlayerSheetv2 extends GenericActorSheet {
|
|||
|
||||
ctx.computed = {
|
||||
canChangeGroup: ctx.settings.playersCanChangeGroup || ctx.isGM,
|
||||
canAddAspect: !await actor.proxyFunction.bind(actor)(`atAspectLimit`),
|
||||
canAddAspect: !this.actor.atAspectLimit,
|
||||
stats: this.#statData,
|
||||
itemFilters: this.#itemFilters,
|
||||
noItemTypesVisible: this._itemTypesHidden.size === DOTDUNGEON.itemFilters.length,
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ export class MVPPCSheet extends GenericActorSheet {
|
|||
|
||||
ctx.computed = {
|
||||
canChangeGroup: ctx.settings.playersCanChangeGroup || ctx.isGM,
|
||||
canAddAspect: !await actor.proxyFunction.bind(actor)(`atAspectLimit`),
|
||||
canAddAspect: !this.actor.atAspectLimit,
|
||||
};
|
||||
|
||||
return ctx;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue