mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-14 04:31:07 +01:00
Fix conflict
This commit is contained in:
commit
38d228c53e
20 changed files with 324 additions and 70 deletions
|
|
@ -5,6 +5,7 @@ import AncestrySelectionDialog from '../ancestrySelectionDialog.mjs';
|
|||
import DaggerheartSheet from './daggerheart-sheet.mjs';
|
||||
import { abilities } from '../../config/actorConfig.mjs';
|
||||
import DhlevelUp from '../levelup.mjs';
|
||||
import DhCharacterCreation from '../characterCreation.mjs';
|
||||
|
||||
const { ActorSheetV2 } = foundry.applications.sheets;
|
||||
const { TextEditor } = foundry.applications.ux;
|
||||
|
|
@ -46,7 +47,7 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) {
|
|||
useAdvancementCard: this.useAdvancementCard,
|
||||
useAdvancementAbility: this.useAdvancementAbility,
|
||||
toggleEquipItem: this.toggleEquipItem,
|
||||
levelup: this.openLevelUp,
|
||||
levelManagement: this.levelManagement,
|
||||
editImage: this._onEditImage
|
||||
},
|
||||
window: {
|
||||
|
|
@ -216,7 +217,7 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) {
|
|||
_attachPartListeners(partId, htmlElement, options) {
|
||||
super._attachPartListeners(partId, htmlElement, options);
|
||||
|
||||
// htmlElement.querySelector('.level-value').addEventListener('change', this.onLevelChange.bind(this));
|
||||
htmlElement.querySelector('.level-value')?.addEventListener('change', this.onLevelChange.bind(this));
|
||||
// To Remove when ContextMenu Handler is made
|
||||
htmlElement
|
||||
.querySelectorAll('[data-item-id]')
|
||||
|
|
@ -417,7 +418,19 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) {
|
|||
}
|
||||
}
|
||||
|
||||
static openLevelUp() {
|
||||
static levelManagement() {
|
||||
if (this.document.system.needsCharacterSetup) {
|
||||
this.characterSetup();
|
||||
} else {
|
||||
this.openLevelUp();
|
||||
}
|
||||
}
|
||||
|
||||
characterSetup() {
|
||||
new DhCharacterCreation(this.document).render(true);
|
||||
}
|
||||
|
||||
openLevelUp() {
|
||||
if (!this.document.system.class.value || !this.document.system.class.subclass) {
|
||||
ui.notifications.error(game.i18n.localize('DAGGERHEART.Sheets.PC.Errors.missingClassOrSubclass'));
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -4,20 +4,56 @@ const { ItemSheetV2 } = foundry.applications.sheets;
|
|||
export default class DomainCardSheet extends DHItemSheetV2(ItemSheetV2) {
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ['domain-card'],
|
||||
position: { width: 450, height: 700 }
|
||||
position: { width: 450, height: 700 },
|
||||
actions: {
|
||||
addEffect: this.addEffect,
|
||||
editEffect: this.editEffect,
|
||||
removeEffect: this.removeEffect
|
||||
}
|
||||
};
|
||||
|
||||
static PARTS = {
|
||||
header: { template: 'systems/daggerheart/templates/sheets/items/domainCard/header.hbs' },
|
||||
tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' },
|
||||
description: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-description.hbs' },
|
||||
settings: {
|
||||
template: 'systems/daggerheart/templates/sheets/items/domainCard/settings.hbs',
|
||||
scrollable: ['.settings']
|
||||
},
|
||||
actions: {
|
||||
template: 'systems/daggerheart/templates/sheets/global/tabs/tab-actions.hbs',
|
||||
scrollable: ['.actions']
|
||||
},
|
||||
settings: {
|
||||
template: 'systems/daggerheart/templates/sheets/items/domainCard/settings.hbs',
|
||||
scrollable: ['.settings']
|
||||
effects: {
|
||||
template: 'systems/daggerheart/templates/sheets/global/tabs/tab-effects.hbs',
|
||||
scrollable: ['.effects']
|
||||
}
|
||||
};
|
||||
|
||||
static TABS = {
|
||||
...super.TABS,
|
||||
effects: {
|
||||
active: false,
|
||||
cssClass: '',
|
||||
group: 'primary',
|
||||
id: 'effects',
|
||||
icon: null,
|
||||
label: 'DAGGERHEART.Sheets.Feature.Tabs.Effects'
|
||||
}
|
||||
};
|
||||
|
||||
static async addEffect() {
|
||||
await this.document.createEmbeddedDocuments('ActiveEffect', [
|
||||
{ name: game.i18n.localize('DAGGERHEART.Feature.NewEffect') }
|
||||
]);
|
||||
}
|
||||
|
||||
static async editEffect(_, target) {
|
||||
const effect = this.document.effects.get(target.dataset.effect);
|
||||
effect.sheet.render(true);
|
||||
}
|
||||
|
||||
static async removeEffect(_, target) {
|
||||
await this.document.effects.get(target.dataset.effect).delete();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue