From 5ffb22fcc5fe29fcd9883f94aba3e31800ec43d3 Mon Sep 17 00:00:00 2001 From: Murilo Brito <91566541+moliloo@users.noreply.github.com> Date: Tue, 1 Jul 2025 17:07:12 -0300 Subject: [PATCH 1/6] [Feature] 155 - New Adversary Sheet (#228) * rework adversary templates, add setting dialog to adversary and fix erratas * fix errata in adversary data model * developing experience setting page * Experience settings update * finish actions setting tab * Fixed Notes enriched path and adversary-settings form id * Fixed UseItem and ToChat * Fixed Firefox progress bar (HP/Stress) (#230) * insert prose-mirror style and inicial implement to damage settings * fix character import relative paths and remove effects from standard adversary attack --------- Co-authored-by: WBHarry Co-authored-by: GyroFalc <43814421+GyroFalc@users.noreply.github.com> --- lang/en.json | 97 ++- module/applications/_module.mjs | 5 +- .../sheets/{ => actors}/adversary.mjs | 83 +- .../sheets/{ => actors}/character.mjs | 20 +- .../applications/adversary-settings.mjs | 181 +++++ module/config/actionConfig.mjs | 16 +- module/config/actorConfig.mjs | 40 +- module/config/itemConfig.mjs | 6 +- module/data/action/action.mjs | 23 + module/data/actor/adversary.mjs | 8 +- styles/daggerheart.css | 750 ++++++++++++++++-- styles/daggerheart.less | 10 + styles/less/actors/adversary/actions.less | 20 + styles/less/actors/adversary/header.less | 152 ++++ styles/less/actors/adversary/sheet.less | 28 + styles/less/actors/adversary/sidebar.less | 341 ++++++++ styles/less/actors/character/sheet.less | 4 - styles/less/actors/character/sidebar.less | 9 +- .../adversary-settings/actions.less | 62 ++ .../adversary-settings/experiences.less | 28 + .../adversary-settings/sheet.less | 18 + styles/less/applications/header.less | 20 + styles/less/global/dialog.less | 45 ++ styles/less/global/elements.less | 9 +- .../less/global/inventory-fieldset-items.less | 2 +- styles/less/global/inventory-item.less | 2 +- styles/less/global/prose-mirror.less | 24 + styles/less/global/tab-navigation.less | 3 +- templates/sheets/actors/adversary/actions.hbs | 11 + templates/sheets/actors/adversary/effects.hbs | 8 + templates/sheets/actors/adversary/header.hbs | 46 +- templates/sheets/actors/adversary/main.hbs | 47 +- templates/sheets/actors/adversary/notes.hbs | 10 + templates/sheets/actors/adversary/sidebar.hbs | 111 +++ templates/sheets/actors/character/sidebar.hbs | 2 +- .../adversary-settings/actions.hbs | 34 + .../adversary-settings/attack.hbs | 23 + .../adversary-settings/details.hbs | 38 + .../adversary-settings/experiences.hbs | 23 + .../adversary-settings/header.hbs | 3 + .../partials/inventory-fieldset-items.hbs | 5 + .../sheets/global/partials/inventory-item.hbs | 10 + 42 files changed, 2123 insertions(+), 254 deletions(-) rename module/applications/sheets/{ => actors}/adversary.mjs (54%) rename module/applications/sheets/{ => actors}/character.mjs (98%) create mode 100644 module/applications/sheets/applications/adversary-settings.mjs create mode 100644 styles/less/actors/adversary/actions.less create mode 100644 styles/less/actors/adversary/header.less create mode 100644 styles/less/actors/adversary/sheet.less create mode 100644 styles/less/actors/adversary/sidebar.less create mode 100644 styles/less/applications/adversary-settings/actions.less create mode 100644 styles/less/applications/adversary-settings/experiences.less create mode 100644 styles/less/applications/adversary-settings/sheet.less create mode 100644 styles/less/applications/header.less create mode 100644 styles/less/global/dialog.less create mode 100644 styles/less/global/prose-mirror.less create mode 100644 templates/sheets/actors/adversary/actions.hbs create mode 100644 templates/sheets/actors/adversary/effects.hbs create mode 100644 templates/sheets/actors/adversary/notes.hbs create mode 100644 templates/sheets/actors/adversary/sidebar.hbs create mode 100644 templates/sheets/applications/adversary-settings/actions.hbs create mode 100644 templates/sheets/applications/adversary-settings/attack.hbs create mode 100644 templates/sheets/applications/adversary-settings/details.hbs create mode 100644 templates/sheets/applications/adversary-settings/experiences.hbs create mode 100644 templates/sheets/applications/adversary-settings/header.hbs diff --git a/lang/en.json b/lang/en.json index de29b88a..8c3897c5 100755 --- a/lang/en.json +++ b/lang/en.json @@ -223,12 +223,20 @@ "Major": "Major", "Minor": "Minor", "None": "None" - } + }, + "tabs": { + "details": "Details", + "attack": "Attack", + "experiences": "Experiences", + "features": "Features", + "actions": "Actions" + }, + "basics": "Basics" }, "ActionType": { - "Passive": "Passive", - "Action": "Action", - "Reaction": "Reaction" + "passive": "Passive", + "action": "Action", + "reaction": "Reaction" }, "Abilities": { "agility": { @@ -312,45 +320,45 @@ }, "Adversary": { "Type": { - "Bruiser": { + "bruiser": { "label": "Bruiser", - "Description": "Tough adversaries with powerful attacks." + "description": "Tough adversaries with powerful attacks." }, - "Horde": { + "horde": { "label": "Horde", - "Description": "A Horde represents a number of foes working in a group." + "description": "A Horde represents a number of foes working in a group." }, - "Leader": { + "leader": { "label": "Leader", - "Description": "Adversaries that command and summon other adversaries." + "description": "Adversaries that command and summon other adversaries." }, - "Minion": { + "minion": { "label": "Minion", - "Description": "Basic enemies that are easily dispatched but dangerous in numbers." + "description": "Basic enemies that are easily dispatched but dangerous in numbers." }, - "Ranged": { + "ranged": { "label": "Ranged", - "Description": "Adversaries that attack from a distance." + "description": "Adversaries that attack from a distance." }, - "Skulk": { + "skulk": { "label": "Skulk", - "Description": "Adversaries that maneuver and exploit opportunities to ambush their opponents." + "description": "Adversaries that maneuver and exploit opportunities to ambush their opponents." }, - "Social": { + "social": { "label": "Social", - "Description": "Adversaries that are primarily interpersonal threats or challenges." + "description": "Adversaries that are primarily interpersonal threats or challenges." }, - "Solo": { + "solo": { "label": "Solo", - "Description": "Designed to present a challenge to a whole party." + "description": "Designed to present a challenge to a whole party." }, - "Standard": { + "standard": { "label": "Standard", - "Description": "Rank and File adversaries." + "description": "Rank and File adversaries." }, - "Support": { + "support": { "label": "Support", - "Description": "Enemies that enhance their allies and/or disrupt their opponents." + "description": "Enemies that enhance their allies and/or disrupt their opponents." } }, "Trait": { @@ -1333,14 +1341,18 @@ }, "Tabs": { "Main": "Data", - "Information": "Information" + "Information": "Information", + "features": "Features", + "notes": "Notes", + "effects": "Effects" }, "General": "General", "DamageThresholds": "Damage Thresholds", "HitPoints": "Hit Points", "Stress": "Stress", "Experiences": "Experiences", - "Attack": "Attack" + "Attack": "Attack", + "horderHp": "Horde/HP" }, "Environment": { "FIELDS": { @@ -1568,6 +1580,7 @@ "sendToChat": "Send to Chat", "moreOptions": "More Options", "equip": "Equip", + "edit": "Edit", "unequip": "Unequip", "delete": "Delete", "sendToVault": "Send to Vault", @@ -1575,29 +1588,29 @@ }, "Actions": { "Types": { - "Attack": { - "Name": "Attack" + "attack": { + "name": "Attack" }, - "Spellcast": { - "Name": "Spellcast" + "spellcast": { + "name": "Spellcast" }, - "Resource": { - "Name": "Resource" + "resource": { + "name": "Resource" }, - "Damage": { - "Name": "Damage" + "damage": { + "name": "Damage" }, - "Healing": { - "Name": "Healing" + "healing": { + "name": "Healing" }, - "Summon": { - "Name": "Summon" + "summon": { + "name": "Summon" }, - "Effect": { - "Name": "Effect" + "effect": { + "name": "Effect" }, - "Macro": { - "Name": "Macro" + "macro": { + "name": "Macro" } }, "Settings": { diff --git a/module/applications/_module.mjs b/module/applications/_module.mjs index 25d48846..09f63742 100644 --- a/module/applications/_module.mjs +++ b/module/applications/_module.mjs @@ -1,6 +1,7 @@ -export { default as DhCharacterSheet } from './sheets/character.mjs'; +export { default as DhCharacterSheet } from './sheets/actors/character.mjs'; +export { default as DhpAdversarySheet } from './sheets/actors/adversary.mjs'; +export { default as DhpAdversarySheet } from './sheets/actors/adversary.mjs'; export { default as DhCompanionSheet } from './sheets/companion.mjs'; -export { default as DhpAdversarySheet } from './sheets/adversary.mjs'; export { default as DhpClassSheet } from './sheets/items/class.mjs'; export { default as DhpSubclass } from './sheets/items/subclass.mjs'; export { default as DhpFeatureSheet } from './sheets/items/feature.mjs'; diff --git a/module/applications/sheets/adversary.mjs b/module/applications/sheets/actors/adversary.mjs similarity index 54% rename from module/applications/sheets/adversary.mjs rename to module/applications/sheets/actors/adversary.mjs index 26791298..a588ba0f 100644 --- a/module/applications/sheets/adversary.mjs +++ b/module/applications/sheets/actors/adversary.mjs @@ -1,20 +1,23 @@ -import DHActionConfig from '../config/Action.mjs'; -import DaggerheartSheet from './daggerheart-sheet.mjs'; +import DHActionConfig from '../../config/Action.mjs'; +import DaggerheartSheet from '../daggerheart-sheet.mjs'; +import DHAdversarySettings from '../applications/adversary-settings.mjs'; const { ActorSheetV2 } = foundry.applications.sheets; export default class AdversarySheet extends DaggerheartSheet(ActorSheetV2) { static DEFAULT_OPTIONS = { tag: 'form', classes: ['daggerheart', 'sheet', 'actor', 'dh-style', 'adversary'], - position: { width: 450, height: 1000 }, + position: { width: 660, height: 766 }, actions: { reactionRoll: this.reactionRoll, - attackRoll: this.attackRoll, + useItem: this.useItem, + toChat: this.toChat, attackConfigure: this.attackConfigure, addExperience: this.addExperience, removeExperience: this.removeExperience, toggleHP: this.toggleHP, - toggleStress: this.toggleStress + toggleStress: this.toggleStress, + openSettings: this.openSettings }, form: { handler: this.updateForm, @@ -24,28 +27,37 @@ export default class AdversarySheet extends DaggerheartSheet(ActorSheetV2) { }; static PARTS = { + sidebar: { template: 'systems/daggerheart/templates/sheets/actors/adversary/sidebar.hbs' }, header: { template: 'systems/daggerheart/templates/sheets/actors/adversary/header.hbs' }, - tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' }, - main: { template: 'systems/daggerheart/templates/sheets/actors/adversary/main.hbs' }, - information: { template: 'systems/daggerheart/templates/sheets/actors/adversary/information.hbs' } + actions: { template: 'systems/daggerheart/templates/sheets/actors/adversary/actions.hbs' }, + notes: { template: 'systems/daggerheart/templates/sheets/actors/adversary/notes.hbs' }, + effects: { template: 'systems/daggerheart/templates/sheets/actors/adversary/effects.hbs' } }; static TABS = { - main: { + actions: { active: true, cssClass: '', group: 'primary', - id: 'main', + id: 'actions', icon: null, - label: 'DAGGERHEART.Sheets.Adversary.Tabs.Main' + label: 'DAGGERHEART.General.tabs.actions' }, - information: { + notes: { active: false, cssClass: '', group: 'primary', - id: 'information', + id: 'notes', icon: null, - label: 'DAGGERHEART.Sheets.Adversary.Tabs.Information' + label: 'DAGGERHEART.Sheets.Adversary.Tabs.notes' + }, + effects: { + active: false, + cssClass: '', + group: 'primary', + id: 'effects', + icon: null, + label: 'DAGGERHEART.Sheets.Adversary.Tabs.effects' } }; @@ -56,10 +68,15 @@ export default class AdversarySheet extends DaggerheartSheet(ActorSheetV2) { context.systemFields.attack.fields = this.document.system.attack.schema.fields; context.getEffectDetails = this.getEffectDetails.bind(this); context.isNPC = true; - console.log(context) return context; } + getAction(element) { + const itemId = (element.target ?? element).closest('[data-item-id]').dataset.itemId, + item = this.document.system.actions.find(x => x.id === itemId); + return item; + } + static async updateForm(event, _, formData) { await this.document.update(formData.object); this.render(); @@ -86,8 +103,40 @@ export default class AdversarySheet extends DaggerheartSheet(ActorSheetV2) { return {}; } - static async attackRoll(event) { - this.actor.system.attack.use(event); + static async openSettings() { + await new DHAdversarySettings(this.document).render(true); + } + + static async useItem(event) { + const action = this.getAction(event) ?? this.actor.system.attack; + action.use(event); + } + + static async toChat(event, button) { + if (button?.dataset?.type === 'experience') { + 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.name} ${ + experience.modifier < 0 ? experience.modifier : `+${experience.modifier}` + }` + }; + 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()); + } else { + const item = this.getAction(event) ?? this.document.system.attack; + item.toChat(this.document.id); + } } static async attackConfigure(event) { diff --git a/module/applications/sheets/character.mjs b/module/applications/sheets/actors/character.mjs similarity index 98% rename from module/applications/sheets/character.mjs rename to module/applications/sheets/actors/character.mjs index a8ed09c1..8be31690 100644 --- a/module/applications/sheets/character.mjs +++ b/module/applications/sheets/actors/character.mjs @@ -1,11 +1,11 @@ -import { capitalize } from '../../helpers/utils.mjs'; -import DhpDeathMove from '../deathMove.mjs'; -import DhpDowntime from '../downtime.mjs'; -import AncestrySelectionDialog from '../ancestrySelectionDialog.mjs'; -import DaggerheartSheet from './daggerheart-sheet.mjs'; -import { abilities } from '../../config/actorConfig.mjs'; -import DhCharacterlevelUp from '../levelup/characterLevelup.mjs'; -import DhCharacterCreation from '../characterCreation.mjs'; +import { capitalize } from '../../../helpers/utils.mjs'; +import DhpDeathMove from '../../deathMove.mjs'; +import DhpDowntime from '../../downtime.mjs'; +import AncestrySelectionDialog from '../../ancestrySelectionDialog.mjs'; +import DaggerheartSheet from '.././daggerheart-sheet.mjs'; +import { abilities } from '../../../config/actorConfig.mjs'; +import DhCharacterlevelUp from '../../levelup/characterLevelup.mjs'; +import DhCharacterCreation from '../../characterCreation.mjs'; const { ActorSheetV2 } = foundry.applications.sheets; const { TextEditor } = foundry.applications.ux; @@ -727,9 +727,7 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) { const cls = getDocumentClass('ChatMessage'); const systemData = { name: game.i18n.localize('DAGGERHEART.General.Experience.Single'), - description: `${experience.description} ${ - experience.total < 0 ? experience.total : `+${experience.total}` - }` + description: `${experience.name} ${experience.total < 0 ? experience.total : `+${experience.total}`}` }; const msg = new cls({ type: 'abilityUse', diff --git a/module/applications/sheets/applications/adversary-settings.mjs b/module/applications/sheets/applications/adversary-settings.mjs new file mode 100644 index 00000000..4c7ae8ec --- /dev/null +++ b/module/applications/sheets/applications/adversary-settings.mjs @@ -0,0 +1,181 @@ +import DHActionConfig from '../../config/Action.mjs'; +import DHBaseItemSheet from '../api/base-item.mjs'; +import { actionsTypes } from '../../../data/_module.mjs'; + +const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api; + +export default class DHAdversarySettings extends HandlebarsApplicationMixin(ApplicationV2) { + constructor(actor) { + super({}); + + this.actor = actor; + } + + get title() { + return `${game.i18n.localize('DAGGERHEART.Sheets.TABS.settings')}`; + } + + static DEFAULT_OPTIONS = { + tag: 'form', + classes: ['daggerheart', 'dh-style', 'dialog', 'adversary-settings'], + window: { + icon: 'fa-solid fa-wrench', + resizable: false + }, + position: { width: 455, height: 'auto' }, + actions: { + addExperience: this.#addExperience, + removeExperience: this.#removeExperience, + addAction: this.#addAction, + editAction: this.#editAction, + removeAction: this.#removeAction + }, + form: { + handler: this.updateForm, + submitOnChange: true, + closeOnSubmit: false + } + }; + + static PARTS = { + header: { + id: 'header', + template: 'systems/daggerheart/templates/sheets/applications/adversary-settings/header.hbs' + }, + tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' }, + details: { + id: 'details', + template: 'systems/daggerheart/templates/sheets/applications/adversary-settings/details.hbs' + }, + attack: { + id: 'attack', + template: 'systems/daggerheart/templates/sheets/applications/adversary-settings/attack.hbs' + }, + experiences: { + id: 'experiences', + template: 'systems/daggerheart/templates/sheets/applications/adversary-settings/experiences.hbs' + }, + actions: { + id: 'actions', + template: 'systems/daggerheart/templates/sheets/applications/adversary-settings/actions.hbs' + } + }; + + static TABS = { + details: { + active: true, + cssClass: '', + group: 'primary', + id: 'details', + icon: null, + label: 'DAGGERHEART.General.tabs.details' + }, + attack: { + active: false, + cssClass: '', + group: 'primary', + id: 'attack', + icon: null, + label: 'DAGGERHEART.General.tabs.attack' + }, + experiences: { + active: false, + cssClass: '', + group: 'primary', + id: 'experiences', + icon: null, + label: 'DAGGERHEART.General.tabs.experiences' + }, + actions: { + active: false, + cssClass: '', + group: 'primary', + id: 'actions', + icon: null, + label: 'DAGGERHEART.General.tabs.actions' + } + }; + + async _prepareContext(_options) { + const context = await super._prepareContext(_options); + context.document = this.actor; + context.tabs = this._getTabs(this.constructor.TABS); + context.systemFields = this.actor.system.schema.fields; + context.systemFields.attack.fields = this.actor.system.attack.schema.fields; + context.isNPC = true; + + return context; + } + + _getTabs(tabs) { + 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' : ''; + } + + return tabs; + } + + static async #addExperience() { + const newExperience = { + name: 'Experience', + modifier: 0 + }; + await this.actor.update({ [`system.experiences.${foundry.utils.randomID()}`]: newExperience }); + this.render(); + } + + static async #removeExperience(_, target) { + await this.actor.update({ [`system.experiences.-=${target.dataset.experience}`]: null }); + this.render(); + } + + static async #addAction(_event, _button) { + const actionType = await DHBaseItemSheet.selectActionType(); + if (!actionType) return; + try { + const cls = actionsTypes[actionType] ?? actionsTypes.attack, + action = new cls( + { + _id: foundry.utils.randomID(), + type: actionType, + name: game.i18n.localize(SYSTEM.ACTIONS.actionTypes[actionType].name), + ...cls.getSourceConfig(this.actor) + }, + { + parent: this.actor + } + ); + console.log(action); + await this.actor.update({ 'system.actions': [...this.actor.system.actions, action] }); + await new DHActionConfig(this.actor.system.actions[this.actor.system.actions.length - 1]).render({ + force: true + }); + this.render(); + } catch (error) { + console.log(error); + } + } + + static async #editAction(event, target) { + event.stopPropagation(); + const actionIndex = target.dataset.index; + await new DHActionConfig(this.actor.system.actions[actionIndex]).render({ + force: true + }); + } + + static async #removeAction(event, target) { + event.stopPropagation(); + const actionIndex = target.dataset.index; + await this.actor.update({ + 'system.actions': this.actor.system.actions.filter((_, index) => index !== Number.parseInt(actionIndex)) + }); + this.render(); + } + + static async updateForm(event, _, formData) { + await this.actor.update(formData.object); + this.render(); + } +} diff --git a/module/config/actionConfig.mjs b/module/config/actionConfig.mjs index 5dca28c2..6506e485 100644 --- a/module/config/actionConfig.mjs +++ b/module/config/actionConfig.mjs @@ -1,42 +1,42 @@ export const actionTypes = { attack: { id: 'attack', - name: 'DAGGERHEART.Actions.Types.Attack.Name', + name: 'DAGGERHEART.Actions.Types.attack.name', icon: 'fa-swords' }, // spellcast: { // id: 'spellcast', - // name: 'DAGGERHEART.Actions.Types.Spellcast.Name', + // name: 'DAGGERHEART.Actions.Types.spellcast.name', // icon: 'fa-book-sparkles' // }, healing: { id: 'healing', - name: 'DAGGERHEART.Actions.Types.Healing.Name', + name: 'DAGGERHEART.Actions.Types.healing.name', icon: 'fa-kit-medical' }, // resource: { // id: 'resource', - // name: 'DAGGERHEART.Actions.Types.Resource.Name', + // name: 'DAGGERHEART.Actions.Types.resource.name', // icon: 'fa-honey-pot' // }, damage: { id: 'damage', - name: 'DAGGERHEART.Actions.Types.Damage.Name', + name: 'DAGGERHEART.Actions.Types.damage.name', icon: 'fa-bone-break' }, summon: { id: 'summon', - name: 'DAGGERHEART.Actions.Types.Summon.Name', + name: 'DAGGERHEART.Actions.Types.summon.name', icon: 'fa-ghost' }, effect: { id: 'effect', - name: 'DAGGERHEART.Actions.Types.Effect.Name', + name: 'DAGGERHEART.Actions.Types.effect.name', icon: 'fa-person-rays' }, macro: { id: 'macro', - name: 'DAGGERHEART.Actions.Types.Macro.Name', + name: 'DAGGERHEART.Actions.Types.macro.name', icon: 'fa-scroll' } }; diff --git a/module/config/actorConfig.mjs b/module/config/actorConfig.mjs index 6af480d7..b3ebf9dc 100644 --- a/module/config/actorConfig.mjs +++ b/module/config/actorConfig.mjs @@ -83,53 +83,53 @@ export const featureProperties = { export const adversaryTypes = { bruiser: { id: 'bruiser', - label: 'DAGGERHEART.Adversary.Type.Bruiser.label', - description: 'DAGGERHEART.Adversary.Bruiser.Description' + label: 'DAGGERHEART.Adversary.Type.bruiser.label', + description: 'DAGGERHEART.Adversary.bruiser.description' }, horde: { id: 'horde', - label: 'DAGGERHEART.Adversary.Type.Horde.label', - description: 'DAGGERHEART.Adversary.Horde.Description' + label: 'DAGGERHEART.Adversary.Type.horde.label', + description: 'DAGGERHEART.Adversary.horde.description' }, leader: { id: 'leader', - label: 'DAGGERHEART.Adversary.Type.Leader.label', - description: 'DAGGERHEART.Adversary.Leader.Description' + label: 'DAGGERHEART.Adversary.Type.leader.label', + description: 'DAGGERHEART.Adversary.leader.description' }, minion: { id: 'minion', - label: 'DAGGERHEART.Adversary.Type.Minion.label', - description: 'DAGGERHEART.Adversary.Minion.Description' + label: 'DAGGERHEART.Adversary.Type.minion.label', + description: 'DAGGERHEART.Adversary.minion.description' }, ranged: { id: 'ranged', - label: 'DAGGERHEART.Adversary.Type.Ranged.label', - description: 'DAGGERHEART.Adversary.Ranged.Description' + label: 'DAGGERHEART.Adversary.Type.ranged.label', + description: 'DAGGERHEART.Adversary.ranged.description' }, skulk: { id: 'skulk', - label: 'DAGGERHEART.Adversary.Type.Skulk.label', - description: 'DAGGERHEART.Adversary.Skulk.Description' + label: 'DAGGERHEART.Adversary.Type.skulk.label', + description: 'DAGGERHEART.Adversary.skulk.description' }, social: { id: 'social', - label: 'DAGGERHEART.Adversary.Type.Social.label', - description: 'DAGGERHEART.Adversary.Social.Description' + label: 'DAGGERHEART.Adversary.Type.social.label', + description: 'DAGGERHEART.Adversary.social.description' }, solo: { id: 'solo', - label: 'DAGGERHEART.Adversary.Type.Solo.label', - description: 'DAGGERHEART.Adversary.Solo.Description' + label: 'DAGGERHEART.Adversary.Type.solo.label', + description: 'DAGGERHEART.Adversary.solo.description' }, standard: { id: 'standard', - label: 'DAGGERHEART.Adversary.Type.Standard.label', - description: 'DAGGERHEART.Adversary.Standard.Description' + label: 'DAGGERHEART.Adversary.Type.standard.label', + description: 'DAGGERHEART.Adversary.standard.description' }, support: { id: 'support', - label: 'DAGGERHEART.Adversary.Type.Support.label', - description: 'DAGGERHEART.Adversary.Support.Description' + label: 'DAGGERHEART.Adversary.Type.support.label', + description: 'DAGGERHEART.Adversary.support.description' } }; diff --git a/module/config/itemConfig.mjs b/module/config/itemConfig.mjs index a2a786b9..6d8488ba 100644 --- a/module/config/itemConfig.mjs +++ b/module/config/itemConfig.mjs @@ -712,14 +712,14 @@ export const valueTypes = { export const actionTypes = { passive: { id: 'passive', - label: 'DAGGERHEART.ActionType.Passive' + label: 'DAGGERHEART.ActionType.passive' }, action: { id: 'action', - label: 'DAGGERHEART.ActionType.Action' + label: 'DAGGERHEART.ActionType.action' }, reaction: { id: 'reaction', - label: 'DAGGERHEART.ActionType.Reaction' + label: 'DAGGERHEART.ActionType.reaction' } }; diff --git a/module/data/action/action.mjs b/module/data/action/action.mjs index bc0f6524..af5e061e 100644 --- a/module/data/action/action.mjs +++ b/module/data/action/action.mjs @@ -531,6 +531,29 @@ export class DHBaseAction extends foundry.abstract.DataModel { } } /* SAVE */ + + async toChat(origin) { + const cls = getDocumentClass('ChatMessage'); + const systemData = { + title: game.i18n.localize('DAGGERHEART.ActionType.action'), + origin: origin, + img: this.img, + name: this.name, + description: this.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()); + } } export class DHDamageAction extends DHBaseAction { diff --git a/module/data/actor/adversary.mjs b/module/data/actor/adversary.mjs index b1ed29ec..6e94d38e 100644 --- a/module/data/actor/adversary.mjs +++ b/module/data/actor/adversary.mjs @@ -30,8 +30,11 @@ export default class DhpAdversary extends BaseDataActor { choices: SYSTEM.ACTOR.adversaryTypes, initial: SYSTEM.ACTOR.adversaryTypes.standard.id }), - motivesAndTactics: new fields.HTMLField(), + description: new fields.StringField(), + motivesAndTactics: new fields.StringField(), + notes: new fields.HTMLField(), difficulty: new fields.NumberField({ required: true, initial: 1, integer: true }), + hordeHp: new fields.NumberField({ required: true, initial: 1, integer: true }), damageThresholds: new fields.SchemaField({ major: new fields.NumberField({ required: true, initial: 0, integer: true }), severe: new fields.NumberField({ required: true, initial: 0, integer: true }) @@ -40,6 +43,7 @@ export default class DhpAdversary extends BaseDataActor { hitPoints: resourceField(), stress: resourceField() }), + actions: new fields.ArrayField(new ActionField()), attack: new ActionField({ initial: { name: 'Attack', @@ -66,7 +70,7 @@ export default class DhpAdversary extends BaseDataActor { experiences: new fields.TypedObjectField( new fields.SchemaField({ name: new fields.StringField(), - value: new fields.NumberField({ required: true, integer: true, initial: 1 }) + modifier: new fields.NumberField({ required: true, integer: true, initial: 1 }) }) ), bonuses: new fields.SchemaField({ diff --git a/styles/daggerheart.css b/styles/daggerheart.css index 5cf696a1..b649213a 100755 --- a/styles/daggerheart.css +++ b/styles/daggerheart.css @@ -3871,8 +3871,6 @@ div.daggerheart.views.multiclass { } .application.sheet.daggerheart.actor.dh-style.character .character-sidebar-sheet .portrait { position: relative; - height: 235px; - width: 275px; border-bottom: 1px solid light-dark(#18162e, #f3c267); cursor: pointer; } @@ -3976,6 +3974,7 @@ div.daggerheart.views.multiclass { border: 1px solid light-dark(#18162e, #f3c267); border-radius: 6px; z-index: 1; + background: #18162e; } .application.sheet.daggerheart.actor.dh-style.character .character-sidebar-sheet .info-section .resources-section .status-bar .progress-bar::-webkit-progress-bar { border: none; @@ -3990,12 +3989,9 @@ div.daggerheart.views.multiclass { background: linear-gradient(15deg, #823b01 0%, #fc8e45 65%, #be0000 100%); border-radius: 6px; } -.application.sheet.daggerheart.actor.dh-style.character .character-sidebar-sheet .info-section .resources-section .status-bar .progress-bar::-moz-progress-value, -.application.sheet.daggerheart.actor.dh-style.character .character-sidebar-sheet .info-section .resources-section .status-bar .progress-bar::-moz-progress-bar { - border-radius: 6px; -} .application.sheet.daggerheart.actor.dh-style.character .character-sidebar-sheet .info-section .resources-section .status-bar .progress-bar::-moz-progress-bar { background: linear-gradient(15deg, #46140a 0%, #be0000 42%, #fcb045 100%); + border-radius: 6px; } .application.sheet.daggerheart.actor.dh-style.character .character-sidebar-sheet .info-section .resources-section .status-bar .progress-bar.stress-color::-moz-progress-bar { background: linear-gradient(15deg, #823b01 0%, #fc8e45 65%, #be0000 100%); @@ -4141,9 +4137,6 @@ div.daggerheart.views.multiclass { grid-row: 2; grid-column: 2; } -.application.sheet.daggerheart.actor.dh-style.character .window-content .old-sheet { - width: 500px; -} .application.sheet.daggerheart.actor.dh-style.character .tab.inventory .search-section { display: flex; gap: 10px; @@ -4299,6 +4292,533 @@ div.daggerheart.views.multiclass { scrollbar-width: thin; scrollbar-color: light-dark(#18162e, #f3c267) transparent; } +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet { + padding: 0 15px; + padding-top: 36px; + width: 100%; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet .name-row { + display: flex; + gap: 5px; + align-items: center; + justify-content: space-between; + padding: 0; + padding-top: 5px; + padding-bottom: 8px; + flex: 1; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet .name-row input[type='text'] { + font-size: 32px; + height: 42px; + text-align: start; + border: 1px solid transparent; + outline: 2px solid transparent; + transition: all 0.3s ease; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet .name-row input[type='text']:hover { + outline: 2px solid light-dark(#222, #f3c267); +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet .name-row .level-div { + white-space: nowrap; + display: flex; + justify-content: end; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet .name-row .level-div .label { + display: flex; + align-items: center; + gap: 4px; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet .name-row .level-div input { + width: 40px; + padding: 0; + text-align: center; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet .name-row .level-div .level-button { + color: light-dark(#222, #efe6d8); + font-size: 18px; + line-height: 1; + min-height: unset; + height: min-content; + padding: 4px; + font-family: 'Cinzel', serif; + margin: 0; + font-weight: normal; + border-color: light-dark(#18162e, #f3c267); + background-color: light-dark(transparent, #0e0d15); +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet .name-row .level-div .level-button:hover { + background-image: none; + background-color: var(--color-warm-2); + filter: drop-shadow(0 0 3px lightgray); +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet .tags { + display: flex; + gap: 10px; + padding-bottom: 16px; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet .tags .tag { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + padding: 3px 5px; + font-size: 12px; + font: 'Montserrat', sans-serif; + background: light-dark(#22222215, #efe6d815); + border: 1px solid light-dark(#222, #efe6d8); + border-radius: 3px; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet .tags .label { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + font-size: 12px; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet .adversary-info { + display: flex; + flex-direction: column; + gap: 12px; + padding: 16px 0; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet .adversary-info .description, +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet .adversary-info .motives-and-tatics { + font-family: 'Montserrat', sans-serif; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet .adversary-navigation { + display: flex; + gap: 8px; + align-items: center; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet .character-details { + display: flex; + justify-content: space-between; + padding: 5px 0; + margin-bottom: 10px; + font-size: 12px; + color: light-dark(#18162e, #f3c267); +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet .character-details span { + padding: 3px; + border-radius: 3px; + transition: all 0.3s ease; + cursor: pointer; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet .character-details span:hover { + background: light-dark(#18162e40, #f3c26740); +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet .character-details span.dot { + background: transparent; + cursor: default; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet .character-row { + display: flex; + gap: 20px; + align-items: center; + justify-content: space-between; + padding: 0; + margin-bottom: 15px; +} +.application.sheet.daggerheart.actor.dh-style.adversary .window-content { + display: grid; + grid-template-columns: 275px 1fr; + grid-template-rows: 283px 1fr; + gap: 15px 0; + height: 100%; + width: 100%; +} +.application.sheet.daggerheart.actor.dh-style.adversary .window-content .adversary-sidebar-sheet { + grid-row: 1 / span 2; + grid-column: 1; +} +.application.sheet.daggerheart.actor.dh-style.adversary .window-content .adversary-header-sheet { + grid-row: 1; + grid-column: 2; +} +.application.sheet.daggerheart.actor.dh-style.adversary .window-content .tab { + grid-row: 2; + grid-column: 2; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet { + width: 275px; + min-width: 275px; + border-right: 1px solid light-dark(#18162e, #f3c267); + background-image: url('../assets/parchments/dh-parchment-dark.png'); +} +.theme-light .application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet { + background: transparent; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .portrait { + position: relative; + border-bottom: 1px solid light-dark(#18162e, #f3c267); + cursor: pointer; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .portrait img { + height: 235px; + width: 275px; + object-fit: cover; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .portrait .death-roll-btn { + display: none; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .portrait.death-roll { + filter: grayscale(1); +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .portrait.death-roll .death-roll-btn { + display: flex; + position: absolute; + top: 30%; + right: 30%; + font-size: 6rem; + color: #efe6d8; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .portrait.death-roll .death-roll-btn:hover { + text-shadow: 0 0 8px #efe6d8; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .threshold-section { + position: relative; + display: flex; + gap: 10px; + background-color: light-dark(transparent, #18162e); + color: light-dark(#18162e, #f3c267); + padding: 5px 10px; + border: 1px solid light-dark(#18162e, #f3c267); + border-radius: 6px; + align-items: center; + width: fit-content; + height: 30px; + margin-top: 16px; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .threshold-section h4 { + font-size: 14px; + font-weight: bold; + text-transform: uppercase; + color: light-dark(#18162e, #f3c267); +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .threshold-section h4.threshold-value { + color: light-dark(#222, #efe6d8); +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .threshold-section .threshold-legend { + position: absolute; + bottom: -21px; + color: light-dark(#f3c267, #18162e); + background-color: light-dark(#18162e, #f3c267); + padding: 3px; + justify-self: anchor-center; + border-radius: 0 0 3px 3px; + text-transform: capitalize; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .threshold-section .hope-value { + display: flex; + cursor: pointer; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .info-section { + position: relative; + display: flex; + flex-direction: column; + top: -20px; + gap: 16px; + margin-bottom: -10px; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .info-section .resources-section { + display: flex; + justify-content: space-evenly; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .info-section .resources-section .status-bar { + position: relative; + width: 100px; + height: 40px; + justify-items: center; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .info-section .resources-section .status-bar .status-label { + position: relative; + top: 40px; + height: 22px; + width: 79px; + clip-path: path('M0 0H79L74 16.5L39 22L4 16.5L0 0Z'); + background: light-dark(#18162e, #f3c267); +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .info-section .resources-section .status-bar .status-label h4 { + font-weight: bold; + text-align: center; + line-height: 18px; + color: light-dark(#efe6d8, #18162e); +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .info-section .resources-section .status-bar .status-value { + position: absolute; + display: flex; + padding: 0 6px; + font-size: 1.5rem; + align-items: center; + width: 100px; + height: 40px; + justify-content: center; + text-align: center; + z-index: 2; + color: #efe6d8; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .info-section .resources-section .status-bar .status-value input[type='number'] { + background: transparent; + font-size: 1.5rem; + width: 40px; + height: 30px; + text-align: center; + border: none; + outline: 2px solid transparent; + color: #efe6d8; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .info-section .resources-section .status-bar .status-value input[type='number'].bar-input { + padding: 0; + color: #efe6d8; + backdrop-filter: none; + background: transparent; + transition: all 0.3s ease; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .info-section .resources-section .status-bar .status-value input[type='number'].bar-input:hover, +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .info-section .resources-section .status-bar .status-value input[type='number'].bar-input:focus { + background: rgba(24, 22, 46, 0.33); + backdrop-filter: blur(9.5px); +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .info-section .resources-section .status-bar .status-value .bar-label { + width: 40px; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .info-section .resources-section .status-bar .progress-bar { + position: absolute; + appearance: none; + width: 100px; + height: 40px; + border: 1px solid light-dark(#18162e, #f3c267); + border-radius: 6px; + z-index: 1; + background: #18162e; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .info-section .resources-section .status-bar .progress-bar::-webkit-progress-bar { + border: none; + background: #18162e; + border-radius: 6px; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .info-section .resources-section .status-bar .progress-bar::-webkit-progress-value { + background: linear-gradient(15deg, #46140a 0%, #be0000 42%, #fcb045 100%); + border-radius: 6px; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .info-section .resources-section .status-bar .progress-bar.stress-color::-webkit-progress-value { + background: linear-gradient(15deg, #823b01 0%, #fc8e45 65%, #be0000 100%); + border-radius: 6px; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .info-section .resources-section .status-bar .progress-bar::-moz-progress-bar { + background: linear-gradient(15deg, #46140a 0%, #be0000 42%, #fcb045 100%); + border-radius: 6px; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .info-section .resources-section .status-bar .progress-bar.stress-color::-moz-progress-bar { + background: linear-gradient(15deg, #823b01 0%, #fc8e45 65%, #be0000 100%); + border-radius: 6px; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .info-section .status-section { + display: flex; + flex-wrap: wrap; + gap: 10px; + justify-content: center; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .info-section .status-section .status-number { + justify-items: center; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .info-section .status-section .status-number .status-value { + position: relative; + display: flex; + width: 50px; + height: 30px; + border: 1px solid light-dark(#18162e, #f3c267); + border-bottom: none; + border-radius: 6px 6px 0 0; + padding: 0 6px; + font-size: 1.2rem; + align-items: center; + justify-content: center; + background: light-dark(transparent, #18162e); + z-index: 2; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .info-section .status-section .status-number .status-value.armor-slots { + width: 80px; + height: 30px; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .info-section .status-section .status-number .status-label { + padding: 2px 10px; + width: 100%; + border-radius: 3px; + background: light-dark(#18162e, #f3c267); +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .info-section .status-section .status-number .status-label h4 { + font-weight: bold; + text-align: center; + line-height: 18px; + font-size: 12px; + color: light-dark(#efe6d8, #18162e); +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .items-sidebar-list { + display: flex; + flex-direction: column; + gap: 5px; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .items-sidebar-list .inventory-item { + padding: 0 10px; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .attack-section .title { + display: flex; + gap: 15px; + align-items: center; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .attack-section .title h3 { + font-size: 20px; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .attack-section .items-list { + display: flex; + flex-direction: column; + gap: 10px; + align-items: center; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .experience-section { + margin-bottom: 20px; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .experience-section .title { + display: flex; + gap: 15px; + align-items: center; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .experience-section .title h3 { + font-size: 20px; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .experience-section .experience-list { + display: flex; + flex-direction: column; + gap: 5px; + width: 100%; + margin-top: 10px; + align-items: center; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .experience-section .experience-list .experience-row { + display: flex; + gap: 5px; + width: 250px; + align-items: center; + justify-content: space-between; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .experience-section .experience-list .experience-row .experience-name { + width: 180px; + text-align: start; + font-size: 14px; + font-family: 'Montserrat', sans-serif; + color: light-dark(#222, #efe6d8); +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .experience-section .experience-list .experience-value { + height: 25px; + width: 35px; + font-size: 14px; + font-family: 'Montserrat', sans-serif; + color: light-dark(#222, #efe6d8); + align-content: center; + text-align: center; + background: url(../assets/svg/experience-shield.svg) no-repeat; +} +.theme-light .application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .experience-section .experience-list .experience-value { + background: url('../assets/svg/experience-shield-light.svg') no-repeat; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .reaction-section { + display: flex; + padding: 0 10px; + margin-top: 20px; + width: 100%; +} +.application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .reaction-section button { + width: 100%; +} +.application.daggerheart.dh-style.dialog .window-content .dialog-header { + width: 100%; + padding-bottom: 16px; +} +.application.daggerheart.dh-style.dialog .window-content .dialog-header h1 { + font-family: 'Cinzel', serif; + font-style: normal; + font-weight: 700; + font-size: 24px; + margin: 0; + text-align: center; + color: light-dark(#18162e, #f3c267); +} +.application.daggerheart.dh-style.dialog .tab.details.active, +.application.daggerheart.dh-style.dialog .tab.attack.active { + display: flex; + flex-direction: column; + gap: 16px; +} +.application.daggerheart.dh-style.dialog .tab .fieldsets-section { + display: flex; + gap: 16px; +} +.application.daggerheart.dh-style.dialog .tab.experiences .add-experience-btn { + width: 100%; + margin-bottom: 12px; +} +.application.daggerheart.dh-style.dialog .tab.experiences .experience-list { + display: flex; + flex-direction: column; + gap: 10px; +} +.application.daggerheart.dh-style.dialog .tab.experiences .experience-list .experience-item { + display: grid; + grid-template-columns: 3fr 1fr 30px; + align-items: center; + gap: 5px; +} +.application.daggerheart.dh-style.dialog .tab.experiences .experience-list .experience-item a { + text-align: center; +} +.application.daggerheart.dh-style.dialog .tab.actions .add-action-btn { + width: 100%; + margin-bottom: 12px; +} +.application.daggerheart.dh-style.dialog .tab.actions .action-list { + display: flex; + flex-direction: column; + gap: 10px; +} +.application.daggerheart.dh-style.dialog .tab.actions .action-list .action-item { + display: grid; + grid-template-columns: 40px 1fr auto; + align-items: center; + gap: 5px; +} +.application.daggerheart.dh-style.dialog .tab.actions .action-list .action-item .label { + font-family: 'Montserrat', sans-serif; +} +.application.daggerheart.dh-style.dialog .tab.actions .action-list .action-item .label .tags { + display: flex; + gap: 10px; +} +.application.daggerheart.dh-style.dialog .tab.actions .action-list .action-item .label .tags .tag { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + padding: 3px 5px; + font-size: 12px; + background: light-dark(#22222215, #efe6d815); + border: 1px solid light-dark(#222, #efe6d8); + border-radius: 3px; +} +.application.daggerheart.dh-style.dialog .tab.actions .action-list .action-item .label .tags .label { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + font-size: 12px; +} +.application.daggerheart.dh-style.dialog .tab.actions .action-list .action-item .controls { + display: flex; + gap: 5px; +} +.application.daggerheart.dh-style.dialog .tab.actions .action-list .action-item .controls a { + text-align: center; +} .application.sheet.daggerheart.actor.dh-style.companion .profile { height: 80px; width: 80px; @@ -4542,11 +5062,43 @@ div.daggerheart.views.multiclass { padding: 0 15px; overflow-y: hidden; } -.application.sheet.dh-style { +.theme-light .application.dialog.dh-style { + background-image: url('../assets/parchments/dh-parchment-light.png'); + background-repeat: no-repeat; + background-position: center; +} +.theme-dark .application.dialog.dh-style { + background-image: url('../assets/parchments/dh-parchment-dark.png'); + background-repeat: no-repeat; + background-position: center; +} +.application.dialog.dh-style { + border: none; +} +.application.dialog.dh-style .window-header { + background: transparent; + border-bottom: none; + color: light-dark(#18162e, #efe6d8); +} +.application.dialog.dh-style .window-header h1 { + color: light-dark(#18162e, #efe6d8); + font-family: 'Montserrat', sans-serif; +} +.application.dialog.dh-style .window-header button { + color: light-dark(#18162e, #efe6d8); + background: light-dark(transparent, #0e0d15); + border: 1px solid light-dark(#18162e, transparent); + padding: 0; +} +.application.dialog.dh-style .window-header button:hover { + border: 1px solid light-dark(#18162e, #f3c267); + color: light-dark(#18162e, #f3c267); +} +.application.dh-style { border: 1px solid light-dark(#18162e, #f3c267); } -.application.sheet.dh-style input[type='text'], -.application.sheet.dh-style input[type='number'] { +.application.dh-style input[type='text'], +.application.dh-style input[type='number'] { background: light-dark(transparent, transparent); border-radius: 6px; box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05); @@ -4556,171 +5108,179 @@ div.daggerheart.views.multiclass { color: light-dark(#18162e, #f3c267); border: 1px solid light-dark(#222, #efe6d8); } -.application.sheet.dh-style input[type='text']:hover[type='text'], -.application.sheet.dh-style input[type='number']:hover[type='text'], -.application.sheet.dh-style input[type='text']:hover[type='number'], -.application.sheet.dh-style input[type='number']:hover[type='number'], -.application.sheet.dh-style input[type='text']:focus[type='text'], -.application.sheet.dh-style input[type='number']:focus[type='text'], -.application.sheet.dh-style input[type='text']:focus[type='number'], -.application.sheet.dh-style input[type='number']:focus[type='number'] { +.application.dh-style input[type='text']:hover[type='text'], +.application.dh-style input[type='number']:hover[type='text'], +.application.dh-style input[type='text']:hover[type='number'], +.application.dh-style input[type='number']:hover[type='number'], +.application.dh-style input[type='text']:focus[type='text'], +.application.dh-style input[type='number']:focus[type='text'], +.application.dh-style input[type='text']:focus[type='number'], +.application.dh-style input[type='number']:focus[type='number'] { background: light-dark(rgba(0, 0, 0, 0.05), rgba(24, 22, 46, 0.33)); box-shadow: none; outline: 2px solid light-dark(#222, #efe6d8); } -.application.sheet.dh-style input[type='checkbox']:checked::after { +.application.dh-style input[type='checkbox']:checked::after { color: light-dark(#222, #f3c267); } -.application.sheet.dh-style input[type='checkbox']:checked::before { +.application.dh-style input[type='checkbox']:checked::before { color: light-dark(transparent, #18162e); } -.application.sheet.dh-style input[type='checkbox']::before { +.application.dh-style input[type='checkbox']::before { color: light-dark(#222, #efe6d8); } -.application.sheet.dh-style button { +.application.dh-style button { background: light-dark(transparent, #f3c267); border: 1px solid light-dark(#18162e, #18162e); color: light-dark(#18162e, #18162e); outline: none; box-shadow: none; } -.application.sheet.dh-style button:hover { +.application.dh-style button:hover { background: light-dark(rgba(0, 0, 0, 0.3), #18162e); color: light-dark(#18162e, #f3c267); } -.application.sheet.dh-style button.glow { +.application.dh-style button.glow { animation: glow 0.75s infinite alternate; } -.application.sheet.dh-style select { +.application.dh-style select { background: light-dark(transparent, transparent); color: light-dark(#222, #efe6d8); font-family: 'Montserrat', sans-serif; outline: 2px solid transparent; border: 1px solid light-dark(#222, #efe6d8); } -.application.sheet.dh-style select:focus, -.application.sheet.dh-style select:hover { +.application.dh-style select:focus, +.application.dh-style select:hover { outline: 2px solid light-dark(#222, #efe6d8); box-shadow: none; } -.application.sheet.dh-style select option { +.application.dh-style select option { color: #efe6d8; background-color: #18162e; border-radius: 6px; } -.application.sheet.dh-style p { +.application.dh-style p { margin: 0; } -.application.sheet.dh-style ul { +.application.dh-style ul { margin: 0; padding: 0; list-style: none; } -.application.sheet.dh-style li { +.application.dh-style li { margin: 0; } -.application.sheet.dh-style a:hover, -.application.sheet.dh-style a.active { +.application.dh-style a:hover, +.application.dh-style a.active { + font-weight: bold; text-shadow: 0 0 8px light-dark(#18162e, #f3c267); } -.application.sheet.dh-style fieldset { +.application.dh-style fieldset { align-items: center; margin-top: 5px; border-radius: 6px; border-color: light-dark(#18162e, #f3c267); } -.application.sheet.dh-style fieldset.glassy { +.application.dh-style fieldset.glassy { background-color: light-dark(#18162e10, #f3c26710); border-color: transparent; } -.application.sheet.dh-style fieldset.glassy legend { +.application.dh-style fieldset.glassy legend { padding: 2px 12px; border-radius: 3px; background-color: light-dark(#18162e, #f3c267); color: light-dark(#efe6d8, #18162e); } -.application.sheet.dh-style fieldset.flex { +.application.dh-style fieldset.fit-height { + height: 95%; +} +.application.dh-style fieldset.flex { display: flex; gap: 20px; } -.application.sheet.dh-style fieldset.one-column { +.application.dh-style fieldset.one-column { display: flex; flex-direction: column; align-items: start; gap: 10px; min-height: 64px; } -.application.sheet.dh-style fieldset.two-columns { +.application.dh-style fieldset.two-columns { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; } -.application.sheet.dh-style fieldset.two-columns.even { +.application.dh-style fieldset.two-columns.even { grid-template-columns: 1fr 1fr; } -.application.sheet.dh-style fieldset.two-columns .full-width { +.application.dh-style fieldset.two-columns .full-width { grid-column: span 2; } -.application.sheet.dh-style fieldset legend { +.application.dh-style fieldset legend { font-family: 'Montserrat', sans-serif; font-weight: bold; color: light-dark(#18162e, #f3c267); } -.application.sheet.dh-style fieldset input[type='text'], -.application.sheet.dh-style fieldset input[type='number'] { +.application.dh-style fieldset input[type='text'], +.application.dh-style fieldset input[type='number'] { color: light-dark(#222, #efe6d8); font-family: 'Montserrat', sans-serif; transition: all 0.3s ease; outline: 2px solid transparent; } -.application.sheet.dh-style fieldset input[type='text']:focus, -.application.sheet.dh-style fieldset input[type='number']:focus, -.application.sheet.dh-style fieldset input[type='text']:hover, -.application.sheet.dh-style fieldset input[type='number']:hover { +.application.dh-style fieldset input[type='text']:focus, +.application.dh-style fieldset input[type='number']:focus, +.application.dh-style fieldset input[type='text']:hover, +.application.dh-style fieldset input[type='number']:hover { outline: 2px solid light-dark(#222, #efe6d8); } -.application.sheet.dh-style fieldset .nest-inputs { +.application.dh-style fieldset .nest-inputs { display: flex; align-items: center; + width: 100%; gap: 5px; } -.application.sheet.dh-style fieldset .form-group label { +.application.dh-style fieldset .form-group { + width: 100%; +} +.application.dh-style fieldset .form-group label { font-family: 'Montserrat', sans-serif; font-weight: bold; font-size: smaller; } -.application.sheet.dh-style .two-columns { +.application.dh-style .two-columns { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; } -.application.sheet.dh-style .two-columns.even { +.application.dh-style .two-columns.even { grid-template-columns: 1fr 1fr; } -.application.sheet.dh-style line-div { +.application.dh-style line-div { display: block; height: 1px; width: 100%; border-bottom: 1px solid light-dark(#18162e, #f3c267); mask-image: linear-gradient(270deg, transparent 0%, black 50%, transparent 100%); } -.application.sheet.dh-style side-line-div { +.application.dh-style side-line-div { display: block; height: 1px; width: 100%; border-bottom: 1px solid light-dark(#18162e, #f3c267); mask-image: linear-gradient(270deg, transparent 0%, black 100%); } -.application.sheet.dh-style side-line-div.invert { +.application.dh-style side-line-div.invert { mask-image: linear-gradient(270deg, black 0%, transparent 100%); } -.application.sheet.dh-style .item-description { +.application.dh-style .item-description { opacity: 1; transform: translateY(0); - transition: opacity 0.3s ease-out, transform 0.3s ease-out; grid-column: 1/-1; + transition: opacity 0.3s ease-out, transform 0.3s ease-out; } -.application.sheet.dh-style .item-description.invisible { +.application.dh-style .item-description.invisible { height: 0; opacity: 0; overflow: hidden; @@ -4906,14 +5466,15 @@ div.daggerheart.views.multiclass { position: relative; right: 2px; } -.sheet.daggerheart.dh-style .tab-navigation { +.daggerheart.dh-style .tab-navigation { margin: 5px 0; height: 40px; + width: 100%; } -.sheet.daggerheart.dh-style .tab-navigation .feature-tab { +.daggerheart.dh-style .tab-navigation .feature-tab { border: none; } -.sheet.daggerheart.dh-style .tab-navigation .feature-tab a { +.daggerheart.dh-style .tab-navigation .feature-tab a { color: light-dark(#18162e, #f3c267); font-family: 'Montserrat', sans-serif; } @@ -5163,13 +5724,13 @@ div.daggerheart.views.multiclass { .sheet.daggerheart.dh-style.item .tab.features .feature-list .feature-item .feature-line .controls a { text-shadow: none; } -.application.sheet.daggerheart.actor.dh-style.character .inventory-item { +.application.sheet.daggerheart.actor.dh-style .inventory-item { display: grid; grid-template-columns: 40px 1fr 60px; gap: 10px; width: 100%; } -.application.sheet.daggerheart.actor.dh-style.character .inventory-item .item-img { +.application.sheet.daggerheart.actor.dh-style .inventory-item .item-img { height: 40px; width: 40px; border-radius: 3px; @@ -5177,20 +5738,20 @@ div.daggerheart.views.multiclass { cursor: pointer; object-fit: cover; } -.application.sheet.daggerheart.actor.dh-style.character .inventory-item .item-label { +.application.sheet.daggerheart.actor.dh-style .inventory-item .item-label { font-family: 'Montserrat', sans-serif; align-self: center; } -.application.sheet.daggerheart.actor.dh-style.character .inventory-item .item-label .item-name { +.application.sheet.daggerheart.actor.dh-style .inventory-item .item-label .item-name { font-size: 14px; } -.application.sheet.daggerheart.actor.dh-style.character .inventory-item .item-label .item-tags, -.application.sheet.daggerheart.actor.dh-style.character .inventory-item .item-label .item-labels { +.application.sheet.daggerheart.actor.dh-style .inventory-item .item-label .item-tags, +.application.sheet.daggerheart.actor.dh-style .inventory-item .item-label .item-labels { display: flex; gap: 10px; } -.application.sheet.daggerheart.actor.dh-style.character .inventory-item .item-label .item-tags .tag, -.application.sheet.daggerheart.actor.dh-style.character .inventory-item .item-label .item-labels .tag { +.application.sheet.daggerheart.actor.dh-style .inventory-item .item-label .item-tags .tag, +.application.sheet.daggerheart.actor.dh-style .inventory-item .item-label .item-labels .tag { display: flex; flex-direction: row; justify-content: center; @@ -5201,27 +5762,27 @@ div.daggerheart.views.multiclass { border: 1px solid light-dark(#222, #efe6d8); border-radius: 3px; } -.application.sheet.daggerheart.actor.dh-style.character .inventory-item .item-label .item-tags .label, -.application.sheet.daggerheart.actor.dh-style.character .inventory-item .item-label .item-labels .label { +.application.sheet.daggerheart.actor.dh-style .inventory-item .item-label .item-tags .label, +.application.sheet.daggerheart.actor.dh-style .inventory-item .item-label .item-labels .label { display: flex; flex-direction: row; justify-content: center; align-items: center; font-size: 12px; } -.application.sheet.daggerheart.actor.dh-style.character .inventory-item .controls { +.application.sheet.daggerheart.actor.dh-style .inventory-item .controls { display: flex; align-items: center; justify-content: end; gap: 8px; } -.application.sheet.daggerheart.actor.dh-style.character .inventory-item .controls a { +.application.sheet.daggerheart.actor.dh-style .inventory-item .controls a { text-align: center; } -.application.sheet.daggerheart.actor.dh-style.character .inventory-item .controls a.unequipped { +.application.sheet.daggerheart.actor.dh-style .inventory-item .controls a.unequipped { opacity: 0.4; } -.application.sheet.daggerheart.actor.dh-style.character .card-item { +.application.sheet.daggerheart.actor.dh-style .card-item { position: relative; height: 120px; width: 100px; @@ -5229,21 +5790,21 @@ div.daggerheart.views.multiclass { border-radius: 6px; cursor: pointer; } -.application.sheet.daggerheart.actor.dh-style.character .card-item:hover .card-label { +.application.sheet.daggerheart.actor.dh-style .card-item:hover .card-label { padding-top: 15px; } -.application.sheet.daggerheart.actor.dh-style.character .card-item:hover .card-label .controls { +.application.sheet.daggerheart.actor.dh-style .card-item:hover .card-label .controls { opacity: 1; visibility: visible; transition: all 0.3s ease; max-height: 16px; } -.application.sheet.daggerheart.actor.dh-style.character .card-item .card-img { +.application.sheet.daggerheart.actor.dh-style .card-item .card-img { height: 100%; width: 100%; object-fit: cover; } -.application.sheet.daggerheart.actor.dh-style.character .card-item .card-label { +.application.sheet.daggerheart.actor.dh-style .card-item .card-label { display: flex; flex-direction: column; height: fit-content; @@ -5257,7 +5818,7 @@ div.daggerheart.views.multiclass { bottom: 0; mask-image: linear-gradient(180deg, transparent 0%, black 20%); } -.application.sheet.daggerheart.actor.dh-style.character .card-item .card-label .card-name { +.application.sheet.daggerheart.actor.dh-style .card-item .card-label .card-name { font-family: 'Montserrat', sans-serif; font-style: normal; font-weight: 400; @@ -5265,7 +5826,7 @@ div.daggerheart.views.multiclass { line-height: 15px; color: #efe6d8; } -.application.sheet.daggerheart.actor.dh-style.character .card-item .card-label .controls { +.application.sheet.daggerheart.actor.dh-style .card-item .card-label .controls { display: flex; gap: 15px; align-items: center; @@ -5275,18 +5836,37 @@ div.daggerheart.views.multiclass { transition: all 0.3s ease; color: #efe6d8; } -.application.sheet.daggerheart.actor.dh-style.character .items-list { +.application.daggerheart.dh-style .items-list { display: flex; flex-direction: column; gap: 10px; align-items: center; } -.application.sheet.daggerheart.actor.dh-style.character .card-list { +.application.daggerheart.dh-style .card-list { display: flex; flex-direction: row; gap: 10px; align-items: center; } +.application prose-mirror { + height: 100% !important; +} +.application prose-mirror .editor-menu { + background-color: transparent; +} +.application prose-mirror .editor-content { + scrollbar-width: thin; + scrollbar-color: light-dark(#18162e, #f3c267) transparent; +} +.application prose-mirror .editor-content h1 { + font-size: 36px; +} +.application prose-mirror .editor-content h2 { + font-size: 32px; +} +.application prose-mirror .editor-content h3 { + font-size: 24px; +} .daggerheart { /* Flex */ /****/ diff --git a/styles/daggerheart.less b/styles/daggerheart.less index c1d19c7a..9c5ba914 100755 --- a/styles/daggerheart.less +++ b/styles/daggerheart.less @@ -25,6 +25,14 @@ @import './less/actors/character/biography.less'; @import './less/actors/character/features.less'; +@import './less/actors/adversary/header.less'; +@import './less/actors/adversary/sheet.less'; +@import './less/actors/adversary/sidebar.less'; + +@import './less/applications/header.less'; +@import './less/applications/adversary-settings/sheet.less'; +@import './less/applications/adversary-settings/experiences.less'; +@import './less/applications/adversary-settings/actions.less'; @import './less/actors/companion/sheet.less'; @import './less/actors/adversary.less'; @@ -38,6 +46,7 @@ @import './less/utils/fonts.less'; @import './less/global/sheet.less'; +@import './less/global/dialog.less'; @import './less/global/elements.less'; @import './less/global/tab-navigation.less'; @import './less/global/tab-form-footer.less'; @@ -47,6 +56,7 @@ @import './less/global/feature-section.less'; @import './less/global/inventory-item.less'; @import './less/global/inventory-fieldset-items.less'; +@import './less/global/prose-mirror.less'; @import '../node_modules/@yaireo/tagify/dist/tagify.css'; .daggerheart { diff --git a/styles/less/actors/adversary/actions.less b/styles/less/actors/adversary/actions.less new file mode 100644 index 00000000..97bb45e7 --- /dev/null +++ b/styles/less/actors/adversary/actions.less @@ -0,0 +1,20 @@ +@import '../../utils/colors.less'; +@import '../../utils/fonts.less'; + +.application.sheet.daggerheart.actor.dh-style.adversary { + .tab.actions { + .action-section { + display: flex; + flex-direction: column; + gap: 10px; + overflow-y: auto; + mask-image: linear-gradient(0deg, transparent 0%, black 5%, black 95%, transparent 100%); + padding: 20px 0; + padding-top: 10px; + height: 95%; + + scrollbar-width: thin; + scrollbar-color: light-dark(@dark-blue, @golden) transparent; + } + } +} diff --git a/styles/less/actors/adversary/header.less b/styles/less/actors/adversary/header.less new file mode 100644 index 00000000..a7a55f35 --- /dev/null +++ b/styles/less/actors/adversary/header.less @@ -0,0 +1,152 @@ +@import '../../utils/colors.less'; +@import '../../utils/fonts.less'; + +.application.sheet.daggerheart.actor.dh-style.adversary { + .adversary-header-sheet { + padding: 0 15px; + padding-top: 36px; + width: 100%; + + .name-row { + display: flex; + gap: 5px; + align-items: center; + justify-content: space-between; + padding: 0; + padding-top: 5px; + padding-bottom: 8px; + flex: 1; + + input[type='text'] { + font-size: 32px; + height: 42px; + text-align: start; + border: 1px solid transparent; + outline: 2px solid transparent; + transition: all 0.3s ease; + + &:hover { + outline: 2px solid light-dark(@dark, @golden); + } + } + + .level-div { + white-space: nowrap; + display: flex; + justify-content: end; + + .label { + display: flex; + align-items: center; + gap: 4px; + } + + input { + width: 40px; + padding: 0; + text-align: center; + } + + .level-button { + color: light-dark(@dark, @beige); + font-size: 18px; + line-height: 1; + min-height: unset; + height: min-content; + padding: 4px; + font-family: 'Cinzel', serif; + margin: 0; + font-weight: normal; + border-color: light-dark(@dark-blue, @golden); + background-color: light-dark(transparent, @deep-black); + + &:hover { + background-image: none; + background-color: var(--color-warm-2); + filter: drop-shadow(0 0 3px lightgray); + } + } + } + } + + .tags { + display: flex; + gap: 10px; + padding-bottom: 16px; + + .tag { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + padding: 3px 5px; + font-size: 12px; + font: @font-body; + + background: light-dark(@dark-15, @beige-15); + border: 1px solid light-dark(@dark, @beige); + border-radius: 3px; + } + + .label { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + font-size: 12px; + } + } + + .adversary-info { + display: flex; + flex-direction: column; + gap: 12px; + padding: 16px 0; + + .description, + .motives-and-tatics { + font-family: @font-body; + } + } + + .adversary-navigation { + display: flex; + gap: 8px; + align-items: center; + } + + .character-details { + display: flex; + justify-content: space-between; + padding: 5px 0; + margin-bottom: 10px; + font-size: 12px; + color: light-dark(@dark-blue, @golden); + + span { + padding: 3px; + border-radius: 3px; + transition: all 0.3s ease; + cursor: pointer; + + &:hover { + background: light-dark(@dark-blue-40, @golden-40); + } + + &.dot { + background: transparent; + cursor: default; + } + } + } + + .character-row { + display: flex; + gap: 20px; + align-items: center; + justify-content: space-between; + padding: 0; + margin-bottom: 15px; + } + } +} diff --git a/styles/less/actors/adversary/sheet.less b/styles/less/actors/adversary/sheet.less new file mode 100644 index 00000000..87bb9652 --- /dev/null +++ b/styles/less/actors/adversary/sheet.less @@ -0,0 +1,28 @@ +@import '../../utils/colors.less'; +@import '../../utils/fonts.less'; + +.application.sheet.daggerheart.actor.dh-style.adversary { + .window-content { + display: grid; + grid-template-columns: 275px 1fr; + grid-template-rows: 283px 1fr; + gap: 15px 0; + height: 100%; + width: 100%; + + .adversary-sidebar-sheet { + grid-row: 1 / span 2; + grid-column: 1; + } + + .adversary-header-sheet { + grid-row: 1; + grid-column: 2; + } + + .tab { + grid-row: 2; + grid-column: 2; + } + } +} diff --git a/styles/less/actors/adversary/sidebar.less b/styles/less/actors/adversary/sidebar.less new file mode 100644 index 00000000..df2ca161 --- /dev/null +++ b/styles/less/actors/adversary/sidebar.less @@ -0,0 +1,341 @@ +@import '../../utils/colors.less'; +@import '../../utils/fonts.less'; + +.application.sheet.daggerheart.actor.dh-style.adversary { + .adversary-sidebar-sheet { + width: 275px; + min-width: 275px; + border-right: 1px solid light-dark(@dark-blue, @golden); + background-image: url('../assets/parchments/dh-parchment-dark.png'); + + .theme-light & { + background: transparent; + } + + .portrait { + position: relative; + border-bottom: 1px solid light-dark(@dark-blue, @golden); + cursor: pointer; + + img { + height: 235px; + width: 275px; + object-fit: cover; + } + + .death-roll-btn { + display: none; + } + + &.death-roll { + filter: grayscale(1); + + .death-roll-btn { + display: flex; + position: absolute; + top: 30%; + right: 30%; + font-size: 6rem; + color: @beige; + + &:hover { + text-shadow: 0 0 8px @beige; + } + } + } + } + + .threshold-section { + position: relative; + display: flex; + gap: 10px; + background-color: light-dark(transparent, @dark-blue); + color: light-dark(@dark-blue, @golden); + padding: 5px 10px; + border: 1px solid light-dark(@dark-blue, @golden); + border-radius: 6px; + align-items: center; + width: fit-content; + height: 30px; + margin-top: 16px; + + h4 { + font-size: 14px; + font-weight: bold; + text-transform: uppercase; + color: light-dark(@dark-blue, @golden); + + &.threshold-value { + color: light-dark(@dark, @beige); + } + } + + .threshold-legend { + position: absolute; + bottom: -21px; + color: light-dark(@golden, @dark-blue); + background-color: light-dark(@dark-blue, @golden); + padding: 3px; + justify-self: anchor-center; + border-radius: 0 0 3px 3px; + text-transform: capitalize; + } + + .hope-value { + display: flex; + cursor: pointer; + } + } + + .info-section { + position: relative; + display: flex; + flex-direction: column; + top: -20px; + gap: 16px; + margin-bottom: -10px; + + .resources-section { + display: flex; + justify-content: space-evenly; + + .status-bar { + position: relative; + width: 100px; + height: 40px; + justify-items: center; + + .status-label { + position: relative; + top: 40px; + height: 22px; + width: 79px; + clip-path: path('M0 0H79L74 16.5L39 22L4 16.5L0 0Z'); + background: light-dark(@dark-blue, @golden); + + h4 { + font-weight: bold; + text-align: center; + line-height: 18px; + color: light-dark(@beige, @dark-blue); + } + } + .status-value { + position: absolute; + display: flex; + padding: 0 6px; + font-size: 1.5rem; + align-items: center; + width: 100px; + height: 40px; + justify-content: center; + text-align: center; + z-index: 2; + color: @beige; + + input[type='number'] { + background: transparent; + font-size: 1.5rem; + width: 40px; + height: 30px; + text-align: center; + border: none; + outline: 2px solid transparent; + color: @beige; + + &.bar-input { + padding: 0; + color: @beige; + backdrop-filter: none; + background: transparent; + transition: all 0.3s ease; + + &:hover, + &:focus { + background: @semi-transparent-dark-blue; + backdrop-filter: blur(9.5px); + } + } + } + + .bar-label { + width: 40px; + } + } + .progress-bar { + position: absolute; + appearance: none; + width: 100px; + height: 40px; + border: 1px solid light-dark(@dark-blue, @golden); + border-radius: 6px; + z-index: 1; + background: @dark-blue; + + &::-webkit-progress-bar { + border: none; + background: @dark-blue; + border-radius: 6px; + } + &::-webkit-progress-value { + background: @gradient-hp; + border-radius: 6px; + } + &.stress-color::-webkit-progress-value { + background: @gradient-stress; + border-radius: 6px; + } + &::-moz-progress-bar { + background: @gradient-hp; + border-radius: 6px; + } + &.stress-color::-moz-progress-bar { + background: @gradient-stress; + border-radius: 6px; + } + } + } + } + + .status-section { + display: flex; + flex-wrap: wrap; + gap: 10px; + justify-content: center; + + .status-number { + justify-items: center; + + .status-value { + position: relative; + display: flex; + width: 50px; + height: 30px; + border: 1px solid light-dark(@dark-blue, @golden); + border-bottom: none; + border-radius: 6px 6px 0 0; + padding: 0 6px; + font-size: 1.2rem; + align-items: center; + justify-content: center; + background: light-dark(transparent, @dark-blue); + z-index: 2; + + &.armor-slots { + width: 80px; + height: 30px; + } + } + + .status-label { + padding: 2px 10px; + width: 100%; + border-radius: 3px; + background: light-dark(@dark-blue, @golden); + + h4 { + font-weight: bold; + text-align: center; + line-height: 18px; + font-size: 12px; + color: light-dark(@beige, @dark-blue); + } + } + } + } + } + + .items-sidebar-list { + display: flex; + flex-direction: column; + gap: 5px; + + .inventory-item { + padding: 0 10px; + } + } + + .attack-section { + .title { + display: flex; + gap: 15px; + align-items: center; + + h3 { + font-size: 20px; + } + } + .items-list { + display: flex; + flex-direction: column; + gap: 10px; + align-items: center; + } + } + + .experience-section { + margin-bottom: 20px; + + .title { + display: flex; + gap: 15px; + align-items: center; + + h3 { + font-size: 20px; + } + } + + .experience-list { + display: flex; + flex-direction: column; + gap: 5px; + width: 100%; + margin-top: 10px; + align-items: center; + + .experience-row { + display: flex; + gap: 5px; + width: 250px; + align-items: center; + justify-content: space-between; + + .experience-name { + width: 180px; + text-align: start; + font-size: 14px; + font-family: @font-body; + color: light-dark(@dark, @beige); + } + } + + .experience-value { + height: 25px; + width: 35px; + font-size: 14px; + font-family: @font-body; + color: light-dark(@dark, @beige); + align-content: center; + text-align: center; + background: url(../assets/svg/experience-shield.svg) no-repeat; + + .theme-light & { + background: url('../assets/svg/experience-shield-light.svg') no-repeat; + } + } + } + } + + .reaction-section { + display: flex; + padding: 0 10px; + margin-top: 20px; + width: 100%; + + button { + width: 100%; + } + } + } +} diff --git a/styles/less/actors/character/sheet.less b/styles/less/actors/character/sheet.less index 6ca1ca4f..0959d146 100644 --- a/styles/less/actors/character/sheet.less +++ b/styles/less/actors/character/sheet.less @@ -24,9 +24,5 @@ grid-row: 2; grid-column: 2; } - - .old-sheet { - width: 500px; - } } } diff --git a/styles/less/actors/character/sidebar.less b/styles/less/actors/character/sidebar.less index bde3996c..e5783cbb 100644 --- a/styles/less/actors/character/sidebar.less +++ b/styles/less/actors/character/sidebar.less @@ -14,8 +14,6 @@ .portrait { position: relative; - height: 235px; - width: 275px; border-bottom: 1px solid light-dark(@dark-blue, @golden); cursor: pointer; @@ -130,6 +128,7 @@ border: 1px solid light-dark(@dark-blue, @golden); border-radius: 6px; z-index: 1; + background: @dark-blue; &::-webkit-progress-bar { border: none; @@ -144,13 +143,9 @@ background: @gradient-stress; border-radius: 6px; } - &::-moz-progress-value, - &::-moz-progress-bar { - border-radius: 6px; - } - &::-moz-progress-bar { background: @gradient-hp; + border-radius: 6px; } &.stress-color::-moz-progress-bar { background: @gradient-stress; diff --git a/styles/less/applications/adversary-settings/actions.less b/styles/less/applications/adversary-settings/actions.less new file mode 100644 index 00000000..8bce0ad7 --- /dev/null +++ b/styles/less/applications/adversary-settings/actions.less @@ -0,0 +1,62 @@ +@import '../../utils/colors.less'; +@import '../../utils/fonts.less'; + +.application.daggerheart.dh-style.dialog { + .tab.actions { + .add-action-btn { + width: 100%; + margin-bottom: 12px; + } + + .action-list { + display: flex; + flex-direction: column; + gap: 10px; + + .action-item { + display: grid; + grid-template-columns: 40px 1fr auto; + align-items: center; + gap: 5px; + + .label { + font-family: @font-body; + + .tags { + display: flex; + gap: 10px; + + .tag { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + padding: 3px 5px; + font-size: 12px; + + background: light-dark(@dark-15, @beige-15); + border: 1px solid light-dark(@dark, @beige); + border-radius: 3px; + } + + .label { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + font-size: 12px; + } + } + } + + .controls { + display: flex; + gap: 5px; + a { + text-align: center; + } + } + } + } + } +} diff --git a/styles/less/applications/adversary-settings/experiences.less b/styles/less/applications/adversary-settings/experiences.less new file mode 100644 index 00000000..36fe85cb --- /dev/null +++ b/styles/less/applications/adversary-settings/experiences.less @@ -0,0 +1,28 @@ +@import '../../utils/colors.less'; +@import '../../utils/fonts.less'; + +.application.daggerheart.dh-style.dialog { + .tab.experiences { + .add-experience-btn { + width: 100%; + margin-bottom: 12px; + } + + .experience-list { + display: flex; + flex-direction: column; + gap: 10px; + + .experience-item { + display: grid; + grid-template-columns: 3fr 1fr 30px; + align-items: center; + gap: 5px; + + a { + text-align: center; + } + } + } + } +} diff --git a/styles/less/applications/adversary-settings/sheet.less b/styles/less/applications/adversary-settings/sheet.less new file mode 100644 index 00000000..5fd80b60 --- /dev/null +++ b/styles/less/applications/adversary-settings/sheet.less @@ -0,0 +1,18 @@ +@import '../../utils/colors.less'; +@import '../../utils/fonts.less'; + +.application.daggerheart.dh-style.dialog { + .tab { + &.details.active, + &.attack.active { + display: flex; + flex-direction: column; + gap: 16px; + } + + .fieldsets-section { + display: flex; + gap: 16px; + } + } +} diff --git a/styles/less/applications/header.less b/styles/less/applications/header.less new file mode 100644 index 00000000..209037ef --- /dev/null +++ b/styles/less/applications/header.less @@ -0,0 +1,20 @@ +@import '../utils/colors.less'; +@import '../utils/fonts.less'; + +.application.daggerheart.dh-style.dialog { + .window-content { + .dialog-header { + width: 100%; + padding-bottom: 16px; + h1 { + font-family: @font-subtitle; + font-style: normal; + font-weight: 700; + font-size: 24px; + margin: 0; + text-align: center; + color: light-dark(@dark-blue, @golden); + } + } + } +} diff --git a/styles/less/global/dialog.less b/styles/less/global/dialog.less new file mode 100644 index 00000000..5db641b2 --- /dev/null +++ b/styles/less/global/dialog.less @@ -0,0 +1,45 @@ +@import '../utils/colors.less'; +@import '../utils/fonts.less'; + +.theme-light { + .application.dialog.dh-style { + background-image: url('../assets/parchments/dh-parchment-light.png'); + background-repeat: no-repeat; + background-position: center; + } +} + +.theme-dark { + .application.dialog.dh-style { + background-image: url('../assets/parchments/dh-parchment-dark.png'); + background-repeat: no-repeat; + background-position: center; + } +} + +.application.dialog.dh-style { + border: none; + + .window-header { + background: transparent; + border-bottom: none; + color: light-dark(@dark-blue, @beige); + + h1 { + color: light-dark(@dark-blue, @beige); + font-family: @font-body; + } + + button { + color: light-dark(@dark-blue, @beige); + background: light-dark(transparent, @deep-black); + border: 1px solid light-dark(@dark-blue, transparent); + padding: 0; + + &:hover { + border: 1px solid light-dark(@dark-blue, @golden); + color: light-dark(@dark-blue, @golden); + } + } + } +} diff --git a/styles/less/global/elements.less b/styles/less/global/elements.less index dbed0ca2..9caa12c6 100755 --- a/styles/less/global/elements.less +++ b/styles/less/global/elements.less @@ -1,7 +1,7 @@ @import '../utils/colors.less'; @import '../utils/fonts.less'; -.application.sheet.dh-style { +.application.dh-style { border: 1px solid light-dark(@dark-blue, @golden); input[type='text'], @@ -90,6 +90,7 @@ a:hover, a.active { + font-weight: bold; text-shadow: 0 0 8px light-dark(@dark-blue, @golden); } @@ -111,6 +112,10 @@ } } + &.fit-height { + height: 95%; + } + &.flex { display: flex; gap: 20px; @@ -160,10 +165,12 @@ .nest-inputs { display: flex; align-items: center; + width: 100%; gap: 5px; } .form-group { + width: 100%; label { font-family: @font-body; font-weight: bold; diff --git a/styles/less/global/inventory-fieldset-items.less b/styles/less/global/inventory-fieldset-items.less index 0c427bf7..1cbc9353 100644 --- a/styles/less/global/inventory-fieldset-items.less +++ b/styles/less/global/inventory-fieldset-items.less @@ -1,7 +1,7 @@ @import '../utils/colors.less'; @import '../utils/fonts.less'; -.application.sheet.daggerheart.actor.dh-style.character { +.application.daggerheart.dh-style { .items-list { display: flex; flex-direction: column; diff --git a/styles/less/global/inventory-item.less b/styles/less/global/inventory-item.less index a14bd83e..d5b854b7 100644 --- a/styles/less/global/inventory-item.less +++ b/styles/less/global/inventory-item.less @@ -1,7 +1,7 @@ @import '../utils/colors.less'; @import '../utils/fonts.less'; -.application.sheet.daggerheart.actor.dh-style.character { +.application.sheet.daggerheart.actor.dh-style { .inventory-item { display: grid; grid-template-columns: 40px 1fr 60px; diff --git a/styles/less/global/prose-mirror.less b/styles/less/global/prose-mirror.less new file mode 100644 index 00000000..33e942e8 --- /dev/null +++ b/styles/less/global/prose-mirror.less @@ -0,0 +1,24 @@ +@import '../utils/colors.less'; + +.application { + prose-mirror { + height: 100% !important; + + .editor-menu { + background-color: transparent; + } + .editor-content { + scrollbar-width: thin; + scrollbar-color: light-dark(@dark-blue, @golden) transparent; + h1 { + font-size: 36px; + } + h2 { + font-size: 32px; + } + h3 { + font-size: 24px; + } + } + } +} \ No newline at end of file diff --git a/styles/less/global/tab-navigation.less b/styles/less/global/tab-navigation.less index a13c7ea2..2880711d 100755 --- a/styles/less/global/tab-navigation.less +++ b/styles/less/global/tab-navigation.less @@ -1,10 +1,11 @@ @import '../utils/colors.less'; @import '../utils/fonts.less'; -.sheet.daggerheart.dh-style { +.daggerheart.dh-style { .tab-navigation { margin: 5px 0; height: 40px; + width: 100%; .feature-tab { border: none; diff --git a/templates/sheets/actors/adversary/actions.hbs b/templates/sheets/actors/adversary/actions.hbs new file mode 100644 index 00000000..1c7e46fb --- /dev/null +++ b/templates/sheets/actors/adversary/actions.hbs @@ -0,0 +1,11 @@ +
+
+ {{#if document.system.actions}} + {{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize tabs.actions.label) type='action'}} + {{/if}} +
+
\ No newline at end of file diff --git a/templates/sheets/actors/adversary/effects.hbs b/templates/sheets/actors/adversary/effects.hbs new file mode 100644 index 00000000..9046fff8 --- /dev/null +++ b/templates/sheets/actors/adversary/effects.hbs @@ -0,0 +1,8 @@ +
+ {{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize 'DAGGERHEART.Sheets.Global.activeEffects') type='effect'}} + {{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize 'DAGGERHEART.Sheets.Global.inativeEffects') type='effect'}} +
\ No newline at end of file diff --git a/templates/sheets/actors/adversary/header.hbs b/templates/sheets/actors/adversary/header.hbs index e3914c32..6fd131f7 100644 --- a/templates/sheets/actors/adversary/header.hbs +++ b/templates/sheets/actors/adversary/header.hbs @@ -1,9 +1,43 @@ -
- -
-

-
-

{{localize 'TYPES.Actor.adversary'}}

+
+ +
+

+ +

+
+
+
+ + {{localize (concat 'DAGGERHEART.Tiers.' source.system.tier)}} + +
+
+ + {{localize (concat 'DAGGERHEART.Adversary.Type.' source.system.type '.label')}} + +
+ {{#if (eq source.system.type 'horde')}} +
+ {{source.system.hordeHp}} + /HP +
+ {{/if}} +
+ +
+
+ {{source.system.description}} +
+
+ {{localize 'DAGGERHEART.Sheets.Adversary.FIELDS.motivesAndTactics.label'}}: {{{source.system.motivesAndTactics}}}
+ +
+ {{> 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}} + +
\ No newline at end of file diff --git a/templates/sheets/actors/adversary/main.hbs b/templates/sheets/actors/adversary/main.hbs index 541c5aca..5f172fab 100644 --- a/templates/sheets/actors/adversary/main.hbs +++ b/templates/sheets/actors/adversary/main.hbs @@ -4,33 +4,26 @@ data-group='{{tabs.main.group}}' >
-
{{localize "DAGGERHEART.Sheets.Adversary.General"}} - {{formGroup systemFields.tier value=source.system.tier localize=true}} - {{formGroup systemFields.type value=source.system.type localize=true}} +
{{formGroup systemFields.difficulty value=source.system.difficulty}}
- -
- {{localize "DAGGERHEART.Sheets.Adversary.DamageThresholds"}} - - {{formGroup systemFields.damageThresholds.fields.major value=source.system.damageThresholds.major}} - {{formGroup systemFields.damageThresholds.fields.severe value=source.system.damageThresholds.severe}} -
{{localize "DAGGERHEART.Sheets.Adversary.HitPoints"}} - +
{{localize "DAGGERHEART.Sheets.Adversary.Stress"}} - +
@@ -46,35 +39,5 @@ {{/each}}
- -
- {{localize "DAGGERHEART.Sheets.Adversary.Attack"}} - - -
- -
Name
-
-
- {{formGroup systemFields.attack.fields.name value=source.system.attack.name name="system.attack.name"}} - {{formGroup systemFields.attack.fields.img value=source.img label="Icon" name="system.attack.img"}} -
-
-
-
- -
Bonus to Hit
-
-
- {{formField systemFields.attack.fields.roll.fields.bonus value=source.system.attack.roll.bonus name="system.attack.roll.bonus"}} -
-
- {{> 'systems/daggerheart/templates/views/actionTypes/range-target.hbs' fields=(object range=systemFields.attack.fields.range target=systemFields.attack.fields.target.fields) source=(object target=source.system.attack.target range=source.system.attack.range) path="system.attack."}} -
- {{> 'systems/daggerheart/templates/views/actionTypes/damage.hbs' fields=systemFields.attack.fields.damage.fields.parts.element.fields source=source.system.attack.damage path="system.attack."}} -
- {{> 'systems/daggerheart/templates/views/actionTypes/effect.hbs' fields=systemFields.attack.fields.effects.element.fields source=source.system.attack.effects}} -
-
diff --git a/templates/sheets/actors/adversary/notes.hbs b/templates/sheets/actors/adversary/notes.hbs new file mode 100644 index 00000000..effa7240 --- /dev/null +++ b/templates/sheets/actors/adversary/notes.hbs @@ -0,0 +1,10 @@ +
+
+ {{localize tabs.notes.label}} + {{formInput systemFields.notes value=document.system.notes enriched=document.system.notes localize=true toggled=true}} +
+
\ No newline at end of file diff --git a/templates/sheets/actors/adversary/sidebar.hbs b/templates/sheets/actors/adversary/sidebar.hbs new file mode 100644 index 00000000..ce2b20be --- /dev/null +++ b/templates/sheets/actors/adversary/sidebar.hbs @@ -0,0 +1,111 @@ + \ No newline at end of file diff --git a/templates/sheets/actors/character/sidebar.hbs b/templates/sheets/actors/character/sidebar.hbs index 5a09dc3f..1f54be0e 100644 --- a/templates/sheets/actors/character/sidebar.hbs +++ b/templates/sheets/actors/character/sidebar.hbs @@ -18,7 +18,7 @@ max='{{document.system.resources.hitPoints.maxTotal}}' >
-

Health

+

HP

diff --git a/templates/sheets/applications/adversary-settings/actions.hbs b/templates/sheets/applications/adversary-settings/actions.hbs new file mode 100644 index 00000000..73594da2 --- /dev/null +++ b/templates/sheets/applications/adversary-settings/actions.hbs @@ -0,0 +1,34 @@ +
+ +
+ {{localize tabs.actions.label}} +
    + {{#each document.system.actions as |action index|}} +
  • + +
    + {{action.name}} +
    +
    + {{localize (concat 'DAGGERHEART.Actions.Types.' action.type '.name')}} +
    +
    + {{localize (concat 'DAGGERHEART.ActionType.' action.actionType)}} +
    +
    +
    +
    + + +
    +
  • + {{/each}} +
+
+
\ No newline at end of file diff --git a/templates/sheets/applications/adversary-settings/attack.hbs b/templates/sheets/applications/adversary-settings/attack.hbs new file mode 100644 index 00000000..cb11d46f --- /dev/null +++ b/templates/sheets/applications/adversary-settings/attack.hbs @@ -0,0 +1,23 @@ +
+
+ {{localize 'DAGGERHEART.General.basics'}} + {{formGroup systemFields.attack.fields.img value=document.img label="Image Path" name="system.attack.img"}} + {{formGroup systemFields.attack.fields.name value=document.system.attack.name label="Attack Name" name="system.attack.name"}} +
+
+ {{localize "DAGGERHEART.Sheets.Adversary.Attack"}} + {{formField systemFields.attack.fields.roll.fields.bonus value=document.system.attack.roll.bonus label="Attack Bonus" name="system.attack.roll.bonus"}} + {{formField systemFields.attack.fields.range value=document.system.attack.range label="Range" name=(concat path "range") localize=true}} + {{#if systemFields.attack.fields.target.fields}} + {{#if (and document.system.target.type (not (eq document.system.target.type 'self')))}} + {{ formField systemFields.attack.fields.target.fields.amount value=document.system.target.amount label="Amount" name=(concat path "target.amount") }} + {{/if}} + {{ formField systemFields.attack.fields.target.fields.type value=document.system.target.type label="Target" name=(concat path "target.type") localize=true }} + {{/if}} +
+ {{> 'systems/daggerheart/templates/views/actionTypes/damage.hbs' fields=systemFields.attack.fields.damage.fields.parts.element.fields source=document.system.attack.damage path="system.attack."}} +
\ No newline at end of file diff --git a/templates/sheets/applications/adversary-settings/details.hbs b/templates/sheets/applications/adversary-settings/details.hbs new file mode 100644 index 00000000..9c9b9cc4 --- /dev/null +++ b/templates/sheets/applications/adversary-settings/details.hbs @@ -0,0 +1,38 @@ +
+
+ {{localize 'DAGGERHEART.General.basics'}} +
+ {{formGroup systemFields.tier value=document.system.tier localize=true}} + {{formGroup systemFields.type value=document.system.type localize=true}} + {{#if (eq document.system.type 'horde')}} + {{formGroup systemFields.hordeHp value=document.system.hordeHp label=(localize "DAGGERHEART.Sheets.Adversary.horderHp")}} + {{/if}} + {{formGroup systemFields.difficulty value=document.system.difficulty localize=true}} +
+ {{formField systemFields.description value=document.system.description label=(localize "DAGGERHEART.Sheets.Adversary.FIELDS.description.label")}} + {{formField systemFields.motivesAndTactics value=document.system.motivesAndTactics label=(localize "DAGGERHEART.Sheets.Adversary.FIELDS.motivesAndTactics.label")}} +
+ +
+
+ {{localize "DAGGERHEART.Sheets.Adversary.HitPoints"}} + {{formGroup systemFields.resources.fields.hitPoints.fields.value value=document.system.resources.hitPoints.value}} + {{formGroup systemFields.resources.fields.hitPoints.fields.max value=document.system.resources.hitPoints.max}} +
+
+ {{localize "DAGGERHEART.Sheets.Adversary.Stress"}} + {{formGroup systemFields.resources.fields.stress.fields.value value=document.system.resources.stress.value}} + {{formGroup systemFields.resources.fields.stress.fields.max value=document.system.resources.stress.max}} +
+
+ +
+ {{localize "DAGGERHEART.Sheets.Adversary.DamageThresholds"}} + {{formGroup systemFields.damageThresholds.fields.major value=document.system.damageThresholds.major}} + {{formGroup systemFields.damageThresholds.fields.severe value=document.system.damageThresholds.severe}} +
+
\ No newline at end of file diff --git a/templates/sheets/applications/adversary-settings/experiences.hbs b/templates/sheets/applications/adversary-settings/experiences.hbs new file mode 100644 index 00000000..5e4a483c --- /dev/null +++ b/templates/sheets/applications/adversary-settings/experiences.hbs @@ -0,0 +1,23 @@ +
+ + +
+ {{localize tabs.experiences.label}} +
    + {{#each document.system.experiences as |experience key|}} +
  • + + + +
  • + {{/each}} +
+
+ +
\ No newline at end of file diff --git a/templates/sheets/applications/adversary-settings/header.hbs b/templates/sheets/applications/adversary-settings/header.hbs new file mode 100644 index 00000000..0978f2c3 --- /dev/null +++ b/templates/sheets/applications/adversary-settings/header.hbs @@ -0,0 +1,3 @@ +
+

{{document.name}}

+
\ No newline at end of file diff --git a/templates/sheets/global/partials/inventory-fieldset-items.hbs b/templates/sheets/global/partials/inventory-fieldset-items.hbs index f9ae04e5..81ff5094 100644 --- a/templates/sheets/global/partials/inventory-fieldset-items.hbs +++ b/templates/sheets/global/partials/inventory-fieldset-items.hbs @@ -34,6 +34,11 @@ {{> 'systems/daggerheart/templates/sheets/global/partials/inventory-item.hbs' item=effect type=../type}} {{/if}} {{/each}} + {{#each document.system.actions as |action|}} + {{#if (or (eq ../type 'action'))}} + {{> 'systems/daggerheart/templates/sheets/global/partials/inventory-item.hbs' item=action type=../type}} + {{/if}} + {{/each}} {{#each document.system.features as |feature|}} {{#if (or (eq ../type 'features'))}} {{> 'systems/daggerheart/templates/sheets/global/partials/inventory-item.hbs' item=feature}} diff --git a/templates/sheets/global/partials/inventory-item.hbs b/templates/sheets/global/partials/inventory-item.hbs index c45ae146..a27bc3ce 100644 --- a/templates/sheets/global/partials/inventory-item.hbs +++ b/templates/sheets/global/partials/inventory-item.hbs @@ -100,6 +100,16 @@ {{/each}}
{{/if}} + {{#if (eq type 'action')}} +
+
+ {{localize (concat 'DAGGERHEART.Actions.Types.' item.type '.name')}} +
+
+ {{localize (concat 'DAGGERHEART.ActionType.' item.actionType)}} +
+
+ {{/if}}
{{#if (eq type 'weapon')}} From d58f30390792cf68ff9abe5a41d79ba38e187049 Mon Sep 17 00:00:00 2001 From: Murilo Brito <91566541+moliloo@users.noreply.github.com> Date: Tue, 1 Jul 2025 18:21:46 -0300 Subject: [PATCH 2/6] fix duplicated adversary sheet reference (#239) --- module/applications/_module.mjs | 1 - 1 file changed, 1 deletion(-) diff --git a/module/applications/_module.mjs b/module/applications/_module.mjs index 09f63742..df22d6b2 100644 --- a/module/applications/_module.mjs +++ b/module/applications/_module.mjs @@ -1,6 +1,5 @@ export { default as DhCharacterSheet } from './sheets/actors/character.mjs'; export { default as DhpAdversarySheet } from './sheets/actors/adversary.mjs'; -export { default as DhpAdversarySheet } from './sheets/actors/adversary.mjs'; export { default as DhCompanionSheet } from './sheets/companion.mjs'; export { default as DhpClassSheet } from './sheets/items/class.mjs'; export { default as DhpSubclass } from './sheets/items/subclass.mjs'; From 3a6a973ea2ee7fc5ad02a6a687b98d7c16c12ff6 Mon Sep 17 00:00:00 2001 From: Murilo Brito <91566541+moliloo@users.noreply.github.com> Date: Wed, 2 Jul 2025 09:30:36 -0300 Subject: [PATCH 3/6] [Feature] New Environment Sheet (#243) * rework new environment template sheet, add environment-settings sheet, improve adversary-settings sheet and delete legacy actor sheet templates * Potential Adversaries can be dragged out of the sheet onto canvas * Added ToChat and UseItem --------- Co-authored-by: WBHarry --- lang/en.json | 19 +- module/applications/_module.mjs | 2 +- .../sheets/actors/environment.mjs | 131 +++++++ .../applications/adversary-settings.mjs | 1 - .../applications/environment-settings.mjs | 213 +++++++++++ .../applications/sheets/daggerheart-sheet.mjs | 3 +- module/applications/sheets/environment.mjs | 107 ------ module/config/actorConfig.mjs | 16 +- module/data/actor/environment.mjs | 12 +- styles/daggerheart.css | 350 ++++++++++++++---- styles/daggerheart.less | 7 + styles/less/actors/adversary/header.less | 72 ---- styles/less/actors/environment/header.less | 140 +++++++ styles/less/actors/environment/sheet.less | 18 + .../adversary-settings/actions.less | 12 + .../environment-settings/actions.less | 74 ++++ .../environment-settings/adversaries.less | 50 +++ styles/less/global/inventory-item.less | 6 +- styles/less/global/tab-actions.less | 7 + .../sheets/actors/adversary/information.hbs | 17 - templates/sheets/actors/adversary/main.hbs | 43 --- .../sheets/actors/environment/actions.hbs | 9 + .../sheets/actors/environment/header.hbs | 50 ++- .../sheets/actors/environment/information.hbs | 16 - templates/sheets/actors/environment/main.hbs | 37 -- templates/sheets/actors/environment/notes.hbs | 10 + .../environment/potentialAdversaries.hbs | 11 + templates/sheets/adversary.hbs | 238 ------------ .../environment-settings/actions.hbs | 34 ++ .../environment-settings/adversaries.hbs | 28 ++ .../environment-settings/details.hbs | 16 + .../environment-settings/header.hbs | 3 + templates/sheets/character/character.hbs | 151 -------- .../character/parts/advancementCard.hbs | 27 -- .../sheets/character/parts/heritageCard.hbs | 18 - .../sheets/character/sections/inventory.hbs | 35 -- .../sheets/character/sections/loadout.hbs | 137 ------- templates/sheets/environment.hbs | 111 ------ .../partials/inventory-fieldset-items.hbs | 3 + .../sheets/global/partials/inventory-item.hbs | 69 ++-- 40 files changed, 1160 insertions(+), 1143 deletions(-) create mode 100644 module/applications/sheets/actors/environment.mjs create mode 100644 module/applications/sheets/applications/environment-settings.mjs delete mode 100644 module/applications/sheets/environment.mjs create mode 100644 styles/less/actors/environment/header.less create mode 100644 styles/less/actors/environment/sheet.less create mode 100644 styles/less/applications/environment-settings/actions.less create mode 100644 styles/less/applications/environment-settings/adversaries.less delete mode 100644 templates/sheets/actors/adversary/information.hbs delete mode 100644 templates/sheets/actors/adversary/main.hbs create mode 100644 templates/sheets/actors/environment/actions.hbs delete mode 100644 templates/sheets/actors/environment/information.hbs delete mode 100644 templates/sheets/actors/environment/main.hbs create mode 100644 templates/sheets/actors/environment/notes.hbs create mode 100644 templates/sheets/actors/environment/potentialAdversaries.hbs delete mode 100644 templates/sheets/adversary.hbs create mode 100644 templates/sheets/applications/environment-settings/actions.hbs create mode 100644 templates/sheets/applications/environment-settings/adversaries.hbs create mode 100644 templates/sheets/applications/environment-settings/details.hbs create mode 100644 templates/sheets/applications/environment-settings/header.hbs delete mode 100644 templates/sheets/character/character.hbs delete mode 100644 templates/sheets/character/parts/advancementCard.hbs delete mode 100644 templates/sheets/character/parts/heritageCard.hbs delete mode 100644 templates/sheets/character/sections/inventory.hbs delete mode 100644 templates/sheets/character/sections/loadout.hbs delete mode 100644 templates/sheets/environment.hbs diff --git a/lang/en.json b/lang/en.json index 8c3897c5..4458d9ac 100755 --- a/lang/en.json +++ b/lang/en.json @@ -229,7 +229,9 @@ "attack": "Attack", "experiences": "Experiences", "features": "Features", - "actions": "Actions" + "actions": "Actions", + "potentialAdversaries": "Potential Adversaries", + "adversaries": "Adversaries" }, "basics": "Basics" }, @@ -381,19 +383,19 @@ }, "Environment": { "Type": { - "Exploration": { + "exploration": { "label": "Exploration", "description": "" }, - "Social": { + "social": { "label": "Social", "description": "" }, - "Traversal": { + "traversal": { "label": "Traversal", "description": "" }, - "Event": { + "event": { "label": "Event", "description": "" } @@ -1364,6 +1366,12 @@ }, "difficulty": { "label": "Difficulty" + }, + "impulses": { + "label": "Impulses" + }, + "description": { + "label": "Description" } }, "Tabs": { @@ -1577,6 +1585,7 @@ }, "Tooltip": { "openItemWorld": "Open Item World", + "openActorWorld": "Open Actor World", "sendToChat": "Send to Chat", "moreOptions": "More Options", "equip": "Equip", diff --git a/module/applications/_module.mjs b/module/applications/_module.mjs index df22d6b2..a74cb8cf 100644 --- a/module/applications/_module.mjs +++ b/module/applications/_module.mjs @@ -12,7 +12,7 @@ export { default as DhpConsumable } from './sheets/items/consumable.mjs'; export { default as DhpWeapon } from './sheets/items/weapon.mjs'; export { default as DhpArmor } from './sheets/items/armor.mjs'; export { default as DhpChatMessage } from './chatMessage.mjs'; -export { default as DhpEnvironment } from './sheets/environment.mjs'; +export { default as DhpEnvironment } from './sheets/actors/environment.mjs'; export { default as DhActiveEffectConfig } from './sheets/activeEffectConfig.mjs'; export { default as DhContextMenu } from './contextMenu.mjs'; diff --git a/module/applications/sheets/actors/environment.mjs b/module/applications/sheets/actors/environment.mjs new file mode 100644 index 00000000..1440bb4e --- /dev/null +++ b/module/applications/sheets/actors/environment.mjs @@ -0,0 +1,131 @@ +import DaggerheartSheet from '../daggerheart-sheet.mjs'; +import DHEnvironmentSettings from '../applications/environment-settings.mjs'; + +const { ActorSheetV2 } = foundry.applications.sheets; +export default class DhpEnvironment extends DaggerheartSheet(ActorSheetV2) { + static DEFAULT_OPTIONS = { + tag: 'form', + classes: ['daggerheart', 'sheet', 'actor', 'dh-style', 'environment'], + position: { + width: 500 + }, + actions: { + addAdversary: this.addAdversary, + deleteProperty: this.deleteProperty, + viewAdversary: this.viewAdversary, + openSettings: this.openSettings, + useItem: this.useItem, + toChat: this.toChat + }, + form: { + handler: this._updateForm, + submitOnChange: true, + closeOnSubmit: false + }, + dragDrop: [{ dragSelector: '.action-section .inventory-item', dropSelector: null }] + }; + + static PARTS = { + header: { template: 'systems/daggerheart/templates/sheets/actors/environment/header.hbs' }, + actions: { template: 'systems/daggerheart/templates/sheets/actors/environment/actions.hbs' }, + potentialAdversaries: { + template: 'systems/daggerheart/templates/sheets/actors/environment/potentialAdversaries.hbs' + }, + notes: { template: 'systems/daggerheart/templates/sheets/actors/environment/notes.hbs' } + }; + + static TABS = { + actions: { + active: true, + cssClass: '', + group: 'primary', + id: 'actions', + icon: null, + label: 'DAGGERHEART.General.tabs.actions' + }, + potentialAdversaries: { + active: false, + cssClass: '', + group: 'primary', + id: 'potentialAdversaries', + icon: null, + label: 'DAGGERHEART.General.tabs.potentialAdversaries' + }, + notes: { + active: false, + cssClass: '', + group: 'primary', + id: 'notes', + icon: null, + label: 'DAGGERHEART.Sheets.Adversary.Tabs.notes' + } + }; + + async _prepareContext(_options) { + const context = await super._prepareContext(_options); + context.document = this.document; + context.tabs = super._getTabs(this.constructor.TABS); + context.getEffectDetails = this.getEffectDetails.bind(this); + + return context; + } + + getAction(element) { + const itemId = (element.target ?? element).closest('[data-item-id]').dataset.itemId, + item = this.document.system.actions.find(x => x.id === itemId); + return item; + } + + static async openSettings() { + await new DHEnvironmentSettings(this.document).render(true); + } + + static async _updateForm(event, _, formData) { + await this.document.update(formData.object); + this.render(); + } + + getEffectDetails(id) { + return {}; + } + + static async addAdversary() { + await this.document.update({ + [`system.potentialAdversaries.${foundry.utils.randomID()}.label`]: game.i18n.localize( + 'DAGGERHEART.Sheets.Environment.newAdversary' + ) + }); + this.render(); + } + + static async deleteProperty(_, target) { + await this.document.update({ [`${target.dataset.path}.-=${target.id}`]: null }); + this.render(); + } + + static async viewAdversary(_, button) { + const adversary = await foundry.utils.fromUuid(button.dataset.adversary); + adversary.sheet.render(true); + } + + static async useItem(event) { + const action = this.getAction(event); + action.use(event); + } + + static async toChat(event) { + const item = this.getAction(event); + item.toChat(this.document.id); + } + + async _onDragStart(event) { + const item = event.currentTarget.closest('.inventory-item'); + + if (item) { + const adversary = game.actors.find(x => x.type === 'adversary' && x.id === item.dataset.itemId); + const adversaryData = { type: 'Actor', uuid: adversary.uuid }; + event.dataTransfer.setData('text/plain', JSON.stringify(adversaryData)); + event.dataTransfer.setDragImage(item, 60, 0); + } + } +} diff --git a/module/applications/sheets/applications/adversary-settings.mjs b/module/applications/sheets/applications/adversary-settings.mjs index 4c7ae8ec..2ecdcb60 100644 --- a/module/applications/sheets/applications/adversary-settings.mjs +++ b/module/applications/sheets/applications/adversary-settings.mjs @@ -146,7 +146,6 @@ export default class DHAdversarySettings extends HandlebarsApplicationMixin(Appl parent: this.actor } ); - console.log(action); await this.actor.update({ 'system.actions': [...this.actor.system.actions, action] }); await new DHActionConfig(this.actor.system.actions[this.actor.system.actions.length - 1]).render({ force: true diff --git a/module/applications/sheets/applications/environment-settings.mjs b/module/applications/sheets/applications/environment-settings.mjs new file mode 100644 index 00000000..1f3c33c8 --- /dev/null +++ b/module/applications/sheets/applications/environment-settings.mjs @@ -0,0 +1,213 @@ +import DHActionConfig from '../../config/Action.mjs'; +import DHBaseItemSheet from '../api/base-item.mjs'; +import { actionsTypes } from '../../../data/_module.mjs'; + +const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api; + +export default class DHEnvironmentSettings extends HandlebarsApplicationMixin(ApplicationV2) { + constructor(actor) { + super({}); + + this.actor = actor; + this._dragDrop = this._createDragDropHandlers(); + } + + get title() { + return `${game.i18n.localize('DAGGERHEART.Sheets.TABS.settings')}`; + } + + static DEFAULT_OPTIONS = { + tag: 'form', + classes: ['daggerheart', 'dh-style', 'dialog', 'environment-settings'], + window: { + icon: 'fa-solid fa-wrench', + resizable: false + }, + position: { width: 455, height: 'auto' }, + actions: { + addAction: this.#addAction, + editAction: this.#editAction, + removeAction: this.#removeAction, + addCategory: this.#addCategory, + deleteProperty: this.#deleteProperty, + viewAdversary: this.#viewAdversary, + deleteAdversary: this.#deleteAdversary + }, + form: { + handler: this.updateForm, + submitOnChange: true, + closeOnSubmit: false + }, + dragDrop: [{ dragSelector: null, dropSelector: '.category-container' }] + }; + + static PARTS = { + header: { + id: 'header', + template: 'systems/daggerheart/templates/sheets/applications/environment-settings/header.hbs' + }, + tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' }, + details: { + id: 'details', + template: 'systems/daggerheart/templates/sheets/applications/environment-settings/details.hbs' + }, + actions: { + id: 'actions', + template: 'systems/daggerheart/templates/sheets/applications/environment-settings/actions.hbs' + }, + adversaries: { + id: 'adversaries', + template: 'systems/daggerheart/templates/sheets/applications/environment-settings/adversaries.hbs' + } + }; + + static TABS = { + details: { + active: true, + cssClass: '', + group: 'primary', + id: 'details', + icon: null, + label: 'DAGGERHEART.General.tabs.details' + }, + actions: { + active: false, + cssClass: '', + group: 'primary', + id: 'actions', + icon: null, + label: 'DAGGERHEART.General.tabs.actions' + }, + adversaries: { + active: false, + cssClass: '', + group: 'primary', + id: 'adversaries', + icon: null, + label: 'DAGGERHEART.General.tabs.adversaries' + } + }; + + async _prepareContext(_options) { + const context = await super._prepareContext(_options); + context.document = this.actor; + context.tabs = this._getTabs(this.constructor.TABS); + context.systemFields = this.actor.system.schema.fields; + context.isNPC = true; + + return context; + } + + _attachPartListeners(partId, htmlElement, options) { + super._attachPartListeners(partId, htmlElement, options); + + this._dragDrop.forEach(d => d.bind(htmlElement)); + } + + _createDragDropHandlers() { + return this.options.dragDrop.map(d => { + d.callbacks = { + drop: this._onDrop.bind(this) + }; + return new foundry.applications.ux.DragDrop.implementation(d); + }); + } + + _getTabs(tabs) { + 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' : ''; + } + + return tabs; + } + + static async #addAction(_event, _button) { + const actionType = await DHBaseItemSheet.selectActionType(); + if (!actionType) return; + try { + const cls = actionsTypes[actionType] ?? actionsTypes.attack, + action = new cls( + { + _id: foundry.utils.randomID(), + type: actionType, + name: game.i18n.localize(SYSTEM.ACTIONS.actionTypes[actionType].name), + ...cls.getSourceConfig(this.actor) + }, + { + parent: this.actor + } + ); + await this.actor.update({ 'system.actions': [...this.actor.system.actions, action] }); + await new DHActionConfig(this.actor.system.actions[this.actor.system.actions.length - 1]).render({ + force: true + }); + this.render(); + } catch (error) { + console.log(error); + } + } + + static async #editAction(event, target) { + event.stopPropagation(); + const actionIndex = target.dataset.index; + await new DHActionConfig(this.actor.system.actions[actionIndex]).render({ + force: true + }); + } + + static async #removeAction(event, target) { + event.stopPropagation(); + const actionIndex = target.dataset.index; + await this.actor.update({ + 'system.actions': this.actor.system.actions.filter((_, index) => index !== Number.parseInt(actionIndex)) + }); + this.render(); + } + + static async #addCategory() { + await this.actor.update({ + [`system.potentialAdversaries.${foundry.utils.randomID()}.label`]: game.i18n.localize( + 'DAGGERHEART.Sheets.Environment.newAdversary' + ) + }); + this.render(); + } + + static async #deleteProperty(_, target) { + await this.actor.update({ [`${target.dataset.path}.-=${target.id}`]: null }); + this.render(); + } + + static async #viewAdversary(_, button) { + const adversary = await foundry.utils.fromUuid(button.dataset.adversary); + adversary.sheet.render(true); + } + + static async #deleteAdversary(event, target) { + const adversaryKey = target.dataset.adversary; + const path = `system.potentialAdversaries.${target.dataset.potentialAdversary}.adversaries`; + const newAdversaries = foundry.utils.getProperty(this.actor, path).filter(x => x.uuid !== adversaryKey); + await this.actor.update({ [path]: newAdversaries }); + this.render(); + } + + async _onDrop(event) { + const data = TextEditor.getDragEventData(event); + const item = await fromUuid(data.uuid); + if (item.type === 'adversary') { + const target = event.target.closest('.category-container'); + const path = `system.potentialAdversaries.${target.dataset.potentialAdversary}.adversaries`; + const current = foundry.utils.getProperty(this.actor, path).map(x => x.uuid); + await this.actor.update({ + [path]: [...current, item.uuid] + }); + this.render(); + } + } + + static async updateForm(event, _, formData) { + await this.actor.update(formData.object); + this.render(); + } +} diff --git a/module/applications/sheets/daggerheart-sheet.mjs b/module/applications/sheets/daggerheart-sheet.mjs index 821972d9..aed1dccc 100644 --- a/module/applications/sheets/daggerheart-sheet.mjs +++ b/module/applications/sheets/daggerheart-sheet.mjs @@ -60,7 +60,7 @@ export default function DhpApplicationMixin(Base) { // drop: this._canDragDrop.bind(this) // }; d.callbacks = { - // dragstart: this._onDragStart.bind(this), + dragstart: this._onDragStart.bind(this), // dragover: this._onDragOver.bind(this), drop: this._onDrop.bind(this) }; @@ -68,6 +68,7 @@ export default function DhpApplicationMixin(Base) { }); } + async _onDragStart(event) {} _onDrop(event) {} _getTabs(tabs) { diff --git a/module/applications/sheets/environment.mjs b/module/applications/sheets/environment.mjs deleted file mode 100644 index fca33f4d..00000000 --- a/module/applications/sheets/environment.mjs +++ /dev/null @@ -1,107 +0,0 @@ -import DaggerheartSheet from './daggerheart-sheet.mjs'; - -const { ActorSheetV2 } = foundry.applications.sheets; -export default class DhpEnvironment extends DaggerheartSheet(ActorSheetV2) { - static DEFAULT_OPTIONS = { - tag: 'form', - classes: ['daggerheart', 'sheet', 'actor', 'dh-style', 'environment'], - position: { - width: 450, - height: 1000 - }, - actions: { - addAdversary: this.addAdversary, - addFeature: this.addFeature, - deleteProperty: this.deleteProperty, - viewAdversary: this.viewAdversary - }, - form: { - handler: this._updateForm, - submitOnChange: true, - closeOnSubmit: false - }, - dragDrop: [{ dragSelector: null, dropSelector: '.adversary-container' }] - }; - - static PARTS = { - header: { template: 'systems/daggerheart/templates/sheets/actors/environment/header.hbs' }, - tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' }, - main: { template: 'systems/daggerheart/templates/sheets/actors/environment/main.hbs' }, - information: { template: 'systems/daggerheart/templates/sheets/actors/environment/information.hbs' } - }; - - static TABS = { - main: { - active: true, - cssClass: '', - group: 'primary', - id: 'main', - icon: null, - label: 'DAGGERHEART.Sheets.Environment.Tabs.Main' - }, - information: { - active: false, - cssClass: '', - group: 'primary', - id: 'information', - icon: null, - label: 'DAGGERHEART.Sheets.Environment.Tabs.Information' - } - }; - - async _prepareContext(_options) { - const context = await super._prepareContext(_options); - context.document = this.document; - context.tabs = super._getTabs(this.constructor.TABS); - context.getEffectDetails = this.getEffectDetails.bind(this); - - return context; - } - - static async _updateForm(event, _, formData) { - await this.document.update(formData.object); - this.render(); - } - - getEffectDetails(id) { - return {}; - } - - static async addAdversary() { - await this.document.update({ - [`system.potentialAdversaries.${foundry.utils.randomID()}.label`]: game.i18n.localize( - 'DAGGERHEART.Sheets.Environment.newAdversary' - ) - }); - this.render(); - } - - static async addFeature() { - ui.notifications.error('Not Implemented yet. Awaiting datamodel rework'); - } - - static async deleteProperty(_, target) { - await this.document.update({ [`${target.dataset.path}.-=${target.id}`]: null }); - this.render(); - } - - static async viewAdversary(_, button) { - const adversary = foundry.utils.getProperty( - this.document.system.potentialAdversaries, - `${button.dataset.potentialAdversary}.adversaries.${button.dataset.adversary}` - ); - adversary.sheet.render(true); - } - - async _onDrop(event) { - const data = TextEditor.getDragEventData(event); - const item = await fromUuid(data.uuid); - if (item.type === 'adversary') { - const target = event.target.closest('.adversary-container'); - const path = `system.potentialAdversaries.${target.dataset.potentialAdversary}.adversaries.${item.id}`; - await this.document.update({ - [path]: item.uuid - }); - } - } -} diff --git a/module/config/actorConfig.mjs b/module/config/actorConfig.mjs index b3ebf9dc..5b5169ad 100644 --- a/module/config/actorConfig.mjs +++ b/module/config/actorConfig.mjs @@ -135,20 +135,20 @@ export const adversaryTypes = { export const environmentTypes = { exploration: { - label: 'DAGGERHEART.Environment.Type.Exploration.label', - description: 'DAGGERHEART.Environment.Type.Exploration.description' + label: 'DAGGERHEART.Environment.Type.exploration.label', + description: 'DAGGERHEART.Environment.Type.exploration.description' }, social: { - label: 'DAGGERHEART.Environment.Type.Social.label', - description: 'DAGGERHEART.Environment.Type.Social.description' + label: 'DAGGERHEART.Environment.Type.social.label', + description: 'DAGGERHEART.Environment.Type.social.description' }, traversal: { - label: 'DAGGERHEART.Environment.Type.Traversal.label', - description: 'DAGGERHEART.Environment.Type.Traversal.description' + label: 'DAGGERHEART.Environment.Type.traversal.label', + description: 'DAGGERHEART.Environment.Type.traversal.description' }, event: { - label: 'DAGGERHEART.Environment.Type.Event.label', - description: 'DAGGERHEART.Environment.Type.Event.description' + label: 'DAGGERHEART.Environment.Type.event.label', + description: 'DAGGERHEART.Environment.Type.event.description' } }; diff --git a/module/data/actor/environment.mjs b/module/data/actor/environment.mjs index 3209dfdc..4b7e0716 100644 --- a/module/data/actor/environment.mjs +++ b/module/data/actor/environment.mjs @@ -1,6 +1,8 @@ import { environmentTypes } from '../../config/actorConfig.mjs'; import BaseDataActor from './base.mjs'; import ForeignDocumentUUIDField from '../fields/foreignDocumentUUIDField.mjs'; +import ActionField from '../fields/actionField.mjs'; +import ForeignDocumentUUIDArrayField from '../fields/foreignDocumentUUIDArrayField.mjs'; export default class DhEnvironment extends BaseDataActor { static LOCALIZATION_PREFIXES = ['DAGGERHEART.Sheets.Environment']; @@ -21,15 +23,17 @@ export default class DhEnvironment extends BaseDataActor { initial: SYSTEM.GENERAL.tiers.tier1.id }), type: new fields.StringField({ choices: environmentTypes }), - impulses: new fields.HTMLField(), + description: new fields.StringField(), + impulses: new fields.StringField(), difficulty: new fields.NumberField({ required: true, initial: 11, integer: true }), potentialAdversaries: new fields.TypedObjectField( new fields.SchemaField({ label: new fields.StringField(), - adversaries: new fields.TypedObjectField(new ForeignDocumentUUIDField({ type: 'Actor' })) + adversaries: new ForeignDocumentUUIDArrayField({ type: 'Actor' }) }) - ) - /* Features pending datamodel rework */ + ), + actions: new fields.ArrayField(new ActionField()), + notes: new fields.HTMLField() }; } } diff --git a/styles/daggerheart.css b/styles/daggerheart.css index b649213a..062dd5a3 100755 --- a/styles/daggerheart.css +++ b/styles/daggerheart.css @@ -4318,39 +4318,6 @@ div.daggerheart.views.multiclass { .application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet .name-row input[type='text']:hover { outline: 2px solid light-dark(#222, #f3c267); } -.application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet .name-row .level-div { - white-space: nowrap; - display: flex; - justify-content: end; -} -.application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet .name-row .level-div .label { - display: flex; - align-items: center; - gap: 4px; -} -.application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet .name-row .level-div input { - width: 40px; - padding: 0; - text-align: center; -} -.application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet .name-row .level-div .level-button { - color: light-dark(#222, #efe6d8); - font-size: 18px; - line-height: 1; - min-height: unset; - height: min-content; - padding: 4px; - font-family: 'Cinzel', serif; - margin: 0; - font-weight: normal; - border-color: light-dark(#18162e, #f3c267); - background-color: light-dark(transparent, #0e0d15); -} -.application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet .name-row .level-div .level-button:hover { - background-image: none; - background-color: var(--color-warm-2); - filter: drop-shadow(0 0 3px lightgray); -} .application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet .tags { display: flex; gap: 10px; @@ -4390,35 +4357,6 @@ div.daggerheart.views.multiclass { gap: 8px; align-items: center; } -.application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet .character-details { - display: flex; - justify-content: space-between; - padding: 5px 0; - margin-bottom: 10px; - font-size: 12px; - color: light-dark(#18162e, #f3c267); -} -.application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet .character-details span { - padding: 3px; - border-radius: 3px; - transition: all 0.3s ease; - cursor: pointer; -} -.application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet .character-details span:hover { - background: light-dark(#18162e40, #f3c26740); -} -.application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet .character-details span.dot { - background: transparent; - cursor: default; -} -.application.sheet.daggerheart.actor.dh-style.adversary .adversary-header-sheet .character-row { - display: flex; - gap: 20px; - align-items: center; - justify-content: space-between; - padding: 0; - margin-bottom: 15px; -} .application.sheet.daggerheart.actor.dh-style.adversary .window-content { display: grid; grid-template-columns: 275px 1fr; @@ -4731,6 +4669,134 @@ div.daggerheart.views.multiclass { .application.sheet.daggerheart.actor.dh-style.adversary .adversary-sidebar-sheet .reaction-section button { width: 100%; } +.application.sheet.daggerheart.actor.dh-style.environment .environment-header-sheet { + display: flex; + flex-direction: column; + justify-content: start; + text-align: center; +} +.application.sheet.daggerheart.actor.dh-style.environment .environment-header-sheet .profile { + width: 100%; + height: 235px; + object-fit: cover; + mask-image: linear-gradient(0deg, transparent 0%, black 10%); + cursor: pointer; +} +.application.sheet.daggerheart.actor.dh-style.environment .environment-header-sheet .item-container { + display: flex; + align-items: center; + position: relative; + top: -45px; + gap: 20px; + padding: 0 20px; + margin-bottom: -30px; +} +.application.sheet.daggerheart.actor.dh-style.environment .environment-header-sheet .item-container .item-info { + display: flex; + flex-direction: column; + gap: 8px; +} +.application.sheet.daggerheart.actor.dh-style.environment .environment-header-sheet .item-container .item-info .tags { + display: flex; + gap: 10px; + padding-bottom: 0; +} +.application.sheet.daggerheart.actor.dh-style.environment .environment-header-sheet .item-container .item-info .tags .tag { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + padding: 3px 5px; + font-size: 12px; + font: 'Montserrat', sans-serif; + background: light-dark(#22222215, #efe6d815); + border: 1px solid light-dark(#222, #efe6d8); + border-radius: 3px; +} +.application.sheet.daggerheart.actor.dh-style.environment .environment-header-sheet .item-container .item-info .tags .label { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + font-size: 12px; +} +.application.sheet.daggerheart.actor.dh-style.environment .environment-header-sheet .item-container .status-number { + justify-items: center; +} +.application.sheet.daggerheart.actor.dh-style.environment .environment-header-sheet .item-container .status-number .status-value { + position: relative; + display: flex; + width: 50px; + height: 30px; + border: 1px solid light-dark(#18162e, #f3c267); + border-bottom: none; + border-radius: 6px 6px 0 0; + padding: 0 6px; + font-size: 1.2rem; + align-items: center; + justify-content: center; + background: light-dark(transparent, #18162e); + z-index: 2; +} +.application.sheet.daggerheart.actor.dh-style.environment .environment-header-sheet .item-container .status-number .status-value.armor-slots { + width: 80px; + height: 30px; +} +.application.sheet.daggerheart.actor.dh-style.environment .environment-header-sheet .item-container .status-number .status-label { + padding: 2px 10px; + width: 100%; + border-radius: 3px; + background: light-dark(#18162e, #f3c267); +} +.application.sheet.daggerheart.actor.dh-style.environment .environment-header-sheet .item-container .status-number .status-label h4 { + font-weight: bold; + text-align: center; + line-height: 18px; + font-size: 12px; + color: light-dark(#efe6d8, #18162e); +} +.application.sheet.daggerheart.actor.dh-style.environment .environment-header-sheet .item-container .item-name input[type='text'] { + font-size: 32px; + height: 42px; + text-align: start; + transition: all 0.3s ease; + outline: 2px solid transparent; + border: 1px solid transparent; +} +.application.sheet.daggerheart.actor.dh-style.environment .environment-header-sheet .item-container .item-name input[type='text']:hover[type='text'], +.application.sheet.daggerheart.actor.dh-style.environment .environment-header-sheet .item-container .item-name input[type='text']:focus[type='text'] { + box-shadow: none; + outline: 2px solid light-dark(#18162e, #f3c267); +} +.application.sheet.daggerheart.actor.dh-style.environment .environment-header-sheet .environment-info { + display: flex; + flex-direction: column; + gap: 12px; + padding: 10px 20px; +} +.application.sheet.daggerheart.actor.dh-style.environment .environment-header-sheet .environment-info .description, +.application.sheet.daggerheart.actor.dh-style.environment .environment-header-sheet .environment-info .impulses { + text-align: start; + font-family: 'Montserrat', sans-serif; +} +.application.sheet.daggerheart.actor.dh-style.environment .environment-header-sheet .environment-navigation { + display: flex; + gap: 20px; + align-items: center; + padding: 0 20px; +} +.theme-light .application.sheet.daggerheart.actor.dh-style.environment { + background: url('../assets/parchments/dh-parchment-light.png'); +} +.theme-dark .application.sheet.daggerheart.actor.dh-style.environment { + background-image: url('../assets/parchments/dh-parchment-dark.png'); +} +.application.sheet.daggerheart.actor.dh-style.environment .tab { + max-height: 300px; + overflow-y: auto; + scrollbar-width: thin; + scrollbar-color: light-dark(#18162e, #f3c267) transparent; +} .application.daggerheart.dh-style.dialog .window-content .dialog-header { width: 100%; padding-bottom: 16px; @@ -4772,6 +4838,12 @@ div.daggerheart.views.multiclass { .application.daggerheart.dh-style.dialog .tab.experiences .experience-list .experience-item a { text-align: center; } +.application.daggerheart.dh-style.dialog .tab.actions { + max-height: 450px; + overflow-y: auto; + scrollbar-width: thin; + scrollbar-color: light-dark(#18162e, #f3c267) transparent; +} .application.daggerheart.dh-style.dialog .tab.actions .add-action-btn { width: 100%; margin-bottom: 12px; @@ -4786,6 +4858,12 @@ div.daggerheart.views.multiclass { grid-template-columns: 40px 1fr auto; align-items: center; gap: 5px; + border-radius: 3px; +} +.application.daggerheart.dh-style.dialog .tab.actions .action-list .action-item img { + height: 40px; + width: 40px; + object-fit: cover; } .application.daggerheart.dh-style.dialog .tab.actions .action-list .action-item .label { font-family: 'Montserrat', sans-serif; @@ -4819,6 +4897,105 @@ div.daggerheart.views.multiclass { .application.daggerheart.dh-style.dialog .tab.actions .action-list .action-item .controls a { text-align: center; } +.application.daggerheart.dh-style.dialog.environment-settings .tab.actions { + max-height: 450px; + overflow-y: auto; + scrollbar-width: thin; + scrollbar-color: light-dark(#18162e, #f3c267) transparent; +} +.application.daggerheart.dh-style.dialog.environment-settings .tab.actions .add-action-btn { + width: 100%; + margin-bottom: 12px; +} +.application.daggerheart.dh-style.dialog.environment-settings .tab.actions .action-list { + display: flex; + flex-direction: column; + gap: 10px; +} +.application.daggerheart.dh-style.dialog.environment-settings .tab.actions .action-list .action-item { + display: grid; + grid-template-columns: 40px 1fr auto; + align-items: center; + gap: 5px; +} +.application.daggerheart.dh-style.dialog.environment-settings .tab.actions .action-list .action-item img { + height: 40px; + width: 40px; + object-fit: cover; + border-radius: 3px; +} +.application.daggerheart.dh-style.dialog.environment-settings .tab.actions .action-list .action-item .label { + font-family: 'Montserrat', sans-serif; +} +.application.daggerheart.dh-style.dialog.environment-settings .tab.actions .action-list .action-item .label .tags { + display: flex; + gap: 10px; +} +.application.daggerheart.dh-style.dialog.environment-settings .tab.actions .action-list .action-item .label .tags .tag { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + padding: 3px 5px; + font-size: 12px; + background: light-dark(#22222215, #efe6d815); + border: 1px solid light-dark(#222, #efe6d8); + border-radius: 3px; +} +.application.daggerheart.dh-style.dialog.environment-settings .tab.actions .action-list .action-item .label .tags .label { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + font-size: 12px; +} +.application.daggerheart.dh-style.dialog.environment-settings .tab.actions .action-list .action-item .controls { + display: flex; + gap: 5px; +} +.application.daggerheart.dh-style.dialog.environment-settings .tab.actions .action-list .action-item .controls a { + text-align: center; +} +.application.daggerheart.dh-style.dialog .tab.adversaries { + max-height: 450px; + overflow-y: auto; + scrollbar-width: thin; + scrollbar-color: light-dark(#18162e, #f3c267) transparent; +} +.application.daggerheart.dh-style.dialog .tab.adversaries .add-action-btn { + width: 100%; + margin-bottom: 12px; +} +.application.daggerheart.dh-style.dialog .tab.adversaries .category-container { + display: flex; + flex-direction: column; + align-items: start; + gap: 8px; +} +.application.daggerheart.dh-style.dialog .tab.adversaries .category-container .category-name { + display: flex; + align-items: center; + gap: 10px; + width: 100%; +} +.application.daggerheart.dh-style.dialog .tab.adversaries .category-container .adversaries-container { + display: flex; + flex-direction: column; + gap: 6px; + width: 100%; +} +.application.daggerheart.dh-style.dialog .tab.adversaries .adversaries-dragger { + display: flex; + align-items: center; + justify-content: center; + box-sizing: border-box; + width: 100%; + height: 40px; + border: 1px dashed light-dark(#18162e50, #efe6d850); + border-radius: 3px; + color: light-dark(#18162e50, #efe6d850); + font-family: 'Montserrat', sans-serif; +} .application.sheet.daggerheart.actor.dh-style.companion .profile { height: 80px; width: 80px; @@ -5503,6 +5680,12 @@ div.daggerheart.views.multiclass { grid-template-columns: 1fr 4fr 1fr; cursor: pointer; } +.sheet.daggerheart.dh-style .tab.actions .actions-list .action-item img { + height: 40px; + width: 40px; + object-fit: cover; + border-radius: 3px; +} .sheet.daggerheart.dh-style .tab.actions .actions-list .action-item h4 { font-family: 'Montserrat', sans-serif; font-weight: lighter; @@ -5724,13 +5907,13 @@ div.daggerheart.views.multiclass { .sheet.daggerheart.dh-style.item .tab.features .feature-list .feature-item .feature-line .controls a { text-shadow: none; } -.application.sheet.daggerheart.actor.dh-style .inventory-item { +.application.daggerheart.dh-style .inventory-item { display: grid; grid-template-columns: 40px 1fr 60px; gap: 10px; width: 100%; } -.application.sheet.daggerheart.actor.dh-style .inventory-item .item-img { +.application.daggerheart.dh-style .inventory-item .item-img { height: 40px; width: 40px; border-radius: 3px; @@ -5738,20 +5921,23 @@ div.daggerheart.views.multiclass { cursor: pointer; object-fit: cover; } -.application.sheet.daggerheart.actor.dh-style .inventory-item .item-label { +.application.daggerheart.dh-style .inventory-item .item-img.actor-img { + border-radius: 50%; +} +.application.daggerheart.dh-style .inventory-item .item-label { font-family: 'Montserrat', sans-serif; align-self: center; } -.application.sheet.daggerheart.actor.dh-style .inventory-item .item-label .item-name { +.application.daggerheart.dh-style .inventory-item .item-label .item-name { font-size: 14px; } -.application.sheet.daggerheart.actor.dh-style .inventory-item .item-label .item-tags, -.application.sheet.daggerheart.actor.dh-style .inventory-item .item-label .item-labels { +.application.daggerheart.dh-style .inventory-item .item-label .item-tags, +.application.daggerheart.dh-style .inventory-item .item-label .item-labels { display: flex; gap: 10px; } -.application.sheet.daggerheart.actor.dh-style .inventory-item .item-label .item-tags .tag, -.application.sheet.daggerheart.actor.dh-style .inventory-item .item-label .item-labels .tag { +.application.daggerheart.dh-style .inventory-item .item-label .item-tags .tag, +.application.daggerheart.dh-style .inventory-item .item-label .item-labels .tag { display: flex; flex-direction: row; justify-content: center; @@ -5762,27 +5948,27 @@ div.daggerheart.views.multiclass { border: 1px solid light-dark(#222, #efe6d8); border-radius: 3px; } -.application.sheet.daggerheart.actor.dh-style .inventory-item .item-label .item-tags .label, -.application.sheet.daggerheart.actor.dh-style .inventory-item .item-label .item-labels .label { +.application.daggerheart.dh-style .inventory-item .item-label .item-tags .label, +.application.daggerheart.dh-style .inventory-item .item-label .item-labels .label { display: flex; flex-direction: row; justify-content: center; align-items: center; font-size: 12px; } -.application.sheet.daggerheart.actor.dh-style .inventory-item .controls { +.application.daggerheart.dh-style .inventory-item .controls { display: flex; align-items: center; justify-content: end; gap: 8px; } -.application.sheet.daggerheart.actor.dh-style .inventory-item .controls a { +.application.daggerheart.dh-style .inventory-item .controls a { text-align: center; } -.application.sheet.daggerheart.actor.dh-style .inventory-item .controls a.unequipped { +.application.daggerheart.dh-style .inventory-item .controls a.unequipped { opacity: 0.4; } -.application.sheet.daggerheart.actor.dh-style .card-item { +.application.daggerheart.dh-style .card-item { position: relative; height: 120px; width: 100px; @@ -5790,21 +5976,21 @@ div.daggerheart.views.multiclass { border-radius: 6px; cursor: pointer; } -.application.sheet.daggerheart.actor.dh-style .card-item:hover .card-label { +.application.daggerheart.dh-style .card-item:hover .card-label { padding-top: 15px; } -.application.sheet.daggerheart.actor.dh-style .card-item:hover .card-label .controls { +.application.daggerheart.dh-style .card-item:hover .card-label .controls { opacity: 1; visibility: visible; transition: all 0.3s ease; max-height: 16px; } -.application.sheet.daggerheart.actor.dh-style .card-item .card-img { +.application.daggerheart.dh-style .card-item .card-img { height: 100%; width: 100%; object-fit: cover; } -.application.sheet.daggerheart.actor.dh-style .card-item .card-label { +.application.daggerheart.dh-style .card-item .card-label { display: flex; flex-direction: column; height: fit-content; @@ -5818,7 +6004,7 @@ div.daggerheart.views.multiclass { bottom: 0; mask-image: linear-gradient(180deg, transparent 0%, black 20%); } -.application.sheet.daggerheart.actor.dh-style .card-item .card-label .card-name { +.application.daggerheart.dh-style .card-item .card-label .card-name { font-family: 'Montserrat', sans-serif; font-style: normal; font-weight: 400; @@ -5826,7 +6012,7 @@ div.daggerheart.views.multiclass { line-height: 15px; color: #efe6d8; } -.application.sheet.daggerheart.actor.dh-style .card-item .card-label .controls { +.application.daggerheart.dh-style .card-item .card-label .controls { display: flex; gap: 15px; align-items: center; diff --git a/styles/daggerheart.less b/styles/daggerheart.less index 9c5ba914..362856ce 100755 --- a/styles/daggerheart.less +++ b/styles/daggerheart.less @@ -29,10 +29,17 @@ @import './less/actors/adversary/sheet.less'; @import './less/actors/adversary/sidebar.less'; +@import './less/actors/environment/header.less'; +@import './less/actors/environment/sheet.less'; + @import './less/applications/header.less'; @import './less/applications/adversary-settings/sheet.less'; @import './less/applications/adversary-settings/experiences.less'; @import './less/applications/adversary-settings/actions.less'; + +@import './less/applications/environment-settings/actions.less'; +@import './less/applications/environment-settings/adversaries.less'; + @import './less/actors/companion/sheet.less'; @import './less/actors/adversary.less'; diff --git a/styles/less/actors/adversary/header.less b/styles/less/actors/adversary/header.less index a7a55f35..4b962466 100644 --- a/styles/less/actors/adversary/header.less +++ b/styles/less/actors/adversary/header.less @@ -29,44 +29,6 @@ outline: 2px solid light-dark(@dark, @golden); } } - - .level-div { - white-space: nowrap; - display: flex; - justify-content: end; - - .label { - display: flex; - align-items: center; - gap: 4px; - } - - input { - width: 40px; - padding: 0; - text-align: center; - } - - .level-button { - color: light-dark(@dark, @beige); - font-size: 18px; - line-height: 1; - min-height: unset; - height: min-content; - padding: 4px; - font-family: 'Cinzel', serif; - margin: 0; - font-weight: normal; - border-color: light-dark(@dark-blue, @golden); - background-color: light-dark(transparent, @deep-black); - - &:hover { - background-image: none; - background-color: var(--color-warm-2); - filter: drop-shadow(0 0 3px lightgray); - } - } - } } .tags { @@ -114,39 +76,5 @@ gap: 8px; align-items: center; } - - .character-details { - display: flex; - justify-content: space-between; - padding: 5px 0; - margin-bottom: 10px; - font-size: 12px; - color: light-dark(@dark-blue, @golden); - - span { - padding: 3px; - border-radius: 3px; - transition: all 0.3s ease; - cursor: pointer; - - &:hover { - background: light-dark(@dark-blue-40, @golden-40); - } - - &.dot { - background: transparent; - cursor: default; - } - } - } - - .character-row { - display: flex; - gap: 20px; - align-items: center; - justify-content: space-between; - padding: 0; - margin-bottom: 15px; - } } } diff --git a/styles/less/actors/environment/header.less b/styles/less/actors/environment/header.less new file mode 100644 index 00000000..fce7943f --- /dev/null +++ b/styles/less/actors/environment/header.less @@ -0,0 +1,140 @@ +@import '../../utils/colors.less'; +@import '../../utils/fonts.less'; + +.application.sheet.daggerheart.actor.dh-style.environment { + .environment-header-sheet { + display: flex; + flex-direction: column; + justify-content: start; + text-align: center; + + .profile { + width: 100%; + height: 235px; + object-fit: cover; + mask-image: linear-gradient(0deg, transparent 0%, black 10%); + cursor: pointer; + } + + .item-container { + display: flex; + align-items: center; + position: relative; + top: -45px; + gap: 20px; + padding: 0 20px; + margin-bottom: -30px; + + .item-info { + display: flex; + flex-direction: column; + gap: 8px; + + .tags { + display: flex; + gap: 10px; + padding-bottom: 0; + + .tag { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + padding: 3px 5px; + font-size: 12px; + font: @font-body; + + background: light-dark(@dark-15, @beige-15); + border: 1px solid light-dark(@dark, @beige); + border-radius: 3px; + } + + .label { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + font-size: 12px; + } + } + } + + .status-number { + justify-items: center; + + .status-value { + position: relative; + display: flex; + width: 50px; + height: 30px; + border: 1px solid light-dark(@dark-blue, @golden); + border-bottom: none; + border-radius: 6px 6px 0 0; + padding: 0 6px; + font-size: 1.2rem; + align-items: center; + justify-content: center; + background: light-dark(transparent, @dark-blue); + z-index: 2; + + &.armor-slots { + width: 80px; + height: 30px; + } + } + + .status-label { + padding: 2px 10px; + width: 100%; + border-radius: 3px; + background: light-dark(@dark-blue, @golden); + + h4 { + font-weight: bold; + text-align: center; + line-height: 18px; + font-size: 12px; + color: light-dark(@beige, @dark-blue); + } + } + } + + .item-name { + input[type='text'] { + font-size: 32px; + height: 42px; + text-align: start; + 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); + } + } + } + } + + .environment-info { + display: flex; + flex-direction: column; + gap: 12px; + padding: 10px 20px; + + .description, + .impulses { + text-align: start; + font-family: @font-body; + } + } + + .environment-navigation { + display: flex; + gap: 20px; + align-items: center; + padding: 0 20px; + } + } +} diff --git a/styles/less/actors/environment/sheet.less b/styles/less/actors/environment/sheet.less new file mode 100644 index 00000000..5e604188 --- /dev/null +++ b/styles/less/actors/environment/sheet.less @@ -0,0 +1,18 @@ +@import '../../utils/colors.less'; +@import '../../utils/fonts.less'; + +.application.sheet.daggerheart.actor.dh-style.environment { + .theme-light & { + background: url('../assets/parchments/dh-parchment-light.png'); + } + .theme-dark & { + background-image: url('../assets/parchments/dh-parchment-dark.png'); + } + + .tab { + max-height: 300px; + overflow-y: auto; + scrollbar-width: thin; + scrollbar-color: light-dark(@dark-blue, @golden) transparent; + } +} diff --git a/styles/less/applications/adversary-settings/actions.less b/styles/less/applications/adversary-settings/actions.less index 8bce0ad7..55cf2828 100644 --- a/styles/less/applications/adversary-settings/actions.less +++ b/styles/less/applications/adversary-settings/actions.less @@ -3,6 +3,11 @@ .application.daggerheart.dh-style.dialog { .tab.actions { + max-height: 450px; + overflow-y: auto; + scrollbar-width: thin; + scrollbar-color: light-dark(@dark-blue, @golden) transparent; + .add-action-btn { width: 100%; margin-bottom: 12px; @@ -18,6 +23,13 @@ grid-template-columns: 40px 1fr auto; align-items: center; gap: 5px; + border-radius: 3px; + + img { + height: 40px; + width: 40px; + object-fit: cover; + } .label { font-family: @font-body; diff --git a/styles/less/applications/environment-settings/actions.less b/styles/less/applications/environment-settings/actions.less new file mode 100644 index 00000000..e4886ea9 --- /dev/null +++ b/styles/less/applications/environment-settings/actions.less @@ -0,0 +1,74 @@ +@import '../../utils/colors.less'; +@import '../../utils/fonts.less'; + +.application.daggerheart.dh-style.dialog.environment-settings { + .tab.actions { + max-height: 450px; + overflow-y: auto; + scrollbar-width: thin; + scrollbar-color: light-dark(@dark-blue, @golden) transparent; + + .add-action-btn { + width: 100%; + margin-bottom: 12px; + } + + .action-list { + display: flex; + flex-direction: column; + gap: 10px; + + .action-item { + display: grid; + grid-template-columns: 40px 1fr auto; + align-items: center; + gap: 5px; + + img { + height: 40px; + width: 40px; + object-fit: cover; + border-radius: 3px; + } + + .label { + font-family: @font-body; + + .tags { + display: flex; + gap: 10px; + + .tag { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + padding: 3px 5px; + font-size: 12px; + + background: light-dark(@dark-15, @beige-15); + border: 1px solid light-dark(@dark, @beige); + border-radius: 3px; + } + + .label { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + font-size: 12px; + } + } + } + + .controls { + display: flex; + gap: 5px; + a { + text-align: center; + } + } + } + } + } +} diff --git a/styles/less/applications/environment-settings/adversaries.less b/styles/less/applications/environment-settings/adversaries.less new file mode 100644 index 00000000..a60314ff --- /dev/null +++ b/styles/less/applications/environment-settings/adversaries.less @@ -0,0 +1,50 @@ +@import '../../utils/colors.less'; +@import '../../utils/fonts.less'; + +.application.daggerheart.dh-style.dialog { + .tab.adversaries { + max-height: 450px; + overflow-y: auto; + scrollbar-width: thin; + scrollbar-color: light-dark(@dark-blue, @golden) transparent; + + .add-action-btn { + width: 100%; + margin-bottom: 12px; + } + + .category-container { + display: flex; + flex-direction: column; + align-items: start; + gap: 8px; + + .category-name { + display: flex; + align-items: center; + gap: 10px; + width: 100%; + } + + .adversaries-container { + display: flex; + flex-direction: column; + gap: 6px; + width: 100%; + } + } + + .adversaries-dragger { + display: flex; + align-items: center; + justify-content: center; + box-sizing: border-box; + width: 100%; + height: 40px; + border: 1px dashed light-dark(@dark-blue-50, @beige-50); + border-radius: 3px; + color: light-dark(@dark-blue-50, @beige-50); + font-family: @font-body; + } + } +} diff --git a/styles/less/global/inventory-item.less b/styles/less/global/inventory-item.less index d5b854b7..8d521c82 100644 --- a/styles/less/global/inventory-item.less +++ b/styles/less/global/inventory-item.less @@ -1,7 +1,7 @@ @import '../utils/colors.less'; @import '../utils/fonts.less'; -.application.sheet.daggerheart.actor.dh-style { +.application.daggerheart.dh-style { .inventory-item { display: grid; grid-template-columns: 40px 1fr 60px; @@ -15,6 +15,10 @@ border: none; cursor: pointer; object-fit: cover; + + &.actor-img { + border-radius: 50%; + } } .item-label { diff --git a/styles/less/global/tab-actions.less b/styles/less/global/tab-actions.less index 7b225d4a..0617016d 100644 --- a/styles/less/global/tab-actions.less +++ b/styles/less/global/tab-actions.less @@ -18,6 +18,13 @@ grid-template-columns: 1fr 4fr 1fr; cursor: pointer; + img { + height: 40px; + width: 40px; + object-fit: cover; + border-radius: 3px; + } + h4 { font-family: @font-body; font-weight: lighter; diff --git a/templates/sheets/actors/adversary/information.hbs b/templates/sheets/actors/adversary/information.hbs deleted file mode 100644 index 085f200c..00000000 --- a/templates/sheets/actors/adversary/information.hbs +++ /dev/null @@ -1,17 +0,0 @@ -
- {{!--
- {{localize "DAGGERHEART.Sheets.Adversary.FIELDS.description.label" }} - - {{formInput systemFields.description value=source.system.description}} -
--}} - -
- {{localize "DAGGERHEART.Sheets.Adversary.FIELDS.motivesAndTactics.label" }} - - {{formInput systemFields.motivesAndTactics value=source.system.motivesAndTactics}} -
-
diff --git a/templates/sheets/actors/adversary/main.hbs b/templates/sheets/actors/adversary/main.hbs deleted file mode 100644 index 5f172fab..00000000 --- a/templates/sheets/actors/adversary/main.hbs +++ /dev/null @@ -1,43 +0,0 @@ -
-
-
- {{localize "DAGGERHEART.Sheets.Adversary.General"}} - - -
{{formGroup systemFields.difficulty value=source.system.difficulty}}
- -
- {{localize "DAGGERHEART.Sheets.Adversary.HitPoints"}} - -
- -
- {{localize "DAGGERHEART.Sheets.Adversary.Stress"}} - -
- -
- {{localize "DAGGERHEART.Sheets.Adversary.Experiences"}} - - {{#each source.system.experiences}} -
- {{this.name}} - - {{formGroup @root.systemFields.experiences.element.fields.name name=(concat "system.experiences." @key ".name") value=this.name }} - {{formGroup @root.systemFields.experiences.element.fields.value name=(concat "system.experiences." @key ".value") value=this.value }} -
- {{/each}} -
-
-
-
diff --git a/templates/sheets/actors/environment/actions.hbs b/templates/sheets/actors/environment/actions.hbs new file mode 100644 index 00000000..48ee18a7 --- /dev/null +++ b/templates/sheets/actors/environment/actions.hbs @@ -0,0 +1,9 @@ +
+
+ {{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize tabs.actions.label) type='action'}} +
+
\ No newline at end of file diff --git a/templates/sheets/actors/environment/header.hbs b/templates/sheets/actors/environment/header.hbs index a21f5f64..d7fa9c3a 100644 --- a/templates/sheets/actors/environment/header.hbs +++ b/templates/sheets/actors/environment/header.hbs @@ -1,9 +1,49 @@ -
+
-
-

-
-

{{localize 'TYPES.Actor.environment'}}

+
+
+

+
+
+ + {{localize (concat 'DAGGERHEART.Tiers.' source.system.tier)}} + +
+ {{#if source.system.type}} +
+ + {{localize (concat 'DAGGERHEART.Environment.Type.' source.system.type '.label')}} + +
+ {{/if}} +
+
+
+
+ {{#if source.system.difficulty}} +

{{source.system.difficulty}}

+ {{else}} +

-

+ {{/if}} +
+
+

Difficulty

+
+ +
+
+ {{source.system.description}} +
+
+ {{localize 'DAGGERHEART.Sheets.Environment.FIELDS.impulses.label'}}: {{{source.system.impulses}}} +
+
+
+ {{> 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}} + +
\ No newline at end of file diff --git a/templates/sheets/actors/environment/information.hbs b/templates/sheets/actors/environment/information.hbs deleted file mode 100644 index 3b49a933..00000000 --- a/templates/sheets/actors/environment/information.hbs +++ /dev/null @@ -1,16 +0,0 @@ -
-
- {{localize "DAGGERHEART.Sheets.Environment.description"}} - - {{formInput systemFields.description value=source.system.description }} -
-
- {{localize "DAGGERHEART.Sheets.Environment.impulses"}} - - {{formInput systemFields.impulses value=source.system.impulses }} -
-
\ No newline at end of file diff --git a/templates/sheets/actors/environment/main.hbs b/templates/sheets/actors/environment/main.hbs deleted file mode 100644 index a973cdc9..00000000 --- a/templates/sheets/actors/environment/main.hbs +++ /dev/null @@ -1,37 +0,0 @@ -
-
- {{localize "DAGGERHEART.Sheets.Environment.general"}} - - {{formGroup systemFields.tier value=source.system.tier localize=true }} - {{formGroup systemFields.type value=source.system.type localize=true }} - {{formGroup systemFields.difficulty value=source.system.difficulty localize=true }} -
- -
- {{localize "DAGGERHEART.Sheets.Environment.potentialAdversaries.label"}} - - {{#each source.system.potentialAdversaries}} -
- - {{#if (eq (length this.adversaries) 0)}} -
{{localize "DAGGERHEART.Sheets.Environment.potentialAdversaries.placeholder"}}
- {{else}} -
- {{#each this.adversaries as |adversary id|}} -
{{adversary.name}}
- {{/each}} -
- {{/if}} -
- {{/each}} -
- -
- {{localize "DAGGERHEART.Sheets.Environment.features.label"}} - -
-
\ No newline at end of file diff --git a/templates/sheets/actors/environment/notes.hbs b/templates/sheets/actors/environment/notes.hbs new file mode 100644 index 00000000..effa7240 --- /dev/null +++ b/templates/sheets/actors/environment/notes.hbs @@ -0,0 +1,10 @@ +
+
+ {{localize tabs.notes.label}} + {{formInput systemFields.notes value=document.system.notes enriched=document.system.notes localize=true toggled=true}} +
+
\ No newline at end of file diff --git a/templates/sheets/actors/environment/potentialAdversaries.hbs b/templates/sheets/actors/environment/potentialAdversaries.hbs new file mode 100644 index 00000000..f39a1adf --- /dev/null +++ b/templates/sheets/actors/environment/potentialAdversaries.hbs @@ -0,0 +1,11 @@ +
+
+ {{#each document.system.potentialAdversaries}} + {{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=this.label type='adversary' isGlassy=true adversaries=this.adversaries}} + {{/each}} +
+
\ No newline at end of file diff --git a/templates/sheets/adversary.hbs b/templates/sheets/adversary.hbs deleted file mode 100644 index 67230fdf..00000000 --- a/templates/sheets/adversary.hbs +++ /dev/null @@ -1,238 +0,0 @@ -
-
-
- -
- {{#if this.editMode}} - {{formInput fields.name value=source.name rootId=partId placeholder="{{ localize 'Name' }}"}} - {{else}} -
{{this.title}}
- {{/if}} -
-
- -
- -
- {{#if this.editMode}} -
-

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

- -

-
-
{{localize "DAGGERHEART.Sheets.Adversary.MotivesAndTactics"}}
- -
-

-
- {{#each source.system.motivesAndTactics as |motive index|}} -
- - -
- {{/each}} -
-
-
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-

{{localize "DAGGERHEART.Sheets.Adversary.Attack.Title"}}

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

-
-
{{localize "DAGGERHEART.Sheets.Adversary.Experiences"}}
- -
-

- {{#each source.system.experiences as |experience index|}} -
- - - -
- {{/each}} -
-
-

{{localize "DAGGERHEART.Sheets.Adversary.Features"}}

- {{#each this.data.features as |feature key|}} -
-
- -
{{feature.name}}
-
-
- - -
-
- {{/each}} -
-
- {{else}} -
-
- {{localize "DAGGERHEART.Sheets.Adversary.Description"}}: {{this.data.description}} -
-
- {{localize "DAGGERHEART.Sheets.Adversary.MotivesAndTactics"}}: {{this.data.motivesAndTactics}} -
-
-
-
-
-
- - {{this.data.tier}} -
-
- - {{this.data.type}} -
-
-
-
- - {{this.data.difficulty}} -
-
- - -
-
- - +{{this.data.attack.attackModifier}} - -
-
- - {{this.data.attack.range}} | {{this.data.attack.damage.value}} {{this.data.attack.damage.typeName}} -
-
-
-
- - {{this.data.damageThresholds.major}} -
- - {{this.data.damageThresholds.severe}} -
-
- -
- {{#times this.data.hp.max}} - - {{/times}} -
-
-
- -
- {{#times this.data.stress.max}} - - {{/times}} -
-
-
-
- - {{#each source.system.experiences as |experience index|}} -
- {{experience.name}} -   - {{#if (gte experience.value 0)}}+{{else}}-{{/if}}{{experience.value}} -
- {{/each}} -
- {{!--
- - {{this.data.hp.max}} -
--}} -
-
-
{{localize "DAGGERHEART.Sheets.Adversary.Features"}}
- {{#each this.data.features as |feature index|}} -
- -
{{{feature.system.description}}}
-
- {{/each}} -
-
- - {{/if}} -
-
\ No newline at end of file diff --git a/templates/sheets/applications/environment-settings/actions.hbs b/templates/sheets/applications/environment-settings/actions.hbs new file mode 100644 index 00000000..73594da2 --- /dev/null +++ b/templates/sheets/applications/environment-settings/actions.hbs @@ -0,0 +1,34 @@ +
+ +
+ {{localize tabs.actions.label}} +
    + {{#each document.system.actions as |action index|}} +
  • + +
    + {{action.name}} +
    +
    + {{localize (concat 'DAGGERHEART.Actions.Types.' action.type '.name')}} +
    +
    + {{localize (concat 'DAGGERHEART.ActionType.' action.actionType)}} +
    +
    +
    +
    + + +
    +
  • + {{/each}} +
+
+
\ No newline at end of file diff --git a/templates/sheets/applications/environment-settings/adversaries.hbs b/templates/sheets/applications/environment-settings/adversaries.hbs new file mode 100644 index 00000000..0abe45d1 --- /dev/null +++ b/templates/sheets/applications/environment-settings/adversaries.hbs @@ -0,0 +1,28 @@ +
+ + {{#each document.system.potentialAdversaries}} +
+ {{this.label}} +
+ + +
+
+ {{#each this.adversaries as |adversary|}} +
+ {{> 'systems/daggerheart/templates/sheets/global/partials/inventory-item.hbs' item=adversary type='adversary' isActor=true categoryAdversary=@../key}} +
+ {{/each}} +
+
+ Drop Actors here +
+
+ {{/each}} +
\ No newline at end of file diff --git a/templates/sheets/applications/environment-settings/details.hbs b/templates/sheets/applications/environment-settings/details.hbs new file mode 100644 index 00000000..f6a9518b --- /dev/null +++ b/templates/sheets/applications/environment-settings/details.hbs @@ -0,0 +1,16 @@ +
+
+ {{localize 'DAGGERHEART.General.basics'}} +
+ {{formGroup systemFields.tier value=document.system.tier localize=true}} + {{formGroup systemFields.type value=document.system.type localize=true}} + {{formGroup systemFields.difficulty value=document.system.difficulty localize=true}} +
+ {{formField systemFields.description value=document.system.description label=(localize "DAGGERHEART.Sheets.Environment.FIELDS.description.label")}} + {{formField systemFields.impulses value=document.system.impulses label=(localize "DAGGERHEART.Sheets.Environment.FIELDS.impulses.label")}} +
+
\ No newline at end of file diff --git a/templates/sheets/applications/environment-settings/header.hbs b/templates/sheets/applications/environment-settings/header.hbs new file mode 100644 index 00000000..0978f2c3 --- /dev/null +++ b/templates/sheets/applications/environment-settings/header.hbs @@ -0,0 +1,3 @@ +
+

{{document.name}}

+
\ No newline at end of file diff --git a/templates/sheets/character/character.hbs b/templates/sheets/character/character.hbs deleted file mode 100644 index 28b80cc7..00000000 --- a/templates/sheets/character/character.hbs +++ /dev/null @@ -1,151 +0,0 @@ -
-
-
-
-
- {{#if document.system.class.value}} -
-

- - {{document.system.class.value.name}} - -

- - {{document.system.class.value.system.domains.[0]}} - and - {{document.system.class.value.system.domains.[1]}} -
- {{else}} -
-

Class

-
- {{/if}} -
-
-
-
-
-
-
-
- {{localize "DAGGERHEART.Sheets.PC.Name"}} - -
-
- {{localize "DAGGERHEART.Sheets.PC.Pronouns"}} - -
-
- - -
-
-
-
- - {{#if document.system.levelData.canLevelUp}}
*
{{/if}} -
- -
{{localize "DAGGERHEART.Sheets.PC.Level"}}
-
-
-
- {{#objectSelector title="Heritage" ids=(join document.system.community.uuid document.system.ancestry.uuid) values=(join document.system.community.name document.system.ancestry.name) titleFontSize=14 style="min-width: 272px;"}} - - - {{/objectSelector}} - {{#objectSelector title="Subclass" ids=(join document.system.class.subclass.uuid) values=(join document.system.class.subclass.name) titleFontSize=14}} - - {{/objectSelector}} -
-
-
- -
-
-
-
-
-
-
-
-
- {{> "systems/daggerheart/templates/sheets/parts/defense.hbs" }} - {{> "systems/daggerheart/templates/sheets/parts/health.hbs" }} - {{> "systems/daggerheart/templates/sheets/parts/hope.hbs" }} - {{> "systems/daggerheart/templates/sheets/parts/gold.hbs" }} - {{> "systems/daggerheart/templates/sheets/parts/features.hbs" }} -
-
- {{> "systems/daggerheart/templates/sheets/parts/attributes.hbs" }} - {{> "systems/daggerheart/templates/sheets/parts/weapons.hbs" primaryWeapon=document.system.primaryWeapon secondaryWeapon=document.system.secondaryWeapon weaponBurden=document.system.getWeaponBurden proficiency=document.system.proficiency }} - {{> "systems/daggerheart/templates/sheets/parts/armor.hbs" armor=document.system.armor }} -
-
-
-
-
-
- {{> "systems/daggerheart/templates/sheets/character/sections/loadout.hbs" abilities=this.abilities actor=this.document config=this.config }} -
-
- {{> "systems/daggerheart/templates/sheets/character/sections/inventory.hbs" inventory=this.inventory }} -
-
-
-
-
- {{localize "DAGGERHEART.Sheets.PC.Story.BackgroundTitle"}} - - {{editor document.system.story.background target="system.story.background" button=true }} -
-
- {{localize "DAGGERHEART.Sheets.PC.Story.AppearanceTitle"}} - - {{editor document.system.story.appearance target="system.story.appearance" button=true }} -
-
-
-
- {{localize "DAGGERHEART.Sheets.PC.Story.ConnectionsTitle"}} - - {{editor document.system.story.connections target="system.story.connections" button=true }} -
-
- - {{localize "DAGGERHEART.Sheets.PC.Story.Scars.Title"}} - - - -
- {{#each document.system.story.scars as |scar index|}} -
- - -
- {{/each}} -
- {{#with (lookup document.system.story.scars this.selectedScar)}} - {{#if this}} -
- - {{editor this.description target=(concat "system.story.scars." ../selectedScar ".description") button=true}} -
- {{/if}} - {{/with}} -
-
-
-
-
-
- -
-
\ No newline at end of file diff --git a/templates/sheets/character/parts/advancementCard.hbs b/templates/sheets/character/parts/advancementCard.hbs deleted file mode 100644 index 89e7c145..00000000 --- a/templates/sheets/character/parts/advancementCard.hbs +++ /dev/null @@ -1,27 +0,0 @@ -
-
- -
- {{#each card.domains}} - - {{/each}} -
-
-
{{card.className}}
-
-
-
-
{{card.subclassName}}
-
{{card.subtitle}}
- {{#if card.spellcast}}
Spellcast:  {{localize card.spellcast}}
{{/if}} -
{{{card.description}}}
-
- {{#each card.abilities as |ability key|}} -
- {{ability.name}} - {{{ability.system.description}}} -
- {{/each}} -
-
-
\ No newline at end of file diff --git a/templates/sheets/character/parts/heritageCard.hbs b/templates/sheets/character/parts/heritageCard.hbs deleted file mode 100644 index 40401ac8..00000000 --- a/templates/sheets/character/parts/heritageCard.hbs +++ /dev/null @@ -1,18 +0,0 @@ -
-
- -
{{card.system.type}}
-
-
-
{{card.name}}
-
{{{card.system.description}}}
-
- {{#each card.system.abilities as |ability key|}} -
- {{ability.name}} - {{{ability.system.description}}} -
- {{/each}} -
-
-
\ No newline at end of file diff --git a/templates/sheets/character/sections/inventory.hbs b/templates/sheets/character/sections/inventory.hbs deleted file mode 100644 index f56138dc..00000000 --- a/templates/sheets/character/sections/inventory.hbs +++ /dev/null @@ -1,35 +0,0 @@ -
- {{#each this.inventory as |section key|}} -
    -
  1. -
    -
    {{section.titles.name}}
    -
    {{section.titles.quantity}}
    -
    -
  2. -
-
    - {{#each this.items as |item|}} -
  1. -
    -
    -
    - - {{item.name}} -
    -
    -
    - -
    -
    - - - -
    - -
    -
  2. - {{/each}} -
- {{/each}} -
\ No newline at end of file diff --git a/templates/sheets/character/sections/loadout.hbs b/templates/sheets/character/sections/loadout.hbs deleted file mode 100644 index 4feeebe8..00000000 --- a/templates/sheets/character/sections/loadout.hbs +++ /dev/null @@ -1,137 +0,0 @@ -
- -
-
-
-
-
- {{#if abilities.foundation.ancestry}} - {{> "systems/daggerheart/templates/sheets/character/parts/heritageCard.hbs" card=abilities.foundation.ancestry }} - {{else}} -
-
-
{{localize "DAGGERHEART.Sheets.PC.Heritage.EmptyAncestry"}}
-
{{localize "DAGGERHEART.Sheets.PC.Heritage.EmptyAncestryTip"}}
-
-
-
- {{/if}} -
-
- {{#if abilities.foundation.community}} - {{> "systems/daggerheart/templates/sheets/character/parts/heritageCard.hbs" card=abilities.foundation.community }} - {{else}} -
-
-
{{localize "DAGGERHEART.Sheets.PC.Heritage.EmptyCommunity"}}
-
{{localize "DAGGERHEART.Sheets.PC.Heritage.EmptyCommunityTip"}}
-
-
-
- {{/if}} -
-
-
-
- {{#if abilities.foundation.advancement.foundation}} - {{> "systems/daggerheart/templates/sheets/character/parts/advancementCard.hbs" card=abilities.foundation.advancement.foundation }} - {{else}} -
-
-
{{localize "DAGGERHEART.Sheets.PC.Heritage.SubclassFoundation"}}
-
{{localize "DAGGERHEART.Sheets.PC.Heritage.SubclassFoundationTip"}}
-
-
-
- {{/if}} -
-
- {{#if abilities.foundation.advancement.first}} - {{> "systems/daggerheart/templates/sheets/character/parts/advancementCard.hbs" card=abilities.foundation.advancement.first }} - {{else}} -
-
-
{{localize "DAGGERHEART.Sheets.PC.Heritage.Subclass"}}
-
{{localize "DAGGERHEART.General.Or"}}
-
{{localize "DAGGERHEART.Sheets.PC.Heritage.Multiclass"}}
-
-
-
- {{/if}} -
-
- {{#if abilities.foundation.advancement.second}} - {{> "systems/daggerheart/templates/sheets/character/parts/advancementCard.hbs" card=abilities.foundation.advancement.second}} - {{else}} -
-
-
{{localize "DAGGERHEART.Sheets.PC.Heritage.Subclass"}}
-
{{localize "DAGGERHEART.General.Or"}}
-
{{localize "DAGGERHEART.Sheets.PC.Heritage.Multiclass"}}
-
-
-
- {{/if}} -
-
-
-
-
-
-
- {{#times 2}} -
- {{#with (lookup ../abilities.loadout.top this)}} - {{> "systems/daggerheart/templates/sheets/parts/domainCard.hbs" card=this inVault=false }} - {{/with}} - {{#if (not (lookup ../abilities.loadout.top this))}} -
-
{{localize "DAGGERHEART.Sheets.PC.DomainCard.AvailableDomainSlot"}}
-
-
- {{/if}} -
- {{/times}} -
-
- {{#times 3}} -
- {{#with (lookup ../abilities.loadout.bottom this)}} - {{> "systems/daggerheart/templates/sheets/parts/domainCard.hbs" card=this inVault=false }} - {{/with}} - {{#if (gt (add this 3) ../actor/system/domainData.maxLoadout)}} -
-
{{localize "DAGGERHEART.Sheets.PC.DomainCard.UnavailableDomainSlot" level=(add this 2)}}
-
-
- {{/if}} - - {{#if (and (lte (add this 3) ../actor/system/domainData.maxLoadout) (lt ../abilities.loadout.bottom.length (add this 1)))}} -
-
{{localize "DAGGERHEART.Sheets.PC.DomainCard.AvailableDomainSlot"}}
-
-
- {{/if}} -
- {{/times}} -
-
-
-
-
- {{#each abilities.vault}} -
- {{> "systems/daggerheart/templates/sheets/parts/domainCard.hbs" card=this inVault=true }} -
- {{/each}} -
-
-
-
\ No newline at end of file diff --git a/templates/sheets/environment.hbs b/templates/sheets/environment.hbs deleted file mode 100644 index 5a0f3bbb..00000000 --- a/templates/sheets/environment.hbs +++ /dev/null @@ -1,111 +0,0 @@ -
-
-
- -
- {{#if this.editMode}} - - {{else}} -
{{source.name}}
- {{/if}} -
-
- -
-
- {{#if this.editMode}} -
-

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

- -

{{localize "DAGGERHEART.Sheets.Environment.ToneAndFeel"}}

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

{{localize "DAGGERHEART.Sheets.Environment.PotentialAdversaries"}}

- -
-
-

{{localize "DAGGERHEART.Sheets.Adversary.Features"}}

- {{#each data.features as |feature key|}} -
-
- -
{{feature.name}}
-
-
- - -
-
- {{/each}} -
-
- {{else}} -
-
- {{localize "DAGGERHEART.Sheets.Adversary.Description"}}: {{source.system.description}} -
-
- {{localize "DAGGERHEART.Sheets.Environment.ToneAndFeel"}}: {{source.system.toneAndFeel}} -
-
-
-
-
-
- - {{source.system.tier}} -
-
- - {{this.data.type}} -
-
-
-
- - {{source.system.difficulty}} -
-
-
- - - {{source.system.potentialAdversaries}} -
-
-
-
{{localize "DAGGERHEART.Sheets.Adversary.Features"}}
- {{#each data.features as |feature index|}} -
- -
{{{feature.system.description}}}
-
- {{/each}} -
-
- {{/if}} -
-
diff --git a/templates/sheets/global/partials/inventory-fieldset-items.hbs b/templates/sheets/global/partials/inventory-fieldset-items.hbs index 81ff5094..0051d6df 100644 --- a/templates/sheets/global/partials/inventory-fieldset-items.hbs +++ b/templates/sheets/global/partials/inventory-fieldset-items.hbs @@ -49,6 +49,9 @@ {{> 'systems/daggerheart/templates/sheets/global/partials/inventory-item.hbs' item=feature companion=true}} {{/if}} {{/each}} + {{#each adversaries as |adversary|}} + {{> 'systems/daggerheart/templates/sheets/global/partials/inventory-item.hbs' item=adversary type='adversary' hideControls=true isActor=true categoryAdversary=@../key}} + {{/each}} {{/unless}} diff --git a/templates/sheets/global/partials/inventory-item.hbs b/templates/sheets/global/partials/inventory-item.hbs index a27bc3ce..491829d1 100644 --- a/templates/sheets/global/partials/inventory-item.hbs +++ b/templates/sheets/global/partials/inventory-item.hbs @@ -1,5 +1,5 @@
  • - +
    {{item.name}}
    {{#if (eq type 'weapon')}} @@ -111,31 +111,48 @@
    {{/if}}
  • -
    - {{#if (eq type 'weapon')}} - - - + {{#unless hideControls}} + {{#if isActor}} +
    + {{#if (eq type 'adversary')}} + + + + + + + {{/if}} +
    + {{else}} +
    + {{#if (eq type 'weapon')}} + + + + {{/if}} + {{#if (eq type 'armor')}} + + + + {{/if}} + {{#if (eq type 'domainCard')}} + {{#unless item.system.inVault}} + + + + {{else}} + + + + {{/unless}} + + {{/if}} + + +
    {{/if}} - {{#if (eq type 'armor')}} - - - - {{/if}} - {{#if (eq type 'domainCard')}} - {{#unless item.system.inVault}} - - - - {{else}} - - - - {{/unless}} - - {{/if}} - - -
    + {{else}} + + {{/unless}}
    {{#unless isSidebar}}{{{item.system.description}}}{{/unless}}
    \ No newline at end of file From eb647f1e318486d60a003f637fe98c06764a3fd7 Mon Sep 17 00:00:00 2001 From: WBHarry <89362246+WBHarry@users.noreply.github.com> Date: Wed, 2 Jul 2025 15:42:35 +0200 Subject: [PATCH 4/6] Removed non-existing template preload (#244) --- daggerheart.mjs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/daggerheart.mjs b/daggerheart.mjs index 5433c586..dbe5aa21 100644 --- a/daggerheart.mjs +++ b/daggerheart.mjs @@ -289,7 +289,6 @@ const preloadHandlebarsTemplates = async function () { 'systems/daggerheart/templates/sheets/global/partials/action-item.hbs', 'systems/daggerheart/templates/sheets/global/partials/domain-card-item.hbs', 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs', - 'systems/daggerheart/templates/sheets/parts/attributes.hbs', 'systems/daggerheart/templates/sheets/parts/defense.hbs', 'systems/daggerheart/templates/sheets/parts/armor.hbs', @@ -303,10 +302,6 @@ const preloadHandlebarsTemplates = async function () { 'systems/daggerheart/templates/sheets/parts/heritage.hbs', 'systems/daggerheart/templates/sheets/parts/subclassFeature.hbs', 'systems/daggerheart/templates/sheets/parts/effects.hbs', - 'systems/daggerheart/templates/sheets/character/sections/inventory.hbs', - 'systems/daggerheart/templates/sheets/character/sections/loadout.hbs', - 'systems/daggerheart/templates/sheets/character/parts/heritageCard.hbs', - 'systems/daggerheart/templates/sheets/character/parts/advancementCard.hbs', 'systems/daggerheart/templates/sheets/items/subclass/parts/subclass-features.hbs', 'systems/daggerheart/templates/sheets/items/subclass/parts/subclass-feature.hbs', 'systems/daggerheart/templates/components/card-preview.hbs', From 750282aeec3a260cc7efbd35dd6f955875f88f43 Mon Sep 17 00:00:00 2001 From: Dapoulp <74197441+Dapoulp@users.noreply.github.com> Date: Wed, 2 Jul 2025 21:13:06 +0200 Subject: [PATCH 5/6] Feature/233 234 235 (#246) * #233 #234 #235 + Fixes * Fix reaction roll --- lang/en.json | 4 + .../applications/npcRollSelectionDialog.mjs | 2 + module/applications/roll.mjs | 195 ++++++++++-------- module/applications/rollSelectionDialog.mjs | 2 + .../applications/sheets/actors/adversary.mjs | 2 +- .../applications/adversary-settings.mjs | 1 + module/config/actionConfig.mjs | 15 ++ module/data/action/action.mjs | 7 +- module/data/action/actionDice.mjs | 5 +- module/data/fields/actionField.mjs | 4 +- module/data/item/base.mjs | 5 +- module/dialogs/d20RollDialog.mjs | 20 +- module/dialogs/damageDialog.mjs | 9 +- styles/chat.less | 20 +- styles/daggerheart.css | 14 +- styles/less/global/elements.less | 12 ++ templates/chat/adversary-roll.hbs | 4 +- templates/chat/duality-roll.hbs | 24 +++ .../adversary-settings/attack.hbs | 18 +- templates/views/action.hbs | 2 - templates/views/actionTypes/damage.hbs | 106 +++++----- templates/views/actionTypes/roll.hbs | 3 + templates/views/damageSelection.hbs | 6 +- templates/views/rollSelection.hbs | 67 ++++-- 24 files changed, 355 insertions(+), 192 deletions(-) diff --git a/lang/en.json b/lang/en.json index 4458d9ac..49196f50 100755 --- a/lang/en.json +++ b/lang/en.json @@ -192,6 +192,10 @@ "Full": "Disadvantage", "Short": "Dis" }, + "Neutral": { + "Full": "None", + "Short": "no" + }, "OK": "OK", "Cancel": "Cancel", "Or": "Or", diff --git a/module/applications/npcRollSelectionDialog.mjs b/module/applications/npcRollSelectionDialog.mjs index 7c8290fb..1a56f12a 100644 --- a/module/applications/npcRollSelectionDialog.mjs +++ b/module/applications/npcRollSelectionDialog.mjs @@ -1,3 +1,5 @@ +/** NOT USED ANYMORE - TO BE DELETED **/ + const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api; export default class NpcRollSelectionDialog extends HandlebarsApplicationMixin(ApplicationV2) { diff --git a/module/applications/roll.mjs b/module/applications/roll.mjs index cb7d0dff..1c89644f 100644 --- a/module/applications/roll.mjs +++ b/module/applications/roll.mjs @@ -8,6 +8,7 @@ import DamageDialog from '../dialogs/damageDialog.mjs'; */ export class DHRoll extends Roll { + baseTerms = []; constructor(formula, data, options) { super(formula, data, options); } @@ -37,6 +38,7 @@ export class DHRoll extends Roll { if (config.dialog.configure !== false) { // Open Roll Dialog const DialogClass = config.dialog?.class ?? this.DefaultDialog; + console.log(roll, config) const configDialog = await DialogClass.configure(roll, config, message); if (!configDialog) return; } @@ -98,9 +100,27 @@ export class DHRoll extends Roll { config.dialog.configure ??= !(config.event.shiftKey || config.event.altKey || config.event.ctrlKey); } + formatModifier(modifier) { + const numTerm = modifier < 0 ? '-' : '+'; + return [ + new foundry.dice.terms.OperatorTerm({ operator: numTerm }), + new foundry.dice.terms.NumericTerm({ number: Math.abs(modifier) }) + ]; + } + + getFaces(faces) { + return Number((faces.startsWith('d') ? faces.replace('d', '') : faces)); + } + constructFormula(config) { - // const formula = Roll.replaceFormulaData(this.options.roll.formula, config.data); this.terms = Roll.parse(this.options.roll.formula, config.data); + + if (this.options.extraFormula) { + this.terms.push( + new foundry.dice.terms.OperatorTerm({ operator: '+' }), + ...this.constructor.parse(this.options.extraFormula, this.options.data) + ); + } return (this._formula = this.constructor.getFormula(this.terms)); } } @@ -112,12 +132,9 @@ export class DualityDie extends foundry.dice.terms.Die { } export class D20Roll extends DHRoll { + constructor(formula, data = {}, options = {}) { super(formula, data, options); - // this.createBaseDice(); - // this.configureModifiers(); - - // this._formula = this.resetFormula(); this.constructFormula(); } @@ -140,7 +157,7 @@ export class D20Roll extends DHRoll { set d20(faces) { if (!(this.terms[0] instanceof foundry.dice.terms.Die)) this.createBaseDice(); - this.terms[0].faces = faces; + this.terms[0].faces = this.getFaces(faces); } get dAdvantage() { @@ -153,11 +170,11 @@ export class D20Roll extends DHRoll { } get hasAdvantage() { - return this.options.advantage === this.constructor.ADV_MODE.ADVANTAGE; + return this.options.roll.advantage === this.constructor.ADV_MODE.ADVANTAGE; } get hasDisadvantage() { - return this.options.advantage === this.constructor.ADV_MODE.DISADVANTAGE; + return this.options.roll.advantage === this.constructor.ADV_MODE.DISADVANTAGE; } static applyKeybindings(config) { @@ -171,18 +188,55 @@ export class D20Roll extends DHRoll { config.dialog.configure ??= !Object.values(keys).some(k => k); // Determine advantage mode - const advantage = config.advantage || keys.advantage; - const disadvantage = config.disadvantage || keys.disadvantage; - if (advantage && !disadvantage) config.advantage = this.ADV_MODE.ADVANTAGE; - else if (!advantage && disadvantage) config.advantage = this.ADV_MODE.DISADVANTAGE; - else config.advantage = this.ADV_MODE.NORMAL; + const advantage = config.roll.advantage === this.ADV_MODE.ADVANTAGE || keys.advantage; + const disadvantage = config.roll.advantage === this.ADV_MODE.DISADVANTAGE || keys.disadvantage; + if (advantage && !disadvantage) config.roll.advantage = this.ADV_MODE.ADVANTAGE; + else if (!advantage && disadvantage) config.roll.advantage = this.ADV_MODE.DISADVANTAGE; + else config.roll.advantage = this.ADV_MODE.NORMAL; + } + + constructFormula(config) { + // this.terms = []; + this.createBaseDice(); + this.configureModifiers(); + this.resetFormula(); + return this._formula; } createBaseDice() { - if (this.terms[0] instanceof foundry.dice.terms.Die) return; + if (this.terms[0] instanceof foundry.dice.terms.Die) { + this.terms = [this.terms[0]]; + return; + } this.terms[0] = new foundry.dice.terms.Die({ faces: 20 }); } + configureModifiers() { + this.applyAdvantage(); + this.applyBaseBonus(); + + this.options.experiences?.forEach(m => { + if (this.options.data.experiences?.[m]) + this.options.roll.modifiers.push({ + label: this.options.data.experiences[m].name, + value: this.options.data.experiences[m].total ?? this.options.data.experiences[m].value + }); + }); + + this.options.roll.modifiers?.forEach(m => { + this.terms.push(...this.formatModifier(m.value)); + }); + + this.baseTerms = foundry.utils.deepClone(this.terms); + + if (this.options.extraFormula) { + this.terms.push( + new foundry.dice.terms.OperatorTerm({ operator: '+' }), + ...this.constructor.parse(this.options.extraFormula, this.options.data) + ); + } + } + applyAdvantage() { this.d20.modifiers.findSplice(m => ['kh', 'kl'].includes(m)); if (!this.hasAdvantage && !this.hasDisadvantage) this.number = 1; @@ -192,47 +246,16 @@ export class D20Roll extends DHRoll { } } - // Trait bonus != Adversary - configureModifiers() { - this.applyAdvantage(); - // this.options.roll.modifiers = []; - this.applyBaseBonus(); - - this.options.experiences?.forEach(m => { - if (this.options.data.experiences?.[m]) - this.options.roll.modifiers.push({ - label: this.options.data.experiences[m].name, - value: this.options.data.experiences[m].total ?? this.options.data.experiences[m].value - }); - }); - this.options.roll.modifiers?.forEach(m => { - this.terms.push(...this.formatModifier(m.value)); - }); - - if (this.options.extraFormula) { - this.terms.push( - new foundry.dice.terms.OperatorTerm({ operator: '+' }), - ...this.constructor.parse(this.options.extraFormula, this.getRollData()) - ); - } - // this.resetFormula(); - } - - constructFormula(config) { - this.terms = []; - this.createBaseDice(); - this.configureModifiers(); - this.resetFormula(); - return this._formula; - } - applyBaseBonus() { - this.options.roll.modifiers = [ + this.options.roll.modifiers = []; + if(!this.options.roll.bonus) return; + this.options.roll.modifiers.push( { label: 'Bonus to Hit', - value: Roll.replaceFormulaData('@attackBonus', this.data) + value: this.options.roll.bonus + // value: Roll.replaceFormulaData('@attackBonus', this.data) } - ]; + ); } static postEvaluate(roll, config = {}) { @@ -242,26 +265,22 @@ export class D20Roll extends DHRoll { const difficulty = config.roll.difficulty ?? target.difficulty ?? target.evasion; target.hit = this.isCritical || roll.total >= difficulty; }); - } else if (config.roll.difficulty) - config.roll.success = roll.isCritical || roll.total >= config.roll.difficulty; + } else if (config.roll.difficulty) config.roll.success = roll.isCritical || roll.total >= config.roll.difficulty; config.roll.advantage = { - type: config.advantage, + type: config.roll.advantage, dice: roll.dAdvantage?.denomination, value: roll.dAdvantage?.total }; - config.roll.modifierTotal = config.roll.modifiers.reduce((a, c) => a + Number(c.value), 0); - } - - getRollData() { - return this.options.data; - } - - formatModifier(modifier) { - const numTerm = modifier < 0 ? '-' : '+'; - return [ - new foundry.dice.terms.OperatorTerm({ operator: numTerm }), - new foundry.dice.terms.NumericTerm({ number: Math.abs(modifier) }) - ]; + config.roll.extra = roll.dice.filter(d => !roll.baseTerms.includes(d)).map(d => { + return { + dice: d.denomination, + value: d.total + } + }) + config.roll.modifierTotal = 0; + for(let i = 0; i < roll.terms.length; i++) { + if(roll.terms[i] instanceof foundry.dice.terms.NumericTerm && !!roll.terms[i-1] && roll.terms[i-1] instanceof foundry.dice.terms.OperatorTerm) config.roll.modifierTotal += Number(`${roll.terms[i-1].operator}${roll.terms[i].total}`); + } } resetFormula() { @@ -270,6 +289,8 @@ export class D20Roll extends DHRoll { } export class DualityRoll extends D20Roll { + _advantageFaces = 6; + constructor(formula, data = {}, options = {}) { super(formula, data, options); } @@ -287,7 +308,7 @@ export class DualityRoll extends D20Roll { set dHope(faces) { if (!(this.dice[0] instanceof CONFIG.Dice.daggerheart.DualityDie)) this.createBaseDice(); - this.terms[0].faces = faces; + this.terms[0].faces = this.getFaces(faces); // this.#hopeDice = `d${face}`; } @@ -300,7 +321,7 @@ export class DualityRoll extends D20Roll { set dFear(faces) { if (!(this.dice[1] instanceof CONFIG.Dice.daggerheart.DualityDie)) this.createBaseDice(); - this.dice[1].faces = faces; + this.dice[1].faces = this.getFaces(faces); // this.#fearDice = `d${face}`; } @@ -308,6 +329,14 @@ export class DualityRoll extends D20Roll { return this.dice[2]; } + get advantageFaces() { + return this._advantageFaces; + } + + set advantageFaces(faces) { + this._advantageFaces = this.getFaces(faces); + } + get isCritical() { if (!this.dHope._evaluated || !this.dFear._evaluated) return; return this.dHope.total === this.dFear.total; @@ -337,25 +366,25 @@ export class DualityRoll extends D20Roll { return game.i18n.localize(label); } + updateFormula() { + + } + createBaseDice() { - if ( - this.dice[0] instanceof CONFIG.Dice.daggerheart.DualityDie && - this.dice[1] instanceof CONFIG.Dice.daggerheart.DualityDie - ) + if (this.dice[0] instanceof CONFIG.Dice.daggerheart.DualityDie && this.dice[1] instanceof CONFIG.Dice.daggerheart.DualityDie) { + this.terms = [this.terms[0], this.terms[1], this.terms[2]]; return; - if (!(this.dice[0] instanceof CONFIG.Dice.daggerheart.DualityDie)) - this.terms[0] = new CONFIG.Dice.daggerheart.DualityDie(); + } + this.terms[0] = new CONFIG.Dice.daggerheart.DualityDie(); this.terms[1] = new foundry.dice.terms.OperatorTerm({ operator: '+' }); - if (!(this.dice[2] instanceof CONFIG.Dice.daggerheart.DualityDie)) - this.terms[2] = new CONFIG.Dice.daggerheart.DualityDie(); + this.terms[2] = new CONFIG.Dice.daggerheart.DualityDie(); } applyAdvantage() { - const dieFaces = 6, + const dieFaces = this.advantageFaces, bardRallyFaces = this.hasBarRally, advDie = new foundry.dice.terms.Die({ faces: dieFaces }); - if (this.hasAdvantage || this.hasDisadvantage || bardRallyFaces) - this.terms.push(new foundry.dice.terms.OperatorTerm({ operator: this.hasDisadvantage ? '-' : '+' })); + if (this.hasAdvantage || this.hasDisadvantage || bardRallyFaces) this.terms.push(new foundry.dice.terms.OperatorTerm({ operator: this.hasDisadvantage ? '-' : '+' })); if (bardRallyFaces) { const rallyDie = new foundry.dice.terms.Die({ faces: bardRallyFaces }); if (this.hasAdvantage) { @@ -372,12 +401,14 @@ export class DualityRoll extends D20Roll { } applyBaseBonus() { - this.options.roll.modifiers = [ + this.options.roll.modifiers = []; + if(!this.options.roll.trait) return; + this.options.roll.modifiers.push( { label: `DAGGERHEART.Abilities.${this.options.roll.trait}.name`, value: Roll.replaceFormulaData(`@traits.${this.options.roll.trait}.total`, this.data) } - ]; + ); } static postEvaluate(roll, config = {}) { diff --git a/module/applications/rollSelectionDialog.mjs b/module/applications/rollSelectionDialog.mjs index 0a1972aa..fbc77d2b 100644 --- a/module/applications/rollSelectionDialog.mjs +++ b/module/applications/rollSelectionDialog.mjs @@ -1,3 +1,5 @@ +/** NOT USED ANYMORE - TO BE DELETED **/ + const { ApplicationV2, HandlebarsApplicationMixin } = foundry.applications.api; export default class RollSelectionDialog extends HandlebarsApplicationMixin(ApplicationV2) { diff --git a/module/applications/sheets/actors/adversary.mjs b/module/applications/sheets/actors/adversary.mjs index a588ba0f..e2f5c978 100644 --- a/module/applications/sheets/actors/adversary.mjs +++ b/module/applications/sheets/actors/adversary.mjs @@ -87,7 +87,7 @@ export default class AdversarySheet extends DaggerheartSheet(ActorSheetV2) { event: event, title: `${this.actor.name} - Reaction Roll`, roll: { - modifier: null, + // modifier: null, type: 'reaction' }, chatMessage: { diff --git a/module/applications/sheets/applications/adversary-settings.mjs b/module/applications/sheets/applications/adversary-settings.mjs index 2ecdcb60..cc18d7f6 100644 --- a/module/applications/sheets/applications/adversary-settings.mjs +++ b/module/applications/sheets/applications/adversary-settings.mjs @@ -103,6 +103,7 @@ export default class DHAdversarySettings extends HandlebarsApplicationMixin(Appl context.systemFields = this.actor.system.schema.fields; context.systemFields.attack.fields = this.actor.system.attack.schema.fields; context.isNPC = true; + console.log(context) return context; } diff --git a/module/config/actionConfig.mjs b/module/config/actionConfig.mjs index 6506e485..e83040f5 100644 --- a/module/config/actionConfig.mjs +++ b/module/config/actionConfig.mjs @@ -105,3 +105,18 @@ export const diceCompare = { operator: '>' } }; + +export const advandtageState = { + disadvantage: { + label: 'DAGGERHEART.General.Disadvantage.Full', + value: -1 + }, + neutral: { + label: 'DAGGERHEART.General.Neutral.Full', + value: 0 + }, + advantage: { + label: 'DAGGERHEART.General.Advantage.Full', + value: 1 + } +} diff --git a/module/data/action/action.mjs b/module/data/action/action.mjs index af5e061e..33b7280a 100644 --- a/module/data/action/action.mjs +++ b/module/data/action/action.mjs @@ -1,4 +1,3 @@ -import CostSelectionDialog from '../../applications/costSelectionDialog.mjs'; import { DHActionDiceData, DHActionRollData, DHDamageData, DHDamageField } from './actionDice.mjs'; import DhpActor from '../../documents/actor.mjs'; import D20RollDialog from '../../dialogs/d20RollDialog.mjs'; @@ -343,7 +342,9 @@ export class DHBaseAction extends foundry.abstract.DataModel { label: 'Attack', type: this.actionType, difficulty: this.roll?.difficulty, - formula: this.roll.getFormula() + formula: this.roll.getFormula(), + bonus: this.roll.bonus, + advantage: SYSTEM.ACTIONS.advandtageState[this.roll.advState].value }; if (this.roll?.type === 'diceSet') roll.lite = true; @@ -372,7 +373,7 @@ export class DHBaseAction extends foundry.abstract.DataModel { /* ROLL */ get hasRoll() { - return !!this.roll?.type; + return !!this.roll?.type || !!this.roll?.bonus; } /* ROLL */ diff --git a/module/data/action/actionDice.mjs b/module/data/action/actionDice.mjs index 8a6aa12a..adf00461 100644 --- a/module/data/action/actionDice.mjs +++ b/module/data/action/actionDice.mjs @@ -11,7 +11,8 @@ export class DHActionRollData extends foundry.abstract.DataModel { type: new fields.StringField({ nullable: true, initial: null, choices: SYSTEM.GENERAL.rollTypes }), trait: new fields.StringField({ nullable: true, initial: null, choices: SYSTEM.ACTOR.abilities }), difficulty: new fields.NumberField({ nullable: true, initial: null, integer: true, min: 0 }), - bonus: new fields.NumberField({ nullable: true, initial: null, integer: true, min: 0 }), + bonus: new fields.NumberField({ nullable: true, initial: null, integer: true }), + advState: new fields.StringField({ choices: SYSTEM.ACTIONS.advandtageState, initial: 'neutral' }), diceRolling: new fields.SchemaField({ multiplier: new fields.StringField({ choices: SYSTEM.GENERAL.diceSetNumbers, @@ -62,7 +63,7 @@ export class DHActionDiceData extends foundry.abstract.DataModel { label: 'Multiplier' }), flatMultiplier: new fields.NumberField({ nullable: true, initial: 1, label: 'Flat Multiplier' }), - dice: new fields.StringField({ choices: SYSTEM.GENERAL.diceTypes, initial: 'd6', label: 'Formula' }), + dice: new fields.StringField({ choices: SYSTEM.GENERAL.diceTypes, initial: 'd6', label: 'Dice' }), bonus: new fields.NumberField({ nullable: true, initial: null, label: 'Bonus' }), custom: new fields.SchemaField({ enabled: new fields.BooleanField({ label: 'Custom Formula' }), diff --git a/module/data/fields/actionField.mjs b/module/data/fields/actionField.mjs index da520fd1..3628bbae 100644 --- a/module/data/fields/actionField.mjs +++ b/module/data/fields/actionField.mjs @@ -1,9 +1,9 @@ -import { actionsTypes } from '../action/_module.mjs'; +// import { actionsTypes } from '../action/_module.mjs'; // Temporary Solution export default class ActionField extends foundry.data.fields.ObjectField { getModel(value) { - return actionsTypes[value.type] ?? actionsTypes.attack; + return game.system.api.models.actionsTypes[value.type] ?? game.system.api.models.actionsTypes.attack; } /* -------------------------------------------- */ diff --git a/module/data/item/base.mjs b/module/data/item/base.mjs index 735c6588..4d41d731 100644 --- a/module/data/item/base.mjs +++ b/module/data/item/base.mjs @@ -1,4 +1,4 @@ -import { actionsTypes } from '../action/_module.mjs'; +// import { actionsTypes } from '../action/_module.mjs'; /** * Describes metadata about the item data model type @@ -60,7 +60,8 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel { const actionType = { weapon: 'attack' }[this.constructor.metadata.type], - cls = actionsTypes.attack, + cls = game.system.api.models.actionsTypes[actionType], + // cls = actionsTypes.attack, action = new cls( { _id: foundry.utils.randomID(), diff --git a/module/dialogs/d20RollDialog.mjs b/module/dialogs/d20RollDialog.mjs index 7c4fd06b..b21e79df 100644 --- a/module/dialogs/d20RollDialog.mjs +++ b/module/dialogs/d20RollDialog.mjs @@ -9,7 +9,8 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio this.config.experiences = []; if (config.source?.action) { - this.item = config.data.parent.items.get(config.source.item); + console.log(config) + this.item = config.data.parent.items.get(config.source.item) ?? config.data.parent; this.action = config.data.attack?._id == config.source.action ? config.data.attack @@ -50,15 +51,18 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio }; async _prepareContext(_options) { + console.log(this.config, this.roll) const context = await super._prepareContext(_options); context.hasRoll = !!this.config.roll; + context.roll = this.roll; + context.rollType = this.roll?.constructor.name; context.experiences = Object.keys(this.config.data.experiences).map(id => ({ id, ...this.config.data.experiences[id] })); context.selectedExperiences = this.config.experiences; - context.advantage = this.config.advantage; - /* context.diceOptions = this.diceOptions; */ + context.advantage = this.config.roll?.advantage; + context.diceOptions = SYSTEM.GENERAL.diceTypes; context.canRoll = true; context.isLite = this.config.roll?.lite; if (this.config.costs?.length) { @@ -71,7 +75,9 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio context.uses = this.action.calcUses(this.config.uses); context.canRoll = context.canRoll && this.action.hasUses(context.uses); } + context.extraFormula = this.config.extraFormula; context.formula = this.roll.constructFormula(this.config); + return context; } @@ -81,12 +87,18 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio this.config.costs = foundry.utils.mergeObject(this.config.costs, rest.costs); } if (this.config.uses) this.config.uses = foundry.utils.mergeObject(this.config.uses, rest.uses); + if(rest.roll?.dice) { + Object.entries(rest.roll.dice).forEach(([key, value]) => { + this.roll[key] = value; + }) + } + this.config.extraFormula = rest.extraFormula; this.render(); } static updateIsAdvantage(_, button) { const advantage = Number(button.dataset.advantage); - this.config.advantage = this.config.advantage === advantage ? 0 : advantage; + this.config.roll.advantage = this.config.roll.advantage === advantage ? 0 : advantage; this.render(); } diff --git a/module/dialogs/damageDialog.mjs b/module/dialogs/damageDialog.mjs index b94c2aab..4882475d 100644 --- a/module/dialogs/damageDialog.mjs +++ b/module/dialogs/damageDialog.mjs @@ -37,10 +37,17 @@ export default class DamageDialog extends HandlebarsApplicationMixin(Application async _prepareContext(_options) { const context = await super._prepareContext(_options); context.title = this.config.title; - context.formula = this.config.roll.formula; + context.extraFormula = this.config.extraFormula; + context.formula = this.roll.constructFormula(this.config);; return context; } + static updateRollConfiguration(event, _, formData) { + const { ...rest } = foundry.utils.expandObject(formData.object); + this.config.extraFormula = rest.extraFormula; + this.render(); + } + static async submitRoll() { await this.close({ submitted: true }); } diff --git a/styles/chat.less b/styles/chat.less index 77aa892b..c0e45af4 100644 --- a/styles/chat.less +++ b/styles/chat.less @@ -493,16 +493,18 @@ fieldset.daggerheart.chat { align-items: end; gap: 0.25rem; .dice { - .dice-rolls.duality { + .dice-rolls { margin-bottom: 0; - li { - display: flex; - align-items: center; - justify-content: center; - position: relative; - background: unset; - line-height: unset; - font-weight: unset; + &.duality { + li { + display: flex; + align-items: center; + justify-content: center; + position: relative; + background: unset; + line-height: unset; + font-weight: unset; + } } } } diff --git a/styles/daggerheart.css b/styles/daggerheart.css index 062dd5a3..dc9cdabb 100755 --- a/styles/daggerheart.css +++ b/styles/daggerheart.css @@ -1786,7 +1786,7 @@ fieldset.daggerheart.chat .daggerheart.chat { align-items: end; gap: 0.25rem; } -.theme-colorful .chat-message.duality .message-content .dice-result .dice-tooltip .wrapper .tooltip-part .dice .dice-rolls.duality { +.theme-colorful .chat-message.duality .message-content .dice-result .dice-tooltip .wrapper .tooltip-part .dice .dice-rolls { margin-bottom: 0; } .theme-colorful .chat-message.duality .message-content .dice-result .dice-tooltip .wrapper .tooltip-part .dice .dice-rolls.duality li { @@ -5376,6 +5376,18 @@ div.daggerheart.views.multiclass { display: flex; gap: 20px; } +.application.dh-style fieldset.flex.wrap { + flex-wrap: wrap; + gap: 10px 20px; +} +.application.dh-style fieldset.flex .inline-child { + flex: 1; +} +.application.dh-style fieldset.flex .checkbox { + display: flex; + align-items: center; + gap: 20px; +} .application.dh-style fieldset.one-column { display: flex; flex-direction: column; diff --git a/styles/less/global/elements.less b/styles/less/global/elements.less index 9caa12c6..1f6e5988 100755 --- a/styles/less/global/elements.less +++ b/styles/less/global/elements.less @@ -119,6 +119,18 @@ &.flex { display: flex; gap: 20px; + &.wrap { + flex-wrap: wrap; + gap: 10px 20px; + } + .inline-child { + flex: 1; + } + .checkbox { + display: flex; + align-items: center; + gap: 20px; + } } &.one-column { diff --git a/templates/chat/adversary-roll.hbs b/templates/chat/adversary-roll.hbs index 7794d683..0004e586 100644 --- a/templates/chat/adversary-roll.hbs +++ b/templates/chat/adversary-roll.hbs @@ -6,7 +6,7 @@
    - {{#each roll.dice}} + {{#each roll.dice as | dice index |}}
    {{formula}} {{total}} @@ -17,9 +17,11 @@
  • {{result}}
  • {{/each}} + {{#if (eq index 0)}}
    {{#if (eq ../roll.advantage.type 1)}}{{localize "DAGGERHEART.General.Advantage.Full"}}{{/if}}{{#if (eq ../roll.advantage.type -1)}}{{localize "DAGGERHEART.General.Disadvantage.Full"}}{{/if}}
    + {{/if}}
    {{/each}}
    diff --git a/templates/chat/duality-roll.hbs b/templates/chat/duality-roll.hbs index 65ec1676..9a530649 100644 --- a/templates/chat/duality-roll.hbs +++ b/templates/chat/duality-roll.hbs @@ -82,6 +82,30 @@ {{/if}} + {{#each roll.extra as | extra | }} +
    +
    + + 1{{extra.dice}} + + {{extra.value}} +
    +
    +
      +
    1. +
      +
      +
      + +
      +
      {{extra.value}}
      +
      +
      +
    2. +
    +
    +
    + {{/each}} {{#if roll.modifierTotal}}
    {{#if (gt roll.modifierTotal 0)}}+{{/if}}{{roll.modifierTotal}}
    {{/if}} diff --git a/templates/sheets/applications/adversary-settings/attack.hbs b/templates/sheets/applications/adversary-settings/attack.hbs index cb11d46f..d731e5f6 100644 --- a/templates/sheets/applications/adversary-settings/attack.hbs +++ b/templates/sheets/applications/adversary-settings/attack.hbs @@ -1,22 +1,22 @@
    - {{localize 'DAGGERHEART.General.basics'}} - {{formGroup systemFields.attack.fields.img value=document.img label="Image Path" name="system.attack.img"}} + {{localize "DAGGERHEART.General.basics"}} + {{formGroup systemFields.attack.fields.img value=document.system.attack.img label="Image Path" name="system.attack.img"}} {{formGroup systemFields.attack.fields.name value=document.system.attack.name label="Attack Name" name="system.attack.name"}}
    {{localize "DAGGERHEART.Sheets.Adversary.Attack"}} {{formField systemFields.attack.fields.roll.fields.bonus value=document.system.attack.roll.bonus label="Attack Bonus" name="system.attack.roll.bonus"}} - {{formField systemFields.attack.fields.range value=document.system.attack.range label="Range" name=(concat path "range") localize=true}} + {{formField systemFields.attack.fields.range value=document.system.attack.range label="Range" name="system.attack.range" localize=true}} {{#if systemFields.attack.fields.target.fields}} - {{#if (and document.system.target.type (not (eq document.system.target.type 'self')))}} - {{ formField systemFields.attack.fields.target.fields.amount value=document.system.target.amount label="Amount" name=(concat path "target.amount") }} + {{ formField systemFields.attack.fields.target.fields.type value=document.system.attack.target.type label="Target" name="system.attack.target.type" localize=true }} + {{#if (and document.system.attack.target.type (not (eq document.system.attack.target.type 'self')))}} + {{ formField systemFields.attack.fields.target.fields.amount value=document.system.attack.target.amount label="Amount" name="system.attack.target.amount" }} {{/if}} - {{ formField systemFields.attack.fields.target.fields.type value=document.system.target.type label="Target" name=(concat path "target.type") localize=true }} {{/if}}
    {{> 'systems/daggerheart/templates/views/actionTypes/damage.hbs' fields=systemFields.attack.fields.damage.fields.parts.element.fields source=document.system.attack.damage path="system.attack."}} diff --git a/templates/views/action.hbs b/templates/views/action.hbs index 45373815..9a3a25b4 100644 --- a/templates/views/action.hbs +++ b/templates/views/action.hbs @@ -33,10 +33,8 @@
    - {{#unless isNPC}} {{> 'systems/daggerheart/templates/views/actionTypes/uses.hbs' fields=fields.uses.fields source=source.uses}} {{> 'systems/daggerheart/templates/views/actionTypes/cost.hbs' fields=fields.cost.element.fields source=source.cost}} - {{/unless}} {{#if fields.target}}{{> 'systems/daggerheart/templates/views/actionTypes/range-target.hbs' fields=(object range=fields.range target=fields.target.fields) source=(object target=source.target range=source.range)}}{{/if}}
    diff --git a/templates/views/actionTypes/damage.hbs b/templates/views/actionTypes/damage.hbs index 54fdb6b1..01dc533a 100644 --- a/templates/views/actionTypes/damage.hbs +++ b/templates/views/actionTypes/damage.hbs @@ -1,61 +1,57 @@ -
    - -
    Damage
    -
    -
    - {{#unless @root.isNPC}} -
    - {{#if @root.hasBaseDamage}} -
    - {{formField @root.fields.damage.fields.includeBase value=@root.source.damage.includeBase label="Include Item Damage" name="damage.includeBase" }} -
    - {{/if}} - {{/unless}} - {{#each source.parts as |dmg index|}} - {{#if @root.isNPC}} - {{formField ../fields.value.fields.custom.fields.enabled value=dmg.value.custom.enabled name=(concat ../path "damage.parts." index ".value.custom.enabled")}} - - {{#if dmg.value.custom.enabled}} - {{formField ../fields.value.fields.custom.fields.formula value=dmg.value.custom.formula name=(concat ../path "damage.parts." index ".value.custom.formula") localize=true}} - {{else}} -
    - {{formField ../fields.value.fields.flatMultiplier value=dmg.value.flatMultiplier name=(concat ../path "damage.parts." index ".value.flatMultiplier") label="Multiplier" }} - {{formField ../fields.value.fields.dice value=dmg.value.dice name=(concat ../path "damage.parts." index ".value.dice")}} - {{formField ../fields.value.fields.bonus value=dmg.value.bonus name=(concat ../path "damage.parts." index ".value.bonus") localize=true}} -
    - {{/if}} - {{formField ../fields.type value=dmg.type name=(concat ../path "damage.parts." index ".type") localize=true}} +
    + Damage + {{#unless (eq path 'system.attack.')}} +
    + {{/unless}} + {{#unless @root.isNPC}} + {{#if @root.hasBaseDamage}} +
    + {{formField @root.fields.damage.fields.includeBase value=@root.source.damage.includeBase label="Include Item Damage" name="damage.includeBase" }} +
    + {{/if}} + {{/unless}} + {{#each source.parts as |dmg index|}} + {{#if @root.isNPC}} + {{formField ../fields.value.fields.custom.fields.enabled value=dmg.value.custom.enabled name=(concat ../path "damage.parts." index ".value.custom.enabled") classes="checkbox"}} + + {{#if dmg.value.custom.enabled}} + {{formField ../fields.value.fields.custom.fields.formula value=dmg.value.custom.formula name=(concat ../path "damage.parts." index ".value.custom.formula") localize=true}} {{else}} - {{#with (@root.getRealIndex index) as | realIndex |}} - - {{#if (and (not @root.isNPC) @root.hasRoll (not dmg.base))}} - {{formField ../../fields.resultBased value=dmg.resultBased name=(concat "damage.parts." realIndex ".resultBased") localize=true}} - {{/if}} - {{#if (and (not @root.isNPC) @root.hasRoll (not dmg.base) dmg.resultBased)}} -
    - -
    With Hope
    -
    - {{> formula fields=../../fields.value.fields type=../../fields.type dmg=dmg source=dmg.value target="value" realIndex=realIndex}} -
    -
    - -
    With Fear
    -
    - {{> formula fields=../../fields.valueAlt.fields type=../../fields.type dmg=dmg source=dmg.valueAlt target="valueAlt" realIndex=realIndex}} -
    - {{else}} - {{> formula fields=../../fields.value.fields type=../fields.type dmg=dmg source=dmg.value target="value" realIndex=realIndex}} - {{/if}} - {{formField ../../fields.type value=dmg.type name=(concat "damage.parts." realIndex ".type") localize=true}} - - {{#unless dmg.base}}
    {{/unless}} -
    - {{/with}} + {{formField ../fields.value.fields.flatMultiplier value=dmg.value.flatMultiplier name=(concat ../path "damage.parts." index ".value.flatMultiplier") label="Multiplier" classes="inline-child" }} + {{formField ../fields.value.fields.dice value=dmg.value.dice name=(concat ../path "damage.parts." index ".value.dice") classes="inline-child"}} + {{formField ../fields.value.fields.bonus value=dmg.value.bonus name=(concat ../path "damage.parts." index ".value.bonus") localize=true classes="inline-child"}} {{/if}} - {{/each}} -
    + {{formField ../fields.type value=dmg.type name=(concat ../path "damage.parts." index ".type") localize=true}} + {{else}} + {{#with (@root.getRealIndex index) as | realIndex |}} + + {{#if (and (not @root.isNPC) @root.hasRoll (not dmg.base))}} + {{formField ../../fields.resultBased value=dmg.resultBased name=(concat "damage.parts." realIndex ".resultBased") localize=true}} + {{/if}} + {{#if (and (not @root.isNPC) @root.hasRoll (not dmg.base) dmg.resultBased)}} +
    + +
    With Hope
    +
    + {{> formula fields=../../fields.value.fields type=../../fields.type dmg=dmg source=dmg.value target="value" realIndex=realIndex}} +
    +
    + +
    With Fear
    +
    + {{> formula fields=../../fields.valueAlt.fields type=../../fields.type dmg=dmg source=dmg.valueAlt target="valueAlt" realIndex=realIndex}} +
    + {{else}} + {{> formula fields=../../fields.value.fields type=../fields.type dmg=dmg source=dmg.value target="value" realIndex=realIndex}} + {{/if}} + {{formField ../../fields.type value=dmg.type name=(concat "damage.parts." realIndex ".type") localize=true}} + + {{#unless dmg.base}}
    {{/unless}} +
    + {{/with}} + {{/if}} + {{/each}} {{#*inline "formula"}} diff --git a/templates/views/actionTypes/roll.hbs b/templates/views/actionTypes/roll.hbs index c4a7387c..cfc79670 100644 --- a/templates/views/actionTypes/roll.hbs +++ b/templates/views/actionTypes/roll.hbs @@ -24,5 +24,8 @@
    {{/if}} {{/if}} + {{#unless (eq source.type "diceSet")}} + {{formField fields.advState label= "Advantage State" name="roll.advState" value=source.advState localize=true}} + {{/unless}} \ No newline at end of file diff --git a/templates/views/damageSelection.hbs b/templates/views/damageSelection.hbs index b7c61443..988b852e 100644 --- a/templates/views/damageSelection.hbs +++ b/templates/views/damageSelection.hbs @@ -2,7 +2,11 @@
    - + {{!-- --}} +
    {{@root.formula}}
    +
    +
    +
    {{!-- {{#each bonusDamage as |damage index|}} diff --git a/templates/views/rollSelection.hbs b/templates/views/rollSelection.hbs index c3728ccc..98b6c91b 100644 --- a/templates/views/rollSelection.hbs +++ b/templates/views/rollSelection.hbs @@ -2,25 +2,58 @@ {{#if @root.hasRoll}}
    - {{#unless @root.isLite}} -
    - {{#each experiences}} - {{#if name}} -
    - {{name}} - +{{value}} -
    - {{/if}} - {{/each}} -
    -
    - - -
    - {{/unless}}
    - + {{!-- --}} +
    {{@root.formula}}
    + {{#unless @root.isLite}} +
    + {{#each experiences}} + {{#if name}} +
    + {{name}} + +{{value}} +
    + {{/if}} + {{/each}} +
    +
    + + +
    + {{#if (eq @root.rollType 'D20Roll')}} +
    + +
    + {{/if}} + {{#if (eq @root.rollType 'DualityRoll')}} +
    +
    Hope Dice
    + +
    +
    +
    Fear Dice
    + +
    + {{#if roll.advantage}} +
    +
    Adv/Disadv Dice
    + +
    + {{/if}} + {{/if}} +
    + +
    + {{/unless}} {{!-- {{#if (not isNpc)}} --}} {{!--
    From ee8a48f73d42b32d61952e7af4058c5b594d6bb8 Mon Sep 17 00:00:00 2001 From: WBHarry <89362246+WBHarry@users.noreply.github.com> Date: Wed, 2 Jul 2025 23:21:02 +0200 Subject: [PATCH 6/6] Added DhTooltipManager aswell as placeholder rendering for Armor/Weapon/DomainCard (#245) --- daggerheart.mjs | 1 + module/applications/_module.mjs | 1 + module/applications/tooltipManager.mjs | 16 ++++++++++++++++ .../sheets/global/partials/inventory-item.hbs | 2 +- templates/tooltip/armor.hbs | 5 +++++ templates/tooltip/domainCard.hbs | 5 +++++ templates/tooltip/weapon.hbs | 5 +++++ 7 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 module/applications/tooltipManager.mjs create mode 100644 templates/tooltip/armor.hbs create mode 100644 templates/tooltip/domainCard.hbs create mode 100644 templates/tooltip/weapon.hbs diff --git a/daggerheart.mjs b/daggerheart.mjs index dbe5aa21..2415c857 100644 --- a/daggerheart.mjs +++ b/daggerheart.mjs @@ -124,6 +124,7 @@ Hooks.once('init', () => { CONFIG.ui.resources = Resources; CONFIG.ux.ContextMenu = applications.DhContextMenu; + CONFIG.ux.TooltipManager = applications.DhTooltipManager; game.socket.on(`system.${SYSTEM.id}`, handleSocketEvent); diff --git a/module/applications/_module.mjs b/module/applications/_module.mjs index a74cb8cf..1a769052 100644 --- a/module/applications/_module.mjs +++ b/module/applications/_module.mjs @@ -15,5 +15,6 @@ export { default as DhpChatMessage } from './chatMessage.mjs'; export { default as DhpEnvironment } from './sheets/actors/environment.mjs'; export { default as DhActiveEffectConfig } from './sheets/activeEffectConfig.mjs'; export { default as DhContextMenu } from './contextMenu.mjs'; +export { default as DhTooltipManager } from './tooltipManager.mjs'; export * as api from './sheets/api/_modules.mjs'; diff --git a/module/applications/tooltipManager.mjs b/module/applications/tooltipManager.mjs new file mode 100644 index 00000000..d7d3117c --- /dev/null +++ b/module/applications/tooltipManager.mjs @@ -0,0 +1,16 @@ +export default class DhTooltipManager extends TooltipManager { + async activate(element, options = {}) { + let html = options.html; + if (element.dataset.tooltip.startsWith('#item#')) { + const item = await foundry.utils.fromUuid(element.dataset.tooltip.slice(6)); + if (item) { + html = await foundry.applications.handlebars.renderTemplate( + `systems/daggerheart/templates/tooltip/${item.type}.hbs`, + item + ); + } + } + + super.activate(element, { ...options, html: html }); + } +} diff --git a/templates/sheets/global/partials/inventory-item.hbs b/templates/sheets/global/partials/inventory-item.hbs index 491829d1..7c91f032 100644 --- a/templates/sheets/global/partials/inventory-item.hbs +++ b/templates/sheets/global/partials/inventory-item.hbs @@ -1,4 +1,4 @@ -
  • +
  • {{item.name}}
    diff --git a/templates/tooltip/armor.hbs b/templates/tooltip/armor.hbs new file mode 100644 index 00000000..c2972700 --- /dev/null +++ b/templates/tooltip/armor.hbs @@ -0,0 +1,5 @@ +
    +
    {{name}}
    + +
    {{{system.description}}}
    +
    \ No newline at end of file diff --git a/templates/tooltip/domainCard.hbs b/templates/tooltip/domainCard.hbs new file mode 100644 index 00000000..c2972700 --- /dev/null +++ b/templates/tooltip/domainCard.hbs @@ -0,0 +1,5 @@ +
    +
    {{name}}
    + +
    {{{system.description}}}
    +
    \ No newline at end of file diff --git a/templates/tooltip/weapon.hbs b/templates/tooltip/weapon.hbs new file mode 100644 index 00000000..c2972700 --- /dev/null +++ b/templates/tooltip/weapon.hbs @@ -0,0 +1,5 @@ +
    +
    {{name}}
    + +
    {{{system.description}}}
    +
    \ No newline at end of file