From c34c923406f7d88411e2f0cc4eb083235cfaf2c2 Mon Sep 17 00:00:00 2001 From: Murilo Brito <91566541+moliloo@users.noreply.github.com> Date: Thu, 29 May 2025 07:07:09 -0300 Subject: [PATCH] enhance card items (#75) --- daggerheart.mjs | 3 +- lang/en.json | 11 +- module/applications/_module.mjs | 6 +- module/applications/sheets/ancestry.mjs | 122 ----------- module/applications/sheets/community.mjs | 122 ----------- module/applications/sheets/items/ancestry.mjs | 88 ++++++++ module/applications/sheets/items/armor.mjs | 2 +- .../applications/sheets/items/community.mjs | 88 ++++++++ .../applications/sheets/items/consumable.mjs | 2 +- .../sheets/{ => items}/domainCard.mjs | 93 ++++---- module/applications/sheets/items/feature.mjs | 4 +- .../sheets/items/miscellaneous.mjs | 24 +-- module/applications/sheets/items/weapon.mjs | 2 +- module/config/domainConfig.mjs | 6 +- styles/daggerheart.css | 203 +++++++++++++++--- styles/daggerheart.less | 4 + styles/less/global/feature-section.less | 51 +++++ styles/less/global/item-header.less | 99 +++++++++ styles/less/global/sheet.less | 1 - styles/less/global/tab-actions.less | 46 ++++ styles/less/items/domainCard.less | 12 ++ styles/less/items/feature.less | 42 ---- templates/sheets/ancestry.hbs | 11 - templates/sheets/community.hbs | 11 - templates/sheets/domainCard.hbs | 101 --------- .../global/partials/feature-section-item.hbs | 28 +++ .../tabs/tab-actions.hbs} | 0 .../sheets/global/tabs/tab-description.hbs | 1 + .../global/tabs/tab-feature-section.hbs | 14 ++ templates/sheets/items/ancestry/header.hbs | 9 + templates/sheets/items/community/header.hbs | 9 + templates/sheets/items/domainCard/header.hbs | 26 +++ .../sheets/items/domainCard/settings.hbs | 20 ++ 33 files changed, 727 insertions(+), 534 deletions(-) delete mode 100644 module/applications/sheets/ancestry.mjs delete mode 100644 module/applications/sheets/community.mjs create mode 100644 module/applications/sheets/items/ancestry.mjs create mode 100644 module/applications/sheets/items/community.mjs rename module/applications/sheets/{ => items}/domainCard.mjs (51%) create mode 100644 styles/less/global/feature-section.less create mode 100644 styles/less/global/tab-actions.less create mode 100644 styles/less/items/domainCard.less delete mode 100644 templates/sheets/ancestry.hbs delete mode 100644 templates/sheets/community.hbs delete mode 100644 templates/sheets/domainCard.hbs create mode 100644 templates/sheets/global/partials/feature-section-item.hbs rename templates/sheets/{items/feature/actions.hbs => global/tabs/tab-actions.hbs} (100%) mode change 100755 => 100644 create mode 100644 templates/sheets/global/tabs/tab-feature-section.hbs create mode 100644 templates/sheets/items/ancestry/header.hbs create mode 100644 templates/sheets/items/community/header.hbs create mode 100644 templates/sheets/items/domainCard/header.hbs create mode 100644 templates/sheets/items/domainCard/settings.hbs diff --git a/daggerheart.mjs b/daggerheart.mjs index 65084450..a431f058 100644 --- a/daggerheart.mjs +++ b/daggerheart.mjs @@ -284,6 +284,7 @@ const preloadHandlebarsTemplates = async function () { 'systems/daggerheart/templates/sheets/pc/parts/heritageCard.hbs', 'systems/daggerheart/templates/sheets/pc/parts/advancementCard.hbs', 'systems/daggerheart/templates/views/parts/level.hbs', - 'systems/daggerheart/templates/components/slider.hbs' + 'systems/daggerheart/templates/components/slider.hbs', + 'systems/daggerheart/templates/sheets/global/partials/feature-section-item.hbs' ]); }; diff --git a/lang/en.json b/lang/en.json index 85c98ba6..684fa06f 100755 --- a/lang/en.json +++ b/lang/en.json @@ -316,9 +316,9 @@ }, "Domain": { "CardTypes": { - "Ability": "Ability", - "Spell": "Spell", - "Grimoire": "Grimoire" + "ability": "Ability", + "spell": "Spell", + "grimoire": "Grimoire" } }, "LevelUp": { @@ -1105,6 +1105,11 @@ "Name": "Damage Roll" } } + }, + + "Tooltip": { + "openItemWorld": "Open Item World", + "delete": "Delete" } } } diff --git a/module/applications/_module.mjs b/module/applications/_module.mjs index cc1bc90e..21af5efb 100644 --- a/module/applications/_module.mjs +++ b/module/applications/_module.mjs @@ -3,9 +3,9 @@ export { default as DhpAdversarySheet } from './sheets/adversary.mjs'; export { default as DhpClassSheet } from './sheets/class.mjs'; export { default as DhpSubclass } from './sheets/subclass.mjs'; export { default as DhpFeatureSheet } from './sheets/items/feature.mjs'; -export { default as DhpDomainCardSheet } from './sheets/domainCard.mjs'; -export { default as DhpAncestry } from './sheets/ancestry.mjs'; -export { default as DhpCommunity } from './sheets/community.mjs'; +export { default as DhpDomainCardSheet } from './sheets/items/domainCard.mjs'; +export { default as DhpAncestry } from './sheets/items/ancestry.mjs'; +export { default as DhpCommunity } from './sheets/items/community.mjs'; export { default as DhpMiscellaneous } from './sheets/items/miscellaneous.mjs'; export { default as DhpConsumable } from './sheets/items/consumable.mjs'; export { default as DhpWeapon } from './sheets/items/weapon.mjs'; diff --git a/module/applications/sheets/ancestry.mjs b/module/applications/sheets/ancestry.mjs deleted file mode 100644 index 51962c9c..00000000 --- a/module/applications/sheets/ancestry.mjs +++ /dev/null @@ -1,122 +0,0 @@ -// import DhpApplicationMixin from '../daggerheart-sheet.mjs'; - -// export default class AncestrySheet extends DhpApplicationMixin(ItemSheet) { -// static documentType = "ancestry"; - -// constructor(options){ -// super(options); -// } - -// /** @override */ -// static get defaultOptions() { -// return foundry.utils.mergeObject(super.defaultOptions, { -// classes: ["daggerheart", "sheet", "heritage"], -// width: 600, -// height: 'auto', -// dragDrop: [{ dragSelector: null, dropSelector: null }], -// }); -// } - -// /** @override */ -// getData() { -// const context = super.getData(); - -// return context; -// } - -// async _handleAction(action, event, button) { -// switch(action){ -// case 'editAbility': -// this.editAbility(button); -// break; -// case 'deleteAbility': -// this.deleteAbility(event); -// break; -// } -// } - -// async editAbility(button){ -// const feature = await fromUuid(button.dataset.ability); -// feature.sheet.render(true); -// } - -// async deleteAbility(event){ -// event.preventDefault(); -// event.stopPropagation(); -// await this.item.update({ "system.abilities": this.item.system.abilities.filter(x => x.uuid !== event.currentTarget.dataset.ability) }) -// } - -// async _onDrop(event) { -// const data = TextEditor.getDragEventData(event); -// const item = await fromUuid(data.uuid); -// if(item.type === 'feature' && item.system.type === SYSTEM.ITEM.featureTypes.ancestry.id) { -// await this.object.update({ "system.abilities": [...this.item.system.abilities, { img: item.img, name: item.name, uuid: item.uuid }] }); -// } -// } -// } - -import DaggerheartSheet from './daggerheart-sheet.mjs'; - -const { ItemSheetV2 } = foundry.applications.sheets; -export default class AncestrySheet extends DaggerheartSheet(ItemSheetV2) { - static DEFAULT_OPTIONS = { - tag: 'form', - classes: ['daggerheart', 'sheet', 'heritage'], - position: { width: 600 }, - actions: { - editAbility: this.editAbility, - deleteAbility: this.deleteAbility - }, - form: { - handler: this.updateForm, - submitOnChange: true, - closeOnSubmit: false - }, - dragDrop: [{ dragSelector: null, dropSelector: null }] - }; - - static PARTS = { - form: { - id: 'feature', - template: 'systems/daggerheart/templates/sheets/ancestry.hbs' - } - }; - - async _prepareContext(_options) { - const context = await super._prepareContext(_options); - context.document = this.document; - - return context; - } - - static async updateForm(event, _, formData) { - await this.document.update(formData.object); - this.render(); - } - - static async editAbility(_, button) { - const feature = await fromUuid(button.dataset.ability); - feature.sheet.render(true); - } - - static async deleteAbility(event, button) { - event.preventDefault(); - event.stopPropagation(); - await this.item.update({ - 'system.abilities': this.item.system.abilities.filter(x => x.uuid !== button.dataset.ability) - }); - } - - async _onDrop(event) { - const data = TextEditor.getDragEventData(event); - const item = await fromUuid(data.uuid); - if (item.type === 'feature' && item.system.type === SYSTEM.ITEM.featureTypes.ancestry.id) { - await this.document.update({ - 'system.abilities': [ - ...this.document.system.abilities, - { img: item.img, name: item.name, uuid: item.uuid } - ] - }); - } - } -} diff --git a/module/applications/sheets/community.mjs b/module/applications/sheets/community.mjs deleted file mode 100644 index f2bdf1ff..00000000 --- a/module/applications/sheets/community.mjs +++ /dev/null @@ -1,122 +0,0 @@ -// import DhpApplicationMixin from '../daggerheart-sheet.mjs'; - -// export default class CommunitySheet extends DhpApplicationMixin(ItemSheet) { -// static documentType = "community"; - -// constructor(options){ -// super(options); -// } - -// /** @override */ -// static get defaultOptions() { -// return foundry.utils.mergeObject(super.defaultOptions, { -// classes: ["daggerheart", "sheet", "heritage"], -// width: 600, -// height: 'auto', -// dragDrop: [{ dragSelector: null, dropSelector: null }], -// }); -// } - -// /** @override */ -// getData() { -// const context = super.getData(); - -// return context; -// } - -// async _handleAction(action, event, button) { -// switch(action){ -// case 'editAbility': -// this.editAbility(button); -// break; -// case 'deleteAbility': -// this.deleteAbility(event); -// break; -// } -// } - -// async editAbility(button){ -// const feature = await fromUuid(button.dataset.ability); -// feature.sheet.render(true); -// } - -// async deleteAbility(event){ -// event.preventDefault(); -// event.stopPropagation(); -// await this.item.update({ "system.abilities": this.item.system.abilities.filter(x => x.uuid !== event.currentTarget.dataset.ability) }) -// } - -// async _onDrop(event) { -// const data = TextEditor.getDragEventData(event); -// const item = await fromUuid(data.uuid); -// if(item.type === 'feature' && item.system.type === SYSTEM.ITEM.featureTypes.community.id) { -// await this.object.update({ "system.abilities": [...this.item.system.abilities, { img: item.img, name: item.name, uuid: item.uuid }] }); -// } -// } -// } - -import DaggerheartSheet from './daggerheart-sheet.mjs'; - -const { ItemSheetV2 } = foundry.applications.sheets; -export default class CommunitySheet extends DaggerheartSheet(ItemSheetV2) { - static DEFAULT_OPTIONS = { - tag: 'form', - classes: ['daggerheart', 'sheet', 'heritage'], - position: { width: 600 }, - actions: { - editAbility: this.editAbility, - deleteAbility: this.deleteAbility - }, - form: { - handler: this.updateForm, - submitOnChange: true, - closeOnSubmit: false - }, - dragDrop: [{ dragSelector: null, dropSelector: null }] - }; - - static PARTS = { - form: { - id: 'feature', - template: 'systems/daggerheart/templates/sheets/community.hbs' - } - }; - - async _prepareContext(_options) { - const context = await super._prepareContext(_options); - context.document = this.document; - - return context; - } - - static async updateForm(event, _, formData) { - await this.document.update(formData.object); - this.render(); - } - - static async editAbility(_, button) { - const feature = await fromUuid(button.dataset.ability); - feature.sheet.render(true); - } - - static async deleteAbility(event, button) { - event.preventDefault(); - event.stopPropagation(); - await this.item.update({ - 'system.abilities': this.item.system.abilities.filter(x => x.uuid !== button.dataset.ability) - }); - } - - async _onDrop(event) { - const data = TextEditor.getDragEventData(event); - const item = await fromUuid(data.uuid); - if (item.type === 'feature' && item.system.type === SYSTEM.ITEM.featureTypes.community.id) { - await this.document.update({ - 'system.abilities': [ - ...this.document.system.abilities, - { img: item.img, name: item.name, uuid: item.uuid } - ] - }); - } - } -} diff --git a/module/applications/sheets/items/ancestry.mjs b/module/applications/sheets/items/ancestry.mjs new file mode 100644 index 00000000..e6a92e1e --- /dev/null +++ b/module/applications/sheets/items/ancestry.mjs @@ -0,0 +1,88 @@ +import DaggerheartSheet from '../daggerheart-sheet.mjs'; + +const { ItemSheetV2 } = foundry.applications.sheets; +export default class AncestrySheet extends DaggerheartSheet(ItemSheetV2) { + static DEFAULT_OPTIONS = { + tag: 'form', + classes: ['daggerheart', 'sheet', 'item', 'dh-style', 'ancestry'], + position: { width: 450, height: 700 }, + actions: { + editFeature: this.editFeature, + deleteFeature: this.deleteFeature + }, + form: { + handler: this.updateForm, + submitOnChange: true, + closeOnSubmit: false + }, + dragDrop: [{ dragSelector: null, dropSelector: null }] + }; + + static PARTS = { + header: { template: 'systems/daggerheart/templates/sheets/items/ancestry/header.hbs' }, + tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' }, + description: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-description.hbs' }, + features: { + template: 'systems/daggerheart/templates/sheets/global/tabs/tab-feature-section.hbs', + scrollable: ['.features'] + } + }; + + static TABS = { + description: { + active: true, + cssClass: '', + group: 'primary', + id: 'description', + icon: null, + label: 'DAGGERHEART.Sheets.Feature.Tabs.Description' + }, + features: { + active: false, + cssClass: '', + group: 'primary', + id: 'features', + icon: null, + label: 'DAGGERHEART.Sheets.Feature.Tabs.Features' + } + }; + + async _prepareContext(_options) { + const context = await super._prepareContext(_options); + context.document = this.document; + context.tabs = super._getTabs(this.constructor.TABS); + + return context; + } + + static async updateForm(event, _, formData) { + await this.document.update(formData.object); + this.render(); + } + + static async editFeature(_, target) { + const feature = await fromUuid(target.dataset.feature); + feature.sheet.render(true); + } + + static async deleteFeature(event, target) { + event.preventDefault(); + event.stopPropagation(); + await this.item.update({ + 'system.abilities': this.item.system.abilities.filter(x => x.uuid !== target.dataset.feature) + }); + } + + async _onDrop(event) { + const data = TextEditor.getDragEventData(event); + const item = await fromUuid(data.uuid); + if (item.type === 'feature' && item.system.type === SYSTEM.ITEM.featureTypes.ancestry.id) { + await this.document.update({ + 'system.abilities': [ + ...this.document.system.abilities, + { img: item.img, name: item.name, uuid: item.uuid } + ] + }); + } + } +} diff --git a/module/applications/sheets/items/armor.mjs b/module/applications/sheets/items/armor.mjs index 25b2ddb5..b9759917 100644 --- a/module/applications/sheets/items/armor.mjs +++ b/module/applications/sheets/items/armor.mjs @@ -4,7 +4,7 @@ const { ItemSheetV2 } = foundry.applications.sheets; export default class ArmorSheet extends DaggerheartSheet(ItemSheetV2) { static DEFAULT_OPTIONS = { tag: 'form', - classes: ['daggerheart', 'sheet', 'dh-style', 'armor'], + classes: ['daggerheart', 'sheet', 'item', 'dh-style', 'armor'], position: { width: 600 }, form: { handler: this.updateForm, diff --git a/module/applications/sheets/items/community.mjs b/module/applications/sheets/items/community.mjs new file mode 100644 index 00000000..0c15e97e --- /dev/null +++ b/module/applications/sheets/items/community.mjs @@ -0,0 +1,88 @@ +import DaggerheartSheet from '../daggerheart-sheet.mjs'; + +const { ItemSheetV2 } = foundry.applications.sheets; +export default class CommunitySheet extends DaggerheartSheet(ItemSheetV2) { + static DEFAULT_OPTIONS = { + tag: 'form', + classes: ['daggerheart', 'sheet', 'item', 'dh-style', 'community'], + position: { width: 450, height: 700 }, + actions: { + editFeature: this.editFeature, + deleteFeature: this.deleteFeature + }, + form: { + handler: this.updateForm, + submitOnChange: true, + closeOnSubmit: false + }, + dragDrop: [{ dragSelector: null, dropSelector: null }] + }; + + static PARTS = { + header: { template: 'systems/daggerheart/templates/sheets/items/community/header.hbs' }, + tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' }, + description: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-description.hbs' }, + features: { + template: 'systems/daggerheart/templates/sheets/global/tabs/tab-feature-section.hbs', + scrollable: ['.features'] + } + }; + + static TABS = { + description: { + active: true, + cssClass: '', + group: 'primary', + id: 'description', + icon: null, + label: 'DAGGERHEART.Sheets.Feature.Tabs.Description' + }, + features: { + active: false, + cssClass: '', + group: 'primary', + id: 'features', + icon: null, + label: 'DAGGERHEART.Sheets.Feature.Tabs.Features' + } + }; + + async _prepareContext(_options) { + const context = await super._prepareContext(_options); + context.document = this.document; + context.tabs = super._getTabs(this.constructor.TABS); + + return context; + } + + static async updateForm(event, _, formData) { + await this.document.update(formData.object); + this.render(); + } + + static async editFeature(_, target) { + const feature = await fromUuid(target.dataset.feature); + feature.sheet.render(true); + } + + static async deleteFeature(event, target) { + event.preventDefault(); + event.stopPropagation(); + await this.item.update({ + 'system.abilities': this.item.system.abilities.filter(x => x.uuid !== target.dataset.feature) + }); + } + + async _onDrop(event) { + const data = TextEditor.getDragEventData(event); + const item = await fromUuid(data.uuid); + if (item.type === 'feature' && item.system.type === SYSTEM.ITEM.featureTypes.community.id) { + await this.document.update({ + 'system.abilities': [ + ...this.document.system.abilities, + { img: item.img, name: item.name, uuid: item.uuid } + ] + }); + } + } +} diff --git a/module/applications/sheets/items/consumable.mjs b/module/applications/sheets/items/consumable.mjs index eb0a3d6b..cc36bf97 100644 --- a/module/applications/sheets/items/consumable.mjs +++ b/module/applications/sheets/items/consumable.mjs @@ -4,7 +4,7 @@ const { ItemSheetV2 } = foundry.applications.sheets; export default class ConsumableSheet extends DaggerheartSheet(ItemSheetV2) { static DEFAULT_OPTIONS = { tag: 'form', - classes: ['daggerheart', 'sheet', 'dh-style', 'consumable'], + classes: ['daggerheart', 'sheet', 'item', 'dh-style', 'consumable'], position: { width: 550 }, form: { handler: this.updateForm, diff --git a/module/applications/sheets/domainCard.mjs b/module/applications/sheets/items/domainCard.mjs similarity index 51% rename from module/applications/sheets/domainCard.mjs rename to module/applications/sheets/items/domainCard.mjs index be9971d5..bd278311 100644 --- a/module/applications/sheets/domainCard.mjs +++ b/module/applications/sheets/items/domainCard.mjs @@ -1,45 +1,13 @@ -// import DhpApplicationMixin from '../daggerheart-sheet.mjs'; - -// export default class DomainCardSheet extends DhpApplicationMixin(ItemSheet) { -// static documentType = "domainCard"; - -// /** @override */ -// static get defaultOptions() { -// return foundry.utils.mergeObject(super.defaultOptions, { -// classes: ["daggerheart", "sheet", "domain-card"], -// width: 600, -// height: 600, -// tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "features" }] -// }); -// } - -// /** @override */ -// getData() { -// const context = super.getData(); -// context.config = CONFIG.daggerheart; - -// return context; -// } - -// async _handleAction(action, event, button) { -// switch(action){ -// case 'attributeRoll': - -// break; -// } -// } -// } - -import DaggerheartAction from '../../data/action.mjs'; -import DaggerheartActionConfig from '../config/Action.mjs'; -import DaggerheartSheet from './daggerheart-sheet.mjs'; +import DaggerheartAction from '../../../data/action.mjs'; +import DaggerheartActionConfig from '../../config/Action.mjs'; +import DaggerheartSheet from '../daggerheart-sheet.mjs'; const { ItemSheetV2 } = foundry.applications.sheets; export default class DomainCardSheet extends DaggerheartSheet(ItemSheetV2) { static DEFAULT_OPTIONS = { tag: 'form', - classes: ['daggerheart', 'sheet', 'domain-card'], - position: { width: 600, height: 600 }, + classes: ['daggerheart', 'sheet', 'item', 'dh-style', 'domain-card'], + position: { width: 450, height: 700 }, actions: { addAction: this.addAction, editAction: this.editAction, @@ -53,29 +21,50 @@ export default class DomainCardSheet extends DaggerheartSheet(ItemSheetV2) { }; static PARTS = { - form: { - id: 'feature', - template: 'systems/daggerheart/templates/sheets/domainCard.hbs' + 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' }, + 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'] } }; - _getTabs() { - const tabs = { - general: { active: true, cssClass: '', group: 'primary', id: 'general', icon: null, label: 'General' }, - actions: { active: false, cssClass: '', group: 'primary', id: 'actions', icon: null, label: 'Actions' } - }; - for (const v of Object.values(tabs)) { - v.active = this.tabGroups[v.group] ? this.tabGroups[v.group] === v.id : v.active; - v.cssClass = v.active ? 'active' : ''; + static TABS = { + description: { + active: true, + cssClass: '', + group: 'primary', + id: 'description', + icon: null, + label: 'DAGGERHEART.Sheets.Feature.Tabs.Description' + }, + actions: { + active: false, + cssClass: '', + group: 'primary', + id: 'actions', + icon: null, + label: 'DAGGERHEART.Sheets.Feature.Tabs.Actions' + }, + settings: { + active: false, + cssClass: '', + group: 'primary', + id: 'settings', + icon: null, + label: 'DAGGERHEART.Sheets.Feature.Tabs.Settings' } - - return tabs; - } + }; async _prepareContext(_options) { const context = await super._prepareContext(_options); context.config = CONFIG.daggerheart; - context.tabs = this._getTabs(); + context.tabs = super._getTabs(this.constructor.TABS); return context; } diff --git a/module/applications/sheets/items/feature.mjs b/module/applications/sheets/items/feature.mjs index 553b686d..25d37822 100644 --- a/module/applications/sheets/items/feature.mjs +++ b/module/applications/sheets/items/feature.mjs @@ -13,7 +13,7 @@ export default class FeatureSheet extends DaggerheartSheet(ItemSheetV2) { static DEFAULT_OPTIONS = { tag: 'form', id: 'daggerheart-feature', - classes: ['daggerheart', 'sheet', 'dh-style', 'feature'], + classes: ['daggerheart', 'sheet', 'item', 'dh-style', 'feature'], position: { width: 600, height: 600 }, window: { resizable: true }, actions: { @@ -35,7 +35,7 @@ export default class FeatureSheet extends DaggerheartSheet(ItemSheetV2) { tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' }, description: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-description.hbs' }, actions: { - template: 'systems/daggerheart/templates/sheets/items/feature/actions.hbs', + template: 'systems/daggerheart/templates/sheets/global/tabs/tab-actions.hbs', scrollable: ['.actions'] }, settings: { diff --git a/module/applications/sheets/items/miscellaneous.mjs b/module/applications/sheets/items/miscellaneous.mjs index cf4ba2c0..af43fa51 100644 --- a/module/applications/sheets/items/miscellaneous.mjs +++ b/module/applications/sheets/items/miscellaneous.mjs @@ -1,32 +1,10 @@ -// import DhpApplicationMixin from '../daggerheart-sheet.mjs'; - -// export default class MiscellaneousSheet extends DhpApplicationMixin(ItemSheet) { -// static documentType = "miscellaneous"; - -// /** @override */ -// static get defaultOptions() { -// return foundry.utils.mergeObject(super.defaultOptions, { -// classes: ["daggerheart", "sheet", "miscellaneous"], -// width: 400, -// height: 'auto', -// }); -// } - -// /** @override */ -// getData() { -// const context = super.getData(); - -// return context; -// } -// } - import DaggerheartSheet from '../daggerheart-sheet.mjs'; const { ItemSheetV2 } = foundry.applications.sheets; export default class MiscellaneousSheet extends DaggerheartSheet(ItemSheetV2) { static DEFAULT_OPTIONS = { tag: 'form', - classes: ['daggerheart', 'sheet', 'dh-style', 'miscellaneous'], + classes: ['daggerheart', 'sheet', 'item', 'dh-style', 'miscellaneous'], position: { width: 550 }, form: { handler: this.updateForm, diff --git a/module/applications/sheets/items/weapon.mjs b/module/applications/sheets/items/weapon.mjs index e12564df..90cde394 100644 --- a/module/applications/sheets/items/weapon.mjs +++ b/module/applications/sheets/items/weapon.mjs @@ -4,7 +4,7 @@ const { ItemSheetV2 } = foundry.applications.sheets; export default class WeaponSheet extends DaggerheartSheet(ItemSheetV2) { static DEFAULT_OPTIONS = { tag: 'form', - classes: ['daggerheart', 'sheet', 'dh-style', 'weapon'], + classes: ['daggerheart', 'sheet', 'item', 'dh-style', 'weapon'], position: { width: 600 }, form: { handler: this.updateForm, diff --git a/module/config/domainConfig.mjs b/module/config/domainConfig.mjs index a188ed43..394f6fb3 100644 --- a/module/config/domainConfig.mjs +++ b/module/config/domainConfig.mjs @@ -85,17 +85,17 @@ export const classMap = { export const cardTypes = { ability: { id: 'ability', - label: 'DAGGERHEART.Domain.CardTypes.Ability', + label: 'DAGGERHEART.Domain.CardTypes.ability', img: '' }, spell: { id: 'spell', - label: 'DAGGERHEART.Domain.CardTypes.Spell', + label: 'DAGGERHEART.Domain.CardTypes.spell', img: '' }, grimoire: { id: 'grimoire', - label: 'DAGGERHEART.Domain.CardTypes.Grimoire', + label: 'DAGGERHEART.Domain.CardTypes.grimoire', img: '' } }; diff --git a/styles/daggerheart.css b/styles/daggerheart.css index 178e4d69..56c1e0d7 100755 --- a/styles/daggerheart.css +++ b/styles/daggerheart.css @@ -2796,40 +2796,11 @@ div.daggerheart.views.multiclass { scrollbar-width: thin; scrollbar-color: light-dark(#18162e, #f3c267) transparent; } -.application.sheet.daggerheart.dh-style.feature .tab.actions .actions-list { - display: flex; - flex-direction: column; - list-style: none; - padding: 0; - margin: 0; - width: 100%; - gap: 5px; -} -.application.sheet.daggerheart.dh-style.feature .tab.actions .actions-list .action-item { - display: grid; - align-items: center; - grid-template-columns: 1fr 4fr 1fr; - cursor: pointer; -} -.application.sheet.daggerheart.dh-style.feature .tab.actions .actions-list .action-item h4 { - font-family: 'Montserrat', sans-serif; - font-weight: lighter; - color: #efe6d8; -} -.application.sheet.daggerheart.dh-style.feature .tab.actions .actions-list .action-item .image { - height: 40px; - width: 40px; - object-fit: cover; - border-radius: 6px; - border: none; -} -.application.sheet.daggerheart.dh-style.feature .tab.actions .actions-list .action-item .controls { - display: flex; - justify-content: center; - gap: 10px; -} -.application.sheet.daggerheart.dh-style.feature .tab.actions .actions-list .action-item .controls a { - text-shadow: none; +.application.sheet.daggerheart.dh-style.domain-card section.tab { + height: 400px; + overflow-y: auto; + scrollbar-width: thin; + scrollbar-color: light-dark(#18162e, #f3c267) transparent; } @font-face { font-family: 'Cinzel'; @@ -3145,6 +3116,41 @@ div.daggerheart.views.multiclass { text-shadow: none; font-family: 'Montserrat', sans-serif; } +.sheet.daggerheart.dh-style .tab.actions .actions-list { + display: flex; + flex-direction: column; + list-style: none; + padding: 0; + margin: 0; + width: 100%; + gap: 5px; +} +.sheet.daggerheart.dh-style .tab.actions .actions-list .action-item { + display: grid; + align-items: center; + grid-template-columns: 1fr 4fr 1fr; + cursor: pointer; +} +.sheet.daggerheart.dh-style .tab.actions .actions-list .action-item h4 { + font-family: 'Montserrat', sans-serif; + font-weight: lighter; + color: #efe6d8; +} +.sheet.daggerheart.dh-style .tab.actions .actions-list .action-item .image { + height: 40px; + width: 40px; + object-fit: cover; + border-radius: 6px; + border: none; +} +.sheet.daggerheart.dh-style .tab.actions .actions-list .action-item .controls { + display: flex; + justify-content: center; + gap: 10px; +} +.sheet.daggerheart.dh-style .tab.actions .actions-list .action-item .controls a { + text-shadow: none; +} .application.sheet.daggerheart.dh-style .item-sheet-header { display: flex; } @@ -3188,6 +3194,135 @@ div.daggerheart.views.multiclass { .application.sheet.daggerheart.dh-style .item-sheet-header .item-info h3 { font-size: 1rem; } +.application.sheet.daggerheart.dh-style .item-card-header { + display: flex; + flex-direction: column; + justify-content: start; + text-align: center; +} +.application.sheet.daggerheart.dh-style .item-card-header .profile { + height: 300px; + width: 100%; + object-fit: cover; + mask-image: linear-gradient(0deg, transparent 0%, black 10%); +} +.application.sheet.daggerheart.dh-style .item-card-header .item-icons-list { + position: absolute; + display: flex; + align-items: center; + justify-content: center; + top: 50px; + right: 10px; +} +.application.sheet.daggerheart.dh-style .item-card-header .item-icons-list .item-icon { + display: flex; + align-items: center; + justify-content: end; + text-align: center; + padding-right: 8px; + max-width: 50px; + height: 50px; + font-size: 1.2rem; + background: light-dark(rgba(0, 0, 0, 0.3), rgba(24, 22, 46, 0.33)); + border: 4px double light-dark(#efe6d8, #f3c267); + color: light-dark(#efe6d8, #f3c267); + border-radius: 999px; + transition: all 0.3s ease; +} +.application.sheet.daggerheart.dh-style .item-card-header .item-icons-list .item-icon .recall-label { + font-size: 14px; + opacity: 0; + margin-right: 0.3rem; + transition: all 0.3s ease; +} +.application.sheet.daggerheart.dh-style .item-card-header .item-icons-list .item-icon i { + font-size: 0.8rem; +} +.application.sheet.daggerheart.dh-style .item-card-header .item-icons-list .item-icon:hover { + max-width: 300px; + padding: 0 10px; + border-radius: 60px; +} +.application.sheet.daggerheart.dh-style .item-card-header .item-icons-list .item-icon:hover .recall-label { + opacity: 1; +} +.application.sheet.daggerheart.dh-style .item-card-header .item-info { + display: flex; + flex-direction: column; + align-items: center; + position: relative; + top: -25px; + gap: 5px; + margin-bottom: -20px; +} +.application.sheet.daggerheart.dh-style .item-card-header .item-info .item-name input[type='text'] { + font-size: 32px; + height: 42px; + text-align: center; + width: 90%; + transition: all 0.3s ease; + outline: 2px solid transparent; + border: 1px solid transparent; +} +.application.sheet.daggerheart.dh-style .item-card-header .item-info .item-name input[type='text']:hover[type='text'], +.application.sheet.daggerheart.dh-style .item-card-header .item-info .item-name input[type='text']:focus[type='text'] { + box-shadow: none; + outline: 2px solid light-dark(#18162e, #f3c267); +} +.application.sheet.daggerheart.dh-style .item-card-header .item-info .item-description { + display: flex; + flex-direction: column; + gap: 10px; +} +.application.sheet.daggerheart.dh-style .item-card-header .item-info h3 { + font-size: 1rem; +} +.sheet.daggerheart.dh-style.item .tab.features { + padding: 0 10px; + max-height: 265px; + overflow-y: auto; + scrollbar-width: thin; + scrollbar-color: light-dark(#18162e, #f3c267) transparent; +} +.sheet.daggerheart.dh-style.item .tab.features .feature-list { + display: flex; + flex-direction: column; + list-style: none; + padding: 0; + margin: 0; + width: 100%; +} +.sheet.daggerheart.dh-style.item .tab.features .feature-list .feature-item { + margin-bottom: 10px; +} +.sheet.daggerheart.dh-style.item .tab.features .feature-list .feature-item:last-child { + margin-bottom: 0px; +} +.sheet.daggerheart.dh-style.item .tab.features .feature-list .feature-item .feature-line { + display: grid; + align-items: center; + grid-template-columns: 1fr 4fr 1fr; +} +.sheet.daggerheart.dh-style.item .tab.features .feature-list .feature-item .feature-line h4 { + font-family: 'Montserrat', sans-serif; + font-weight: lighter; + color: light-dark(#222, #efe6d8); +} +.sheet.daggerheart.dh-style.item .tab.features .feature-list .feature-item .feature-line .image { + height: 40px; + width: 40px; + object-fit: cover; + border-radius: 6px; + border: none; +} +.sheet.daggerheart.dh-style.item .tab.features .feature-list .feature-item .feature-line .controls { + display: flex; + justify-content: center; + gap: 10px; +} +.sheet.daggerheart.dh-style.item .tab.features .feature-list .feature-item .feature-line .controls a { + text-shadow: none; +} #logo { content: url(../assets/DaggerheartLogo.webp); height: 50px; diff --git a/styles/daggerheart.less b/styles/daggerheart.less index d55a4aec..4821f52d 100755 --- a/styles/daggerheart.less +++ b/styles/daggerheart.less @@ -13,6 +13,8 @@ // new styles imports @import './less/items/feature.less'; +@import './less/items/ancestry.less'; +@import './less/items/domainCard.less'; @import './less/utils/colors.less'; @import './less/utils/fonts.less'; @@ -20,7 +22,9 @@ @import './less/global/sheet.less'; @import './less/global/elements.less'; @import './less/global/tab-navigation.less'; +@import './less/global/tab-actions.less'; @import './less/global/item-header.less'; +@import './less/global/feature-section.less'; #logo { content: url(../assets/DaggerheartLogo.webp); diff --git a/styles/less/global/feature-section.less b/styles/less/global/feature-section.less new file mode 100644 index 00000000..50ffaefa --- /dev/null +++ b/styles/less/global/feature-section.less @@ -0,0 +1,51 @@ +@import '../utils/colors.less'; +@import '../utils/fonts.less'; + +.sheet.daggerheart.dh-style.item { + .tab.features { + padding: 0 10px; + max-height: 265px; + overflow-y: auto; + scrollbar-width: thin; + scrollbar-color: light-dark(@dark-blue, @golden) transparent; + .feature-list { + display: flex; + flex-direction: column; + list-style: none; + padding: 0; + margin: 0; + width: 100%; + .feature-item { + margin-bottom: 10px; + &:last-child { + margin-bottom: 0px; + } + .feature-line { + display: grid; + align-items: center; + grid-template-columns: 1fr 4fr 1fr; + h4 { + font-family: @font-body; + font-weight: lighter; + color: light-dark(@dark, @beige); + } + .image { + height: 40px; + width: 40px; + object-fit: cover; + border-radius: 6px; + border: none; + } + .controls { + display: flex; + justify-content: center; + gap: 10px; + a { + text-shadow: none; + } + } + } + } + } + } +} diff --git a/styles/less/global/item-header.less b/styles/less/global/item-header.less index 290e3bdd..06919b77 100755 --- a/styles/less/global/item-header.less +++ b/styles/less/global/item-header.less @@ -50,4 +50,103 @@ } } } + + .item-card-header { + display: flex; + flex-direction: column; + justify-content: start; + text-align: center; + + .profile { + height: 300px; + width: 100%; + object-fit: cover; + mask-image: linear-gradient(0deg, transparent 0%, black 10%); + cursor: pointer; + } + + .item-icons-list { + position: absolute; + display: flex; + align-items: center; + justify-content: center; + top: 50px; + right: 10px; + + .item-icon { + display: flex; + align-items: center; + justify-content: end; + text-align: center; + padding-right: 8px; + max-width: 50px; + height: 50px; + font-size: 1.2rem; + background: light-dark(@light-black, @semi-transparent-dark-blue); + border: 4px double light-dark(@beige, @golden); + color: light-dark(@beige, @golden); + border-radius: 999px; + transition: all 0.3s ease; + + .recall-label { + font-size: 14px; + opacity: 0; + margin-right: 0.3rem; + transition: all 0.3s ease; + } + + i { + font-size: 0.8rem; + } + + &:hover { + max-width: 300px; + padding: 0 10px; + border-radius: 60px; + + .recall-label { + opacity: 1; + } + } + } + } + + .item-info { + display: flex; + flex-direction: column; + align-items: center; + position: relative; + top: -25px; + gap: 5px; + margin-bottom: -20px; + + .item-name { + input[type='text'] { + font-size: 32px; + height: 42px; + text-align: center; + width: 90%; + transition: all 0.3s ease; + outline: 2px solid transparent; + border: 1px solid transparent; + + &:hover[type='text'], + &:focus[type='text'] { + box-shadow: none; + outline: 2px solid light-dark(@dark-blue, @golden); + } + } + } + + .item-description { + display: flex; + flex-direction: column; + gap: 10px; + } + + h3 { + font-size: 1rem; + } + } + } } diff --git a/styles/less/global/sheet.less b/styles/less/global/sheet.less index b3fe4960..e557ae7e 100755 --- a/styles/less/global/sheet.less +++ b/styles/less/global/sheet.less @@ -67,7 +67,6 @@ background-position: center; } } -// D:\Foundry\v13\data\Data\systems\daggerheart\assets\parchments\dh-parchment-light.png .application.sheet.daggerheart.dh-style { .window-content { diff --git a/styles/less/global/tab-actions.less b/styles/less/global/tab-actions.less new file mode 100644 index 00000000..fb4f8850 --- /dev/null +++ b/styles/less/global/tab-actions.less @@ -0,0 +1,46 @@ +@import '../utils/colors.less'; +@import '../utils/fonts.less'; + +.sheet.daggerheart.dh-style { + .tab.actions { + .actions-list { + display: flex; + flex-direction: column; + list-style: none; + padding: 0; + margin: 0; + width: 100%; + gap: 5px; + + .action-item { + display: grid; + align-items: center; + grid-template-columns: 1fr 4fr 1fr; + cursor: pointer; + + h4 { + font-family: @font-body; + font-weight: lighter; + color: @beige; + } + + .image { + height: 40px; + width: 40px; + object-fit: cover; + border-radius: 6px; + border: none; + } + + .controls { + display: flex; + justify-content: center; + gap: 10px; + a { + text-shadow: none; + } + } + } + } + } +} diff --git a/styles/less/items/domainCard.less b/styles/less/items/domainCard.less new file mode 100644 index 00000000..2cb1e361 --- /dev/null +++ b/styles/less/items/domainCard.less @@ -0,0 +1,12 @@ +@import '../utils/colors.less'; +@import '../utils/fonts.less'; + +.application.sheet.daggerheart.dh-style.domain-card { + + section.tab { + height: 400px; + overflow-y: auto; + scrollbar-width: thin; + scrollbar-color: light-dark(@dark-blue, @golden) transparent; + } +} diff --git a/styles/less/items/feature.less b/styles/less/items/feature.less index 08002406..f4c117eb 100755 --- a/styles/less/items/feature.less +++ b/styles/less/items/feature.less @@ -17,46 +17,4 @@ scrollbar-width: thin; scrollbar-color: light-dark(@dark-blue, @golden) transparent; } - - .tab.actions { - .actions-list { - display: flex; - flex-direction: column; - list-style: none; - padding: 0; - margin: 0; - width: 100%; - gap: 5px; - - .action-item { - display: grid; - align-items: center; - grid-template-columns: 1fr 4fr 1fr; - cursor: pointer; - - h4 { - font-family: @font-body; - font-weight: lighter; - color: @beige; - } - - .image { - height: 40px; - width: 40px; - object-fit: cover; - border-radius: 6px; - border: none; - } - - .controls { - display: flex; - justify-content: center; - gap: 10px; - a { - text-shadow: none; - } - } - } - } - } } diff --git a/templates/sheets/ancestry.hbs b/templates/sheets/ancestry.hbs deleted file mode 100644 index 8cb6bbf1..00000000 --- a/templates/sheets/ancestry.hbs +++ /dev/null @@ -1,11 +0,0 @@ -
-
-
- -
- {{formInput fields.name value=source.name rootId=partId}} -
-
-
- {{> "systems/daggerheart/templates/sheets/parts/heritage.hbs" }} -
\ No newline at end of file diff --git a/templates/sheets/community.hbs b/templates/sheets/community.hbs deleted file mode 100644 index 8cb6bbf1..00000000 --- a/templates/sheets/community.hbs +++ /dev/null @@ -1,11 +0,0 @@ -
-
-
- -
- {{formInput fields.name value=source.name rootId=partId}} -
-
-
- {{> "systems/daggerheart/templates/sheets/parts/heritage.hbs" }} -
\ No newline at end of file diff --git a/templates/sheets/domainCard.hbs b/templates/sheets/domainCard.hbs deleted file mode 100644 index deebf523..00000000 --- a/templates/sheets/domainCard.hbs +++ /dev/null @@ -1,101 +0,0 @@ -
-
-
- -
- {{formInput fields.name value=source.name rootId=partId}} -
-
- -
- -
-
- {{formField systemFields.type value=source.system.type label="Type" localize=true blank=""}} - {{formField systemFields.foundation value=source.system.foundation label="Foundation" }} - {{formField systemFields.domain value=source.system.domain label="Domain" localize=true blank=""}} - {{formField systemFields.level value=source.system.level label="level" data-dtype="Number"}} - {{formField systemFields.recallCost value=source.system.recallCost label="Recall Cost" data-dtype="Number"}} - {{formField systemFields.effect value=source.system.effect label="Description" enriched=source.system.effect toggled=true}} -
- -
-

{{localize "Actions"}}

-
- {{#each source.system.actions as |action index|}} -
- -
{{action.name}}
- -
- {{/each}} -
-
-
-
- -{{!--
-
-
- -
-

-
-
-
- -
-
- -
- - - - -
-
-
- -
- -
-
-
- -
- - - - -
-
- -
-

{{localize "DAGGERHEART.Sheets.DomainCard.Description"}}

- {{editor item.system.effect target="system.effect" button=true}} -
-
- - -

{{localize "Actions"}}

-
- {{#each this.actions as |action index|}} -
- -
{{action.name}}
- -
- {{/each}} -
-
--}} \ No newline at end of file diff --git a/templates/sheets/global/partials/feature-section-item.hbs b/templates/sheets/global/partials/feature-section-item.hbs new file mode 100644 index 00000000..adc029e9 --- /dev/null +++ b/templates/sheets/global/partials/feature-section-item.hbs @@ -0,0 +1,28 @@ +
  • +
    + +

    + {{feature.name}} +

    + {{#unless hideContrals}} + + {{/unless}} +
    +
  • \ No newline at end of file diff --git a/templates/sheets/items/feature/actions.hbs b/templates/sheets/global/tabs/tab-actions.hbs old mode 100755 new mode 100644 similarity index 100% rename from templates/sheets/items/feature/actions.hbs rename to templates/sheets/global/tabs/tab-actions.hbs diff --git a/templates/sheets/global/tabs/tab-description.hbs b/templates/sheets/global/tabs/tab-description.hbs index 58a90ed7..7a167187 100755 --- a/templates/sheets/global/tabs/tab-description.hbs +++ b/templates/sheets/global/tabs/tab-description.hbs @@ -6,5 +6,6 @@
    {{localize "DAGGERHEART.Sheets.Feature.Description"}} {{formInput systemFields.description value=source.system.description enriched=source.system.description localize=true toggled=true}} + {{formField systemFields.effect value=source.system.effect enriched=source.system.effect toggled=true}}
    \ No newline at end of file diff --git a/templates/sheets/global/tabs/tab-feature-section.hbs b/templates/sheets/global/tabs/tab-feature-section.hbs new file mode 100644 index 00000000..f82c84b1 --- /dev/null +++ b/templates/sheets/global/tabs/tab-feature-section.hbs @@ -0,0 +1,14 @@ +
    +
    + {{localize "DAGGERHEART.Sheets.Feature.Tabs.Features"}} +
    + {{#each source.system.abilities as |feature key|}} + {{> 'systems/daggerheart/templates/sheets/global/partials/feature-section-item.hbs' feature=feature}} + {{/each}} +
    +
    +
    \ No newline at end of file diff --git a/templates/sheets/items/ancestry/header.hbs b/templates/sheets/items/ancestry/header.hbs new file mode 100644 index 00000000..00f863f1 --- /dev/null +++ b/templates/sheets/items/ancestry/header.hbs @@ -0,0 +1,9 @@ +
    + +
    +

    +
    +

    {{localize 'TYPES.Item.ancestry'}}

    +
    +
    +
    \ No newline at end of file diff --git a/templates/sheets/items/community/header.hbs b/templates/sheets/items/community/header.hbs new file mode 100644 index 00000000..794a3f12 --- /dev/null +++ b/templates/sheets/items/community/header.hbs @@ -0,0 +1,9 @@ +
    + +
    +

    +
    +

    {{localize 'TYPES.Item.community'}}

    +
    +
    +
    \ No newline at end of file diff --git a/templates/sheets/items/domainCard/header.hbs b/templates/sheets/items/domainCard/header.hbs new file mode 100644 index 00000000..0f16e92a --- /dev/null +++ b/templates/sheets/items/domainCard/header.hbs @@ -0,0 +1,26 @@ +
    + +
    + + {{localize "DAGGERHEART.Sheets.DomainCard.RecallCost"}} + {{source.system.recallCost}} + + +
    +
    +

    +
    +

    {{localize 'TYPES.Item.domainCard'}}

    +

    + {{localize (concat 'DAGGERHEART.Domain.CardTypes.' source.system.type)}} + - + {{source.system.domain}} + - + + {{localize "DAGGERHEART.Sheets.DomainCard.Level"}}: + {{source.system.level}} + +

    +
    +
    +
    \ No newline at end of file diff --git a/templates/sheets/items/domainCard/settings.hbs b/templates/sheets/items/domainCard/settings.hbs new file mode 100644 index 00000000..4b3f2968 --- /dev/null +++ b/templates/sheets/items/domainCard/settings.hbs @@ -0,0 +1,20 @@ +
    +
    + {{localize tabs.settings.label}} + + {{localize "DAGGERHEART.Sheets.DomainCard.Type"}} + {{formField systemFields.type value=source.system.type localize=true blank=""}} + {{localize "DAGGERHEART.Sheets.DomainCard.Foundation"}} + {{formField systemFields.foundation value=source.system.foundation }} + {{localize "DAGGERHEART.Sheets.DomainCard.Domain"}} + {{formField systemFields.domain value=source.system.domain localize=true blank=""}} + {{localize "DAGGERHEART.Sheets.DomainCard.Level"}} + {{formField systemFields.level value=source.system.level data-dtype="Number"}} + {{localize "DAGGERHEART.Sheets.DomainCard.RecallCost"}} + {{formField systemFields.recallCost value=source.system.recallCost data-dtype="Number"}} +
    +
    \ No newline at end of file