mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-16 05:31:07 +01:00
Merged with main
This commit is contained in:
commit
45dee57335
15 changed files with 224 additions and 81 deletions
12
lang/en.json
12
lang/en.json
|
|
@ -1099,6 +1099,17 @@
|
||||||
"biography": "Biography",
|
"biography": "Biography",
|
||||||
"effects": "Effects"
|
"effects": "Effects"
|
||||||
},
|
},
|
||||||
|
"ContextMenu": {
|
||||||
|
"UseItem": "Use",
|
||||||
|
"Equip": "Equip",
|
||||||
|
"Unequip": "Unequip",
|
||||||
|
"Edit": "Edit",
|
||||||
|
"Delete": "Delete",
|
||||||
|
"ToLoadout": "Send to Loadout",
|
||||||
|
"ToVault": "Send to Vault",
|
||||||
|
"Consume": "Consume Item",
|
||||||
|
"SendToChat": "Send To Chat"
|
||||||
|
},
|
||||||
"Armor": {
|
"Armor": {
|
||||||
"Title": "Active Armor"
|
"Title": "Active Armor"
|
||||||
},
|
},
|
||||||
|
|
@ -1295,6 +1306,7 @@
|
||||||
"Severe": "Severe"
|
"Severe": "Severe"
|
||||||
},
|
},
|
||||||
"Evasion": "Evasion",
|
"Evasion": "Evasion",
|
||||||
|
"HitPoints": "Hit Points",
|
||||||
"ClassFeatures": "Class Features",
|
"ClassFeatures": "Class Features",
|
||||||
"Subclasses": "Subclasses",
|
"Subclasses": "Subclasses",
|
||||||
"Guide": {
|
"Guide": {
|
||||||
|
|
|
||||||
|
|
@ -44,10 +44,11 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) {
|
||||||
makeDeathMove: this.makeDeathMove,
|
makeDeathMove: this.makeDeathMove,
|
||||||
itemQuantityDecrease: (_, button) => this.setItemQuantity(button, -1),
|
itemQuantityDecrease: (_, button) => this.setItemQuantity(button, -1),
|
||||||
itemQuantityIncrease: (_, button) => this.setItemQuantity(button, 1),
|
itemQuantityIncrease: (_, button) => this.setItemQuantity(button, 1),
|
||||||
useAbility: this.useAbility,
|
toChat: this.toChat,
|
||||||
useAdvancementCard: this.useAdvancementCard,
|
useAdvancementCard: this.useAdvancementCard,
|
||||||
useAdvancementAbility: this.useAdvancementAbility,
|
useAdvancementAbility: this.useAdvancementAbility,
|
||||||
toggleEquipItem: this.toggleEquipItem,
|
toggleEquipItem: this.toggleEquipItem,
|
||||||
|
toggleVault: this.toggleVault,
|
||||||
levelManagement: this.levelManagement,
|
levelManagement: this.levelManagement,
|
||||||
editImage: this._onEditImage
|
editImage: this._onEditImage
|
||||||
},
|
},
|
||||||
|
|
@ -59,11 +60,7 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) {
|
||||||
submitOnChange: true,
|
submitOnChange: true,
|
||||||
closeOnSubmit: false
|
closeOnSubmit: false
|
||||||
},
|
},
|
||||||
dragDrop: [
|
dragDrop: []
|
||||||
{ dragSelector: null, dropSelector: '.weapon-section' },
|
|
||||||
{ dragSelector: null, dropSelector: '.armor-section' },
|
|
||||||
{ dragSelector: '.item-list .item', dropSelector: null }
|
|
||||||
]
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static PARTS = {
|
static PARTS = {
|
||||||
|
|
@ -215,6 +212,109 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) {
|
||||||
return { primary: primaryTabs, secondary: secondaryTabs };
|
return { primary: primaryTabs, secondary: secondaryTabs };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async _onFirstRender(context, options) {
|
||||||
|
await super._onFirstRender(context, options);
|
||||||
|
|
||||||
|
this._createContextMenues();
|
||||||
|
}
|
||||||
|
|
||||||
|
_createContextMenues() {
|
||||||
|
const allOptions = {
|
||||||
|
useItem: {
|
||||||
|
name: 'DAGGERHEART.Sheets.PC.ContextMenu.UseItem',
|
||||||
|
icon: '<i class="fa-solid fa-burst"></i>',
|
||||||
|
callback: this.constructor.useItem.bind(this)
|
||||||
|
},
|
||||||
|
equip: {
|
||||||
|
name: 'DAGGERHEART.Sheets.PC.ContextMenu.Equip',
|
||||||
|
icon: '<i class="fa-solid fa-hands"></i>',
|
||||||
|
condition: el => {
|
||||||
|
const item = foundry.utils.fromUuidSync(el.dataset.uuid);
|
||||||
|
return !item.system.equipped;
|
||||||
|
},
|
||||||
|
callback: this.constructor.toggleEquipItem.bind(this)
|
||||||
|
},
|
||||||
|
unequip: {
|
||||||
|
name: 'DAGGERHEART.Sheets.PC.ContextMenu.Unequip',
|
||||||
|
icon: '<i class="fa-solid fa-hands"></i>',
|
||||||
|
condition: el => {
|
||||||
|
const item = foundry.utils.fromUuidSync(el.dataset.uuid);
|
||||||
|
return item.system.equipped;
|
||||||
|
},
|
||||||
|
callback: this.constructor.toggleEquipItem.bind(this)
|
||||||
|
},
|
||||||
|
edit: {
|
||||||
|
name: 'DAGGERHEART.Sheets.PC.ContextMenu.Edit',
|
||||||
|
icon: '<i class="fa-solid fa-pen-to-square"></i>',
|
||||||
|
callback: this.constructor.viewObject.bind(this)
|
||||||
|
},
|
||||||
|
delete: {
|
||||||
|
name: 'DAGGERHEART.Sheets.PC.ContextMenu.Delete',
|
||||||
|
icon: '<i class="fa-solid fa-trash"></i>',
|
||||||
|
callback: this.constructor.deleteItem.bind(this)
|
||||||
|
},
|
||||||
|
sendToLoadout: {
|
||||||
|
name: 'DAGGERHEART.Sheets.PC.ContextMenu.ToLoadout',
|
||||||
|
icon: '<i class="fa-solid fa-arrow-up"></i>',
|
||||||
|
condition: el => {
|
||||||
|
const item = foundry.utils.fromUuidSync(el.dataset.uuid);
|
||||||
|
return item.system.inVault;
|
||||||
|
},
|
||||||
|
callback: this.constructor.toggleVault.bind(this)
|
||||||
|
},
|
||||||
|
sendToVault: {
|
||||||
|
name: 'DAGGERHEART.Sheets.PC.ContextMenu.ToVault',
|
||||||
|
icon: '<i class="fa-solid fa-arrow-down"></i>',
|
||||||
|
condition: el => {
|
||||||
|
const item = foundry.utils.fromUuidSync(el.dataset.uuid);
|
||||||
|
return !item.system.inVault;
|
||||||
|
},
|
||||||
|
callback: this.constructor.toggleVault.bind(this)
|
||||||
|
},
|
||||||
|
sendToChat: {
|
||||||
|
name: 'DAGGERHEART.Sheets.PC.ContextMenu.SendToChat',
|
||||||
|
icon: '<i class="fa-regular fa-message"></i>',
|
||||||
|
callback: this.constructor.toChat.bind(this)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const getMenuOptions = type => () => {
|
||||||
|
let menuItems = ['class', 'subclass'].includes(type) ? [] : [allOptions.useItem];
|
||||||
|
switch (type) {
|
||||||
|
case 'weapon':
|
||||||
|
case 'armor':
|
||||||
|
menuItems.push(...[allOptions.equip, allOptions.unequip]);
|
||||||
|
break;
|
||||||
|
case 'domainCard':
|
||||||
|
menuItems.push(...[allOptions.sendToLoadout, allOptions.sendToVault]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
menuItems.push(...[allOptions.sendToChat, allOptions.edit, allOptions.delete]);
|
||||||
|
|
||||||
|
return menuItems;
|
||||||
|
};
|
||||||
|
|
||||||
|
const menuConfigs = [
|
||||||
|
'armor',
|
||||||
|
'weapon',
|
||||||
|
'miscellaneous',
|
||||||
|
'consumable',
|
||||||
|
'domainCard',
|
||||||
|
'miscellaneous',
|
||||||
|
'ancestry',
|
||||||
|
'community',
|
||||||
|
'class',
|
||||||
|
'subclass'
|
||||||
|
];
|
||||||
|
menuConfigs.forEach(type => {
|
||||||
|
this._createContextMenu(getMenuOptions(type), `.${type}-context-menu`, {
|
||||||
|
eventName: 'click',
|
||||||
|
parentClassHooks: false,
|
||||||
|
fixed: true
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
_attachPartListeners(partId, htmlElement, options) {
|
_attachPartListeners(partId, htmlElement, options) {
|
||||||
super._attachPartListeners(partId, htmlElement, options);
|
super._attachPartListeners(partId, htmlElement, options);
|
||||||
|
|
||||||
|
|
@ -552,20 +652,14 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) {
|
||||||
(await game.packs.get('daggerheart.communities'))?.render(true);
|
(await game.packs.get('daggerheart.communities'))?.render(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static useItem(event) {
|
static useItem(element, button) {
|
||||||
const uuid = event.target.closest('[data-item-id]').dataset.itemId,
|
const id = (button ?? element).closest('a').id,
|
||||||
item = this.document.items.find(i => i.uuid === uuid);
|
item = this.document.items.get(id);
|
||||||
item.use(event);
|
item.use({});
|
||||||
}
|
}
|
||||||
|
|
||||||
static async viewObject(_, button) {
|
static async viewObject(element, button) {
|
||||||
const object = await fromUuid(button.dataset.value);
|
const object = await fromUuid((button ?? element).dataset.uuid);
|
||||||
if (!object) return;
|
|
||||||
|
|
||||||
const tab = button.dataset.tab;
|
|
||||||
if (tab && object.sheet._tabs) object.sheet._tabs[0].active = tab;
|
|
||||||
|
|
||||||
if (object.sheet.editMode) object.sheet.editMode = false;
|
|
||||||
|
|
||||||
object.sheet.render(true);
|
object.sheet.render(true);
|
||||||
}
|
}
|
||||||
|
|
@ -628,8 +722,8 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) {
|
||||||
this.render();
|
this.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
static async deleteItem(_, button) {
|
static async deleteItem(element, button) {
|
||||||
const item = await fromUuid($(button).closest('[data-item-id]')[0].dataset.itemId);
|
const item = await fromUuid((button ?? element).closest('a').dataset.uuid);
|
||||||
await item.delete();
|
await item.delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -663,35 +757,29 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) {
|
||||||
cls.create(msg.toObject());
|
cls.create(msg.toObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
static async useAbility(_, button) {
|
static async toChat(element, button) {
|
||||||
const item = await fromUuid(button.dataset.feature);
|
if (button?.dataset?.type === 'experience') {
|
||||||
const type = button.dataset.type;
|
const experience = this.document.system.experiences[button.dataset.uuid];
|
||||||
|
const cls = getDocumentClass('ChatMessage');
|
||||||
|
const systemData = {
|
||||||
|
name: game.i18n.localize('DAGGERHEART.General.Experience.Single'),
|
||||||
|
description: `${experience.description} ${experience.total < 0 ? experience.total : `+${experience.total}`}`
|
||||||
|
};
|
||||||
|
const msg = new cls({
|
||||||
|
type: 'abilityUse',
|
||||||
|
user: game.user.id,
|
||||||
|
system: systemData,
|
||||||
|
content: await foundry.applications.handlebars.renderTemplate(
|
||||||
|
'systems/daggerheart/templates/chat/ability-use.hbs',
|
||||||
|
systemData
|
||||||
|
)
|
||||||
|
});
|
||||||
|
|
||||||
const cls = getDocumentClass('ChatMessage');
|
cls.create(msg.toObject());
|
||||||
const systemData = {
|
} else {
|
||||||
title:
|
const item = await fromUuid((button ?? element).dataset.uuid);
|
||||||
type === 'ancestry'
|
item.toChat(this.document.id);
|
||||||
? game.i18n.localize('DAGGERHEART.Chat.FoundationCard.AncestryTitle')
|
}
|
||||||
: type === 'community'
|
|
||||||
? game.i18n.localize('DAGGERHEART.Chat.FoundationCard.CommunityTitle')
|
|
||||||
: game.i18n.localize('DAGGERHEART.Chat.FoundationCard.SubclassFeatureTitle'),
|
|
||||||
origin: this.document.id,
|
|
||||||
img: item.img,
|
|
||||||
name: item.name,
|
|
||||||
description: item.system.description,
|
|
||||||
actions: []
|
|
||||||
};
|
|
||||||
const msg = new cls({
|
|
||||||
type: 'abilityUse',
|
|
||||||
user: game.user.id,
|
|
||||||
system: systemData,
|
|
||||||
content: await foundry.applications.handlebars.renderTemplate(
|
|
||||||
'systems/daggerheart/templates/chat/ability-use.hbs',
|
|
||||||
systemData
|
|
||||||
)
|
|
||||||
});
|
|
||||||
|
|
||||||
cls.create(msg.toObject());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static async useAdvancementCard(_, button) {
|
static async useAdvancementCard(_, button) {
|
||||||
|
|
@ -746,8 +834,9 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) {
|
||||||
cls.create(msg.toObject());
|
cls.create(msg.toObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
static async toggleEquipItem(_, button) {
|
static async toggleEquipItem(element, button) {
|
||||||
const item = this.document.items.get(button.id);
|
const id = (button ?? element).closest('a').id;
|
||||||
|
const item = this.document.items.get(id);
|
||||||
if (item.system.equipped) {
|
if (item.system.equipped) {
|
||||||
await item.update({ 'system.equipped': false });
|
await item.update({ 'system.equipped': false });
|
||||||
return;
|
return;
|
||||||
|
|
@ -771,6 +860,12 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) {
|
||||||
this.render();
|
this.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static async toggleVault(element, button) {
|
||||||
|
const id = (button ?? element).closest('a').id;
|
||||||
|
const item = this.document.items.get(id);
|
||||||
|
await item.update({ 'system.inVault': !item.system.inVault });
|
||||||
|
}
|
||||||
|
|
||||||
async _onDragStart(_, event) {
|
async _onDragStart(_, event) {
|
||||||
super._onDragStart(event);
|
super._onDragStart(event);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,56 +2,55 @@ export const domains = {
|
||||||
arcana: {
|
arcana: {
|
||||||
id: 'arcana',
|
id: 'arcana',
|
||||||
label: 'DAGGERHEART.Domains.arcana.label',
|
label: 'DAGGERHEART.Domains.arcana.label',
|
||||||
src: 'icons/magic/symbols/circled-gem-pink.webp',
|
src: 'systems/daggerheart/assets/icons/domains/arcana.svg',
|
||||||
description: 'DAGGERHEART.Domains.Arcana'
|
description: 'DAGGERHEART.Domains.Arcana'
|
||||||
},
|
},
|
||||||
blade: {
|
blade: {
|
||||||
id: 'blade',
|
id: 'blade',
|
||||||
label: 'DAGGERHEART.Domains.blade.label',
|
label: 'DAGGERHEART.Domains.blade.label',
|
||||||
src: 'icons/weapons/swords/sword-broad-crystal-paired.webp',
|
src: 'systems/daggerheart/assets/icons/domains/blade.svg',
|
||||||
description: 'DAGGERHEART.Domains.Blade'
|
description: 'DAGGERHEART.Domains.Blade'
|
||||||
},
|
},
|
||||||
bone: {
|
bone: {
|
||||||
id: 'bone',
|
id: 'bone',
|
||||||
label: 'DAGGERHEART.Domains.bone.label',
|
label: 'DAGGERHEART.Domains.bone.label',
|
||||||
src: 'icons/skills/wounds/bone-broken-marrow-red.webp',
|
src: 'systems/daggerheart/assets/icons/domains/bone.svg',
|
||||||
description: 'DAGGERHEART.Domains.Bone'
|
description: 'DAGGERHEART.Domains.Bone'
|
||||||
},
|
},
|
||||||
codex: {
|
codex: {
|
||||||
id: 'codex',
|
id: 'codex',
|
||||||
label: 'DAGGERHEART.Domains.codex.label',
|
label: 'DAGGERHEART.Domains.codex.label',
|
||||||
src: 'icons/sundries/books/book-embossed-jewel-gold-purple.webp',
|
src: 'systems/daggerheart/assets/icons/domains/codex.svg',
|
||||||
description: 'DAGGERHEART.Domains.Codex'
|
description: 'DAGGERHEART.Domains.Codex'
|
||||||
},
|
},
|
||||||
grace: {
|
grace: {
|
||||||
id: 'grace',
|
id: 'grace',
|
||||||
label: 'DAGGERHEART.Domains.grace.label',
|
label: 'DAGGERHEART.Domains.grace.label',
|
||||||
src: 'icons/skills/movement/feet-winged-boots-glowing-yellow.webp',
|
src: 'systems/daggerheart/assets/icons/domains/grace.svg',
|
||||||
description: 'DAGGERHEART.Domains.Grace'
|
description: 'DAGGERHEART.Domains.Grace'
|
||||||
},
|
},
|
||||||
midnight: {
|
midnight: {
|
||||||
id: 'midnight',
|
id: 'midnight',
|
||||||
label: 'DAGGERHEART.Domains.midnight.label',
|
label: 'DAGGERHEART.Domains.midnight.label',
|
||||||
src: 'icons/environment/settlement/watchtower-castle-night.webp',
|
src: 'systems/daggerheart/assets/icons/domains/midnight.svg',
|
||||||
background: 'systems/daggerheart/assets/backgrounds/MidnightBackground.webp',
|
|
||||||
description: 'DAGGERHEART.Domains.Midnight'
|
description: 'DAGGERHEART.Domains.Midnight'
|
||||||
},
|
},
|
||||||
sage: {
|
sage: {
|
||||||
id: 'sage',
|
id: 'sage',
|
||||||
label: 'DAGGERHEART.Domains.sage.label',
|
label: 'DAGGERHEART.Domains.sage.label',
|
||||||
src: 'icons/sundries/misc/pipe-wooden-straight-brown.webp',
|
src: 'systems/daggerheart/assets/icons/domains/sage.svg',
|
||||||
description: 'DAGGERHEART.Domains.Sage'
|
description: 'DAGGERHEART.Domains.Sage'
|
||||||
},
|
},
|
||||||
splendor: {
|
splendor: {
|
||||||
id: 'splendor',
|
id: 'splendor',
|
||||||
label: 'DAGGERHEART.Domains.splendor.label',
|
label: 'DAGGERHEART.Domains.splendor.label',
|
||||||
src: 'icons/magic/control/control-influence-crown-gold.webp',
|
src: 'systems/daggerheart/assets/icons/domains/splendor.svg',
|
||||||
description: 'DAGGERHEART.Domains.Splendor'
|
description: 'DAGGERHEART.Domains.Splendor'
|
||||||
},
|
},
|
||||||
valor: {
|
valor: {
|
||||||
id: 'valor',
|
id: 'valor',
|
||||||
label: 'DAGGERHEART.Domains.valor.label',
|
label: 'DAGGERHEART.Domains.valor.label',
|
||||||
src: 'icons/magic/control/control-influence-rally-purple.webp',
|
src: 'systems/daggerheart/assets/icons/domains/valor.svg',
|
||||||
description: 'DAGGERHEART.Domains.Valor'
|
description: 'DAGGERHEART.Domains.Valor'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,10 @@ export default class DhCharacter extends BaseDataActor {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
resources: new fields.SchemaField({
|
resources: new fields.SchemaField({
|
||||||
hitPoints: resourceField(6),
|
hitPoints: new fields.SchemaField({
|
||||||
|
value: new foundry.data.fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
bonus: new foundry.data.fields.NumberField({ initial: 0, integer: true })
|
||||||
|
}),
|
||||||
stress: resourceField(6),
|
stress: resourceField(6),
|
||||||
hope: resourceField(6)
|
hope: resourceField(6)
|
||||||
}),
|
}),
|
||||||
|
|
@ -243,7 +246,7 @@ export default class DhCharacter extends BaseDataActor {
|
||||||
experience.total = experience.value + experience.bonus;
|
experience.total = experience.value + experience.bonus;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.resources.hitPoints.maxTotal = this.resources.hitPoints.max + this.resources.hitPoints.bonus;
|
this.resources.hitPoints.maxTotal = (this.class.value?.system?.hitPoints ?? 0) + this.resources.hitPoints.bonus;
|
||||||
this.resources.stress.maxTotal = this.resources.stress.max + this.resources.stress.bonus;
|
this.resources.stress.maxTotal = this.resources.stress.max + this.resources.stress.bonus;
|
||||||
this.evasion.total = (this.class?.evasion ?? 0) + this.evasion.bonus;
|
this.evasion.total = (this.class?.evasion ?? 0) + this.evasion.bonus;
|
||||||
this.proficiency.total = this.proficiency.value + this.proficiency.bonus;
|
this.proficiency.total = this.proficiency.value + this.proficiency.bonus;
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,14 @@ export default class DHClass extends BaseDataItem {
|
||||||
...super.defineSchema(),
|
...super.defineSchema(),
|
||||||
domains: new fields.ArrayField(new fields.StringField(), { max: 2 }),
|
domains: new fields.ArrayField(new fields.StringField(), { max: 2 }),
|
||||||
classItems: new ForeignDocumentUUIDArrayField({ type: 'Item', required: false }),
|
classItems: new ForeignDocumentUUIDArrayField({ type: 'Item', required: false }),
|
||||||
|
hitPoints: new fields.NumberField({
|
||||||
evasion: new fields.NumberField({ initial: 0, integer: true }),
|
required: true,
|
||||||
|
integer: true,
|
||||||
|
min: 1,
|
||||||
|
initial: 5,
|
||||||
|
label: 'DAGGERHEART.Sheets.Class.HitPoints'
|
||||||
|
}),
|
||||||
|
evasion: new fields.NumberField({ initial: 0, integer: true, label: 'DAGGERHEART.Sheets.Class.Evasion' }),
|
||||||
hopeFeatures: new foundry.data.fields.ArrayField(new ActionField()),
|
hopeFeatures: new foundry.data.fields.ArrayField(new ActionField()),
|
||||||
classFeatures: new foundry.data.fields.ArrayField(new ActionField()),
|
classFeatures: new foundry.data.fields.ArrayField(new ActionField()),
|
||||||
subclasses: new ForeignDocumentUUIDArrayField({ type: 'Item', required: false }),
|
subclasses: new ForeignDocumentUUIDArrayField({ type: 'Item', required: false }),
|
||||||
|
|
|
||||||
|
|
@ -141,4 +141,32 @@ export default class DhpItem extends Item {
|
||||||
// Display Item Card in chat
|
// Display Item Card in chat
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async toChat(origin) {
|
||||||
|
const cls = getDocumentClass('ChatMessage');
|
||||||
|
const systemData = {
|
||||||
|
title:
|
||||||
|
this.type === 'ancestry'
|
||||||
|
? game.i18n.localize('DAGGERHEART.Chat.FoundationCard.AncestryTitle')
|
||||||
|
: this.type === 'community'
|
||||||
|
? game.i18n.localize('DAGGERHEART.Chat.FoundationCard.CommunityTitle')
|
||||||
|
: game.i18n.localize('DAGGERHEART.Chat.FoundationCard.SubclassFeatureTitle'),
|
||||||
|
origin: origin,
|
||||||
|
img: this.img,
|
||||||
|
name: this.name,
|
||||||
|
description: this.system.description,
|
||||||
|
actions: []
|
||||||
|
};
|
||||||
|
const msg = new cls({
|
||||||
|
type: 'abilityUse',
|
||||||
|
user: game.user.id,
|
||||||
|
system: systemData,
|
||||||
|
content: await foundry.applications.handlebars.renderTemplate(
|
||||||
|
'systems/daggerheart/templates/chat/ability-use.hbs',
|
||||||
|
systemData
|
||||||
|
)
|
||||||
|
});
|
||||||
|
|
||||||
|
cls.create(msg.toObject());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -283,6 +283,7 @@
|
||||||
h2 {
|
h2 {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
margin: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1598,6 +1598,7 @@
|
||||||
.daggerheart.chat.domain-card .domain-card-title h2 {
|
.daggerheart.chat.domain-card .domain-card-title h2 {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
margin: 0;
|
||||||
}
|
}
|
||||||
.daggerheart.chat.domain-card .ability-card-footer {
|
.daggerheart.chat.domain-card .ability-card-footer {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
<div class="daggerheart chat domain-card">
|
<div class="daggerheart chat domain-card">
|
||||||
<div class="domain-card-title">
|
<div class="domain-card-title">
|
||||||
<div>{{title}}</div>
|
|
||||||
<h2>{{name}}</h2>
|
<h2>{{name}}</h2>
|
||||||
</div>
|
</div>
|
||||||
<img src="{{img}}" />
|
<img src="{{img}}" />
|
||||||
|
|
|
||||||
|
|
@ -29,9 +29,9 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if this.abilities.loadout.listView}}
|
{{#if this.abilities.loadout.listView}}
|
||||||
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize 'DAGGERHEART.Sheets.PC.Tabs.Vault') type='domainCard' isGlassy=true cardView='list'}}
|
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize 'DAGGERHEART.Sheets.PC.Tabs.Vault') type='domainCard' isVault=true isGlassy=true cardView='list'}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize 'DAGGERHEART.Sheets.PC.Tabs.Vault') type='domainCard' isGlassy=true cardView='card'}}
|
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize 'DAGGERHEART.Sheets.PC.Tabs.Vault') type='domainCard' isVault=true isGlassy=true cardView='card'}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@
|
||||||
</div>
|
</div>
|
||||||
<input name="{{concat "system.experiences." id ".description"}}" data-experience={{id}} value="{{experience.description}}" type="text" />
|
<input name="{{concat "system.experiences." id ".description"}}" data-experience={{id}} value="{{experience.description}}" type="text" />
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<a><i class="fa-regular fa-message"></i></a>
|
<a data-action="toChat" data-type="experience" data-uuid="{{id}}"><i class="fa-regular fa-message"></i></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<li class="card-item">
|
<li class="card-item">
|
||||||
<img src="{{item.img}}" data-action="viewObject" data-value="{{item.uuid}}" class="card-img" />
|
<img src="{{item.img}}" data-action="viewObject" data-uuid="{{item.uuid}}" class="card-img" />
|
||||||
<div class="card-label">
|
<div class="card-label">
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
{{#if (eq type 'weapon')}}
|
{{#if (eq type 'weapon')}}
|
||||||
|
|
@ -24,8 +24,8 @@
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<a data-tooltip="{{localize 'DAGGERHEART.Tooltip.sendToChat'}}"><i class="fa-regular fa-message"></i></a>
|
<a data-action="toChat" data-uuid="{{item.uuid}}" data-tooltip="{{localize 'DAGGERHEART.Tooltip.sendToChat'}}"><i class="fa-regular fa-message"></i></a>
|
||||||
<a data-tooltip="{{localize 'DAGGERHEART.Tooltip.moreOptions'}}"><i class="fa-solid fa-ellipsis-vertical"></i></a>
|
<a class="{{concat type "-context-menu"}}" data-tooltip="{{localize 'DAGGERHEART.Tooltip.moreOptions'}}"><i class="fa-solid fa-ellipsis-vertical"></i></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-name">{{item.name}}</div>
|
<div class="card-name">{{item.name}}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
{{#unless (eq cardView 'card') }}
|
{{#unless (eq cardView 'card') }}
|
||||||
{{#each document.items as |item|}}
|
{{#each document.items as |item|}}
|
||||||
{{#if (eq item.type ../type)}}
|
{{#if (eq item.type ../type)}}
|
||||||
{{#unless (or (eq ../type 'ancestry') (eq item.type 'class') (eq item.type 'subclass'))}}
|
{{#unless (or (eq ../type 'ancestry') (eq item.type 'class') (eq item.type 'subclass') (and (eq ../type 'domainCard') (or (and item.system.inVault (not ../isVault)) (and (not item.system.inVault) ../isVault))))}}
|
||||||
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-item.hbs' item=item type=../type}}
|
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-item.hbs' item=item type=../type}}
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<li class="inventory-item">
|
<li class="inventory-item">
|
||||||
<img src="{{item.img}}" data-action="viewObject" data-value="{{item.uuid}}" class="item-img" />
|
<img src="{{item.img}}" data-action="viewObject" data-uuid="{{item.uuid}}" class="item-img" />
|
||||||
<div class="item-label">
|
<div class="item-label">
|
||||||
<div class="item-name">{{item.name}}</div>
|
<div class="item-name">{{item.name}}</div>
|
||||||
{{#if (eq type 'weapon')}}
|
{{#if (eq type 'weapon')}}
|
||||||
|
|
@ -114,17 +114,17 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if (eq type 'domainCard')}}
|
{{#if (eq type 'domainCard')}}
|
||||||
{{#unless item.system.inVault}}
|
{{#unless item.system.inVault}}
|
||||||
<a data-action="sendToVault" data-domain="{{card.uuid}}" id="{{item.id}}" data-tooltip="{{localize 'DAGGERHEART.Tooltip.sendToVault'}}">
|
<a data-action="toggleVault" id="{{item.id}}" data-tooltip="{{localize 'DAGGERHEART.Tooltip.sendToVault'}}">
|
||||||
<i class="fa-solid fa-arrow-down"></i>
|
<i class="fa-solid fa-arrow-down"></i>
|
||||||
</a>
|
</a>
|
||||||
{{else}}
|
{{else}}
|
||||||
<a data-action="sendToLoadout" data-domain="{{card.uuid}}" id="{{item.id}}" data-tooltip="{{localize 'DAGGERHEART.Tooltip.sendToLoadout'}}">
|
<a data-action="toggleVault" id="{{item.id}}" data-tooltip="{{localize 'DAGGERHEART.Tooltip.sendToLoadout'}}">
|
||||||
<i class="fa-solid fa-arrow-up"></i>
|
<i class="fa-solid fa-arrow-up"></i>
|
||||||
</a>
|
</a>
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<a data-tooltip="{{localize 'DAGGERHEART.Tooltip.sendToChat'}}"><i class="fa-regular fa-message"></i></a>
|
<a data-action="toChat" data-uuid="{{item.uuid}}" data-tooltip="{{localize 'DAGGERHEART.Tooltip.sendToChat'}}"><i class="fa-regular fa-message"></i></a>
|
||||||
<a data-tooltip="{{localize 'DAGGERHEART.Tooltip.moreOptions'}}"><i class="fa-solid fa-ellipsis-vertical"></i></a>
|
<a class="{{concat type '-context-menu'}}" data-type="{{type}}" data-uuid="{{item.uuid}}" id="{{item.id}}" data-tooltip="{{localize 'DAGGERHEART.Tooltip.moreOptions'}}"><i class="fa-solid fa-ellipsis-vertical"></i></a>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
@ -3,11 +3,10 @@
|
||||||
data-tab='{{tabs.settings.id}}'
|
data-tab='{{tabs.settings.id}}'
|
||||||
data-group='{{tabs.settings.group}}'
|
data-group='{{tabs.settings.group}}'
|
||||||
>
|
>
|
||||||
|
<fieldset class="two-columns even">
|
||||||
<fieldset class="two-columns">
|
|
||||||
<legend>{{localize tabs.settings.label}}</legend>
|
<legend>{{localize tabs.settings.label}}</legend>
|
||||||
<span>{{localize "DAGGERHEART.Sheets.Class.Evasion"}}</span>
|
{{formGroup systemFields.hitPoints value=source.system.hitPoints localize=true}}
|
||||||
{{formField systemFields.evasion value=source.system.evasion}}
|
{{formGroup systemFields.evasion value=source.system.evasion localize=true}}
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<div class="fieldsets-section">
|
<div class="fieldsets-section">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue