mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-13 04:01:06 +01:00
developing experience setting page
This commit is contained in:
parent
0c9c37470a
commit
ca297b97b1
9 changed files with 55 additions and 15 deletions
|
|
@ -29,12 +29,13 @@ export default class AdversarySheet extends DaggerheartSheet(ActorSheetV2) {
|
|||
sidebar: { template: 'systems/daggerheart/templates/sheets/actors/adversary/sidebar.hbs' },
|
||||
header: { template: 'systems/daggerheart/templates/sheets/actors/adversary/header.hbs' },
|
||||
features: { template: 'systems/daggerheart/templates/sheets/actors/adversary/features.hbs' },
|
||||
notes: { template: 'systems/daggerheart/templates/sheets/actors/adversary/notes.hbs' },
|
||||
effects: { template: 'systems/daggerheart/templates/sheets/actors/adversary/effects.hbs' }
|
||||
};
|
||||
|
||||
static TABS = {
|
||||
features: {
|
||||
active: false,
|
||||
active: true,
|
||||
cssClass: '',
|
||||
group: 'primary',
|
||||
id: 'features',
|
||||
|
|
|
|||
|
|
@ -23,7 +23,10 @@ export default class DHAdversarySettings extends HandlebarsApplicationMixin(Appl
|
|||
resizable: false
|
||||
},
|
||||
position: { width: 455, height: 'auto' },
|
||||
actions: {},
|
||||
actions: {
|
||||
addExperience: this.addExperience,
|
||||
removeExperience: this.removeExperience
|
||||
},
|
||||
form: {
|
||||
handler: this.updateForm,
|
||||
submitOnChange: true,
|
||||
|
|
@ -111,6 +114,22 @@ export default class DHAdversarySettings extends HandlebarsApplicationMixin(Appl
|
|||
return tabs;
|
||||
}
|
||||
|
||||
static async addExperience() {
|
||||
const newExperience = {
|
||||
name: 'Experience',
|
||||
modifier: 0
|
||||
};
|
||||
await this.actor.update({ [`system.experiences.${foundry.utils.randomID()}`]: newExperience });
|
||||
}
|
||||
|
||||
static async removeExperience() {
|
||||
const newExperience = {
|
||||
name: 'Experience',
|
||||
modifier: 0
|
||||
};
|
||||
await this.actor.update({ [`system.experiences.${foundry.utils.randomID()}`]: newExperience });
|
||||
}
|
||||
|
||||
static async updateForm(event, _, formData) {
|
||||
await this.actor.update(formData.object);
|
||||
this.render();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue