add settings registration

This commit is contained in:
2025-05-27 23:08:01 -05:00
parent ec4f3e6c63
commit e18419575c
6 changed files with 93 additions and 21 deletions
+30
View File
@@ -25,6 +25,8 @@ const MAINTAIN_ICONS = [
'icons/magic/symbols/triangle-glowing-green.webp',
];
const { ApplicationV2, HandlebarsApplicationMixin } = foundry.applications.api;
function _hashCode(str) {
let hash = 0;
if (str.length === 0) {
@@ -38,6 +40,34 @@ function _hashCode(str) {
return Math.abs(hash);
}
export class PowerFormApplicationV2 extends HandlebarsApplicationMixin(ApplicationV2) {
constructor(powerEffect) {
super();
const name = powerEffect.name.replaceAll(/[^a-zA-Z]/g, '');
this.options.id = `${this.options.id}${name}`;
this.powerEffect = powerEffect;
}
static DEFAULT_OPTIONS = {
id: ['mbSwadePowerEffectsApplicationV2'],
form: {
handler: PowerFormApplicationV2.#onSubmit,
closeOnSubmit: true,
},
tag: 'form',
position: {
width: 400,
height: 'auto',
},
window: {
icon: 'fas fa-gear',
title: 'mbSwade.powerEffectsForm.title',
},
};
static #onSubmit(event, form, formData) {}
}
export class PowerFormApplication extends FormApplication {
constructor(powerEffect) {
super();