Compare commits

...
Sign in to create a new pull request.

2 commits

Author SHA1 Message Date
Oliver-Akins
a8a10c0ad3 Add the files for the Application classes 2025-02-22 18:35:44 -07:00
Oliver-Akins
4d5c428cbc Initial work towards integrating ActiveEffects 2025-02-22 18:35:15 -07:00
8 changed files with 112 additions and 0 deletions

View file

@ -120,6 +120,14 @@
} }
}, },
"Apps": { "Apps": {
"titles": {
"EffectManager": "Manage Effects",
"DicePool": {
"flavorless": "Dice Pool",
"flavored": "Dice Pool: {flavor}"
}
},
"manage-active-effects": "Open Effect Manager",
"move-run": "@RipCrypt.common.move • @RipCrypt.common.run", "move-run": "@RipCrypt.common.move • @RipCrypt.common.run",
"traits-range": "@RipCrypt.common.traits • @RipCrypt.common.range", "traits-range": "@RipCrypt.common.traits • @RipCrypt.common.range",
"grit-skills": "@RipCrypt.common.abilities.grit Skills", "grit-skills": "@RipCrypt.common.abilities.grit Skills",

View file

@ -23,8 +23,16 @@ export class HeroSummaryCardV1 extends GenericAppMixin(HandlebarsApplicationMixi
}, },
window: { window: {
resizable: false, resizable: false,
controls: [
{
action: `openEffectManager`,
label: `RipCrypt.Apps.manage-active-effects`,
ownership: `OWNER`,
},
],
}, },
actions: { actions: {
openEffectManager: this.#openEffectManager,
}, },
form: { form: {
submitOnChange: true, submitOnChange: true,
@ -219,5 +227,13 @@ export class HeroSummaryCardV1 extends GenericAppMixin(HandlebarsApplicationMixi
// #endregion // #endregion
// #region Actions // #region Actions
/** @this {HeroCraftCardV1} */
static async #openEffectManager() {
await this.actor.createEmbeddedDocuments(
`ActiveEffect`,
[{name: `AE Tester`}],
{ renderSheet: true },
);
};
// #endregion // #endregion
}; };

View file

@ -0,0 +1,54 @@
import { filePath } from "../../consts.mjs";
import { GenericAppMixin } from "../GenericApp.mjs";
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
export class EffectManager extends GenericAppMixin(HandlebarsApplicationMixin(ApplicationV2)) {
// #region Options
static DEFAULT_OPTIONS = {
classes: [
`ripcrypt--EffectManager`,
],
window: {
title: `Effect Manager`,
frame: true,
positioned: true,
resizable: false,
minimizable: true,
},
position: {
width: `auto`,
height: `auto`,
},
actions: {
},
};
static PARTS = {
numberOfDice: {
template: filePath(`templates/Apps/DicePool/numberOfDice.hbs`),
},
};
// #endregion
// #region Instance Data
_effects = new Map();
_showSource;
constructor({ document, showSource = true, ...opts } = {}) {
super(opts);
this._showSource = showSource;
for (const effect of document.allApplicableEffects()) {
this._effects.add(effect._id, effect);
};
};
// #endregion
// #region Lifecycle
// #endregion
// #region Actions
// #endregion
};

View file

View file

@ -0,0 +1,16 @@
<rc-border
var:border-color="var(--accent-2)"
>
<div slot="title">Changes</div>
<div slot="content" class="changes-list">
<div class="header">
<span>Attribute Key</span>
<span>Change Mode</span>
<span>Value</span>
<span>Priority</span>
<div><!-- Intentionally Empty --></div>
</div>
<ul>
</ul>
</div>
</rc-border>

View file

@ -0,0 +1,5 @@
<div>
<input type="text" name="name" value="{{name}}">
<div>Status Conditions</div>
<div>Suspended</div>
</div>

View file

@ -0,0 +1,13 @@
<rc-border>
<div slot="title">{{title}}</div>
<div slot="content">
<div>
<label for="">Rank</label>
<input type="text">
</div>
<div>
<label for="">Step</label>
<input type="text">
</div>
</div>
</rc-border>