From 502ac1cca597976859863d60540ff097913e87cb Mon Sep 17 00:00:00 2001 From: moliloo Date: Thu, 3 Jul 2025 01:32:05 -0300 Subject: [PATCH] new companion sheet templates --- module/applications/_module.mjs | 2 +- .../sheets/{ => actors}/companion.mjs | 40 ++- .../applications/companion-settings.mjs | 122 +++++++++ module/helpers/handlebarsHelper.mjs | 7 +- styles/daggerheart.css | 242 +++++++++++++++++- styles/daggerheart.less | 2 + styles/less/actors/companion/details.less | 63 +++++ styles/less/actors/companion/header.less | 197 ++++++++++++++ styles/less/actors/companion/sheet.less | 21 +- styles/less/global/elements.less | 12 + templates/sheets/actors/companion/details.hbs | 39 +++ templates/sheets/actors/companion/effects.hbs | 8 + templates/sheets/actors/companion/header.hbs | 46 ++++ .../companion-settings/attack.hbs | 22 ++ .../companion-settings/details.hbs | 23 ++ .../companion-settings/experiences.hbs | 18 ++ .../companion-settings/header.hbs | 3 + .../sheets/global/partials/inventory-item.hbs | 11 +- 18 files changed, 857 insertions(+), 21 deletions(-) rename module/applications/sheets/{ => actors}/companion.mjs (66%) create mode 100644 module/applications/sheets/applications/companion-settings.mjs create mode 100644 styles/less/actors/companion/details.less create mode 100644 styles/less/actors/companion/header.less create mode 100644 templates/sheets/actors/companion/details.hbs create mode 100644 templates/sheets/actors/companion/effects.hbs create mode 100644 templates/sheets/actors/companion/header.hbs create mode 100644 templates/sheets/applications/companion-settings/attack.hbs create mode 100644 templates/sheets/applications/companion-settings/details.hbs create mode 100644 templates/sheets/applications/companion-settings/experiences.hbs create mode 100644 templates/sheets/applications/companion-settings/header.hbs diff --git a/module/applications/_module.mjs b/module/applications/_module.mjs index 1a769052..e21c7014 100644 --- a/module/applications/_module.mjs +++ b/module/applications/_module.mjs @@ -1,6 +1,6 @@ export { default as DhCharacterSheet } from './sheets/actors/character.mjs'; export { default as DhpAdversarySheet } from './sheets/actors/adversary.mjs'; -export { default as DhCompanionSheet } from './sheets/companion.mjs'; +export { default as DhCompanionSheet } from './sheets/actors/companion.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/companion.mjs b/module/applications/sheets/actors/companion.mjs similarity index 66% rename from module/applications/sheets/companion.mjs rename to module/applications/sheets/actors/companion.mjs index 46080814..35e9a103 100644 --- a/module/applications/sheets/companion.mjs +++ b/module/applications/sheets/actors/companion.mjs @@ -1,16 +1,18 @@ -import { GMUpdateEvent, socketEvent } from '../../helpers/socket.mjs'; -import DhCompanionlevelUp from '../levelup/companionLevelup.mjs'; -import DaggerheartSheet from './daggerheart-sheet.mjs'; +import { GMUpdateEvent, socketEvent } from '../../../helpers/socket.mjs'; +import DhCompanionlevelUp from '../../levelup/companionLevelup.mjs'; +import DaggerheartSheet from '../daggerheart-sheet.mjs'; +import DHCompanionSettings from '../applications/companion-settings.mjs'; const { ActorSheetV2 } = foundry.applications.sheets; export default class DhCompanionSheet extends DaggerheartSheet(ActorSheetV2) { static DEFAULT_OPTIONS = { tag: 'form', classes: ['daggerheart', 'sheet', 'actor', 'dh-style', 'companion'], - position: { width: 700, height: 1000 }, + position: { width: 300 }, actions: { attackRoll: this.attackRoll, - levelUp: this.levelUp + levelUp: this.levelUp, + openSettings: this.openSettings }, form: { handler: this.updateForm, @@ -20,7 +22,28 @@ export default class DhCompanionSheet extends DaggerheartSheet(ActorSheetV2) { }; static PARTS = { - sidebar: { template: 'systems/daggerheart/templates/sheets/actors/companion/tempMain.hbs' } + header: { template: 'systems/daggerheart/templates/sheets/actors/companion/header.hbs' }, + details: { template: 'systems/daggerheart/templates/sheets/actors/companion/details.hbs' }, + effects: { template: 'systems/daggerheart/templates/sheets/actors/companion/effects.hbs' } + }; + + static TABS = { + details: { + active: true, + cssClass: '', + group: 'primary', + id: 'details', + icon: null, + label: 'DAGGERHEART.General.tabs.details' + }, + effects: { + active: false, + cssClass: '', + group: 'primary', + id: 'effects', + icon: null, + label: 'DAGGERHEART.Sheets.PC.Tabs.effects' + } }; _attachPartListeners(partId, htmlElement, options) { @@ -32,6 +55,7 @@ export default class DhCompanionSheet extends DaggerheartSheet(ActorSheetV2) { async _prepareContext(_options) { const context = await super._prepareContext(_options); context.document = this.document; + context.tabs = super._getTabs(this.constructor.TABS); context.playerCharacters = game.actors .filter( x => @@ -80,6 +104,10 @@ export default class DhCompanionSheet extends DaggerheartSheet(ActorSheetV2) { this.actor.system.attack.use(event); } + static async openSettings() { + await new DHCompanionSettings(this.document).render(true); + } + static async levelUp() { new DhCompanionlevelUp(this.document).render(true); } diff --git a/module/applications/sheets/applications/companion-settings.mjs b/module/applications/sheets/applications/companion-settings.mjs new file mode 100644 index 00000000..053dfbb0 --- /dev/null +++ b/module/applications/sheets/applications/companion-settings.mjs @@ -0,0 +1,122 @@ +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 DHCompanionSettings 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', 'companion-settings'], + window: { + icon: 'fa-solid fa-wrench', + resizable: false + }, + position: { width: 455, height: 'auto' }, + actions: {}, + form: { + handler: this.updateForm, + submitOnChange: true, + closeOnSubmit: false + } + }; + + static PARTS = { + header: { + id: 'header', + template: 'systems/daggerheart/templates/sheets/applications/companion-settings/header.hbs' + }, + tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' }, + details: { + id: 'details', + template: 'systems/daggerheart/templates/sheets/applications/companion-settings/details.hbs' + }, + experiences: { + id: 'experiences', + template: 'systems/daggerheart/templates/sheets/applications/companion-settings/experiences.hbs' + }, + attack: { + id: 'attack', + template: 'systems/daggerheart/templates/sheets/applications/companion-settings/attack.hbs' + } + }; + + static TABS = { + details: { + active: true, + cssClass: '', + group: 'primary', + id: 'details', + icon: null, + label: 'DAGGERHEART.General.tabs.details' + }, + experiences: { + active: false, + cssClass: '', + group: 'primary', + id: 'experiences', + icon: null, + label: 'DAGGERHEART.General.tabs.experiences' + }, + attack: { + active: false, + cssClass: '', + group: 'primary', + id: 'attack', + icon: null, + label: 'DAGGERHEART.General.tabs.attack' + } + }; + + 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; + context.playerCharacters = game.actors + .filter( + x => + x.type === 'character' && + (x.ownership.default === 3 || + x.ownership[game.user.id] === 3 || + this.document.system.partner?.uuid === x.uuid) + ) + .map(x => ({ key: x.uuid, name: x.name })); + + 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; + } + + async viewActor(_, button) { + const target = button.closest('[data-item-uuid]'); + const actor = await foundry.utils.fromUuid(target.dataset.itemUuid); + if (!actor) return; + + actor.sheet.render(true); + } + + static async updateForm(event, _, formData) { + await this.actor.update(formData.object); + this.render(); + } +} diff --git a/module/helpers/handlebarsHelper.mjs b/module/helpers/handlebarsHelper.mjs index 6200b690..4c0800f2 100644 --- a/module/helpers/handlebarsHelper.mjs +++ b/module/helpers/handlebarsHelper.mjs @@ -21,7 +21,8 @@ export default class RegisterHandlebarsHelpers { lte: this.lte, gte: this.gte, and: this.and, - or: this.or + or: this.or, + getActor: this.getActor }); } @@ -137,4 +138,8 @@ export default class RegisterHandlebarsHelpers { console.log(a); return a; } + + static getActor(actorUuid) { + return fromUuid(actorUuid); + } } diff --git a/styles/daggerheart.css b/styles/daggerheart.css index 4d8546b1..28666a18 100755 --- a/styles/daggerheart.css +++ b/styles/daggerheart.css @@ -4985,13 +4985,235 @@ div.daggerheart.views.multiclass { color: light-dark(#18162e50, #efe6d850); font-family: 'Montserrat', sans-serif; } -.application.sheet.daggerheart.actor.dh-style.companion .profile { - height: 80px; - width: 80px; +.application.sheet.daggerheart.actor.dh-style.companion .companion-header-sheet { + display: flex; + flex-direction: column; + align-items: center; + gap: 8px; } -.application.sheet.daggerheart.actor.dh-style.companion .temp-container { +.application.sheet.daggerheart.actor.dh-style.companion .companion-header-sheet .profile { + height: 235px; + width: 100%; + object-fit: cover; + cursor: pointer; + mask-image: linear-gradient(0deg, transparent 0%, black 10%); +} +.application.sheet.daggerheart.actor.dh-style.companion .companion-header-sheet .actor-name { + display: flex; + align-items: center; position: relative; - top: 32px; + top: -30px; + gap: 20px; + padding: 0 20px; + margin-bottom: -30px; +} +.application.sheet.daggerheart.actor.dh-style.companion .companion-header-sheet .actor-name input[type='text'] { + font-size: 24px; + height: 32px; + text-align: center; + border: 1px solid transparent; + outline: 2px solid transparent; + transition: all 0.3s ease; +} +.application.sheet.daggerheart.actor.dh-style.companion .companion-header-sheet .actor-name input[type='text']:hover { + outline: 2px solid light-dark(#222, #f3c267); +} +.application.sheet.daggerheart.actor.dh-style.companion .companion-header-sheet .status-section { + display: flex; + gap: 5px; + justify-content: center; +} +.application.sheet.daggerheart.actor.dh-style.companion .companion-header-sheet .status-section .status-number { + justify-items: center; +} +.application.sheet.daggerheart.actor.dh-style.companion .companion-header-sheet .status-section .status-number .status-value { + position: relative; + display: flex; + width: 50px; + height: 40px; + border: 1px solid light-dark(#18162e, #f3c267); + border-bottom: none; + border-radius: 6px 6px 0 0; + padding: 0 6px; + font-size: 1.5rem; + align-items: center; + justify-content: center; + background: light-dark(transparent, #18162e); + z-index: 2; +} +.application.sheet.daggerheart.actor.dh-style.companion .companion-header-sheet .status-section .status-number .status-value.armor-slots { + width: 80px; + height: 30px; +} +.application.sheet.daggerheart.actor.dh-style.companion .companion-header-sheet .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.companion .companion-header-sheet .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.companion .companion-header-sheet .status-section .status-bar { + position: relative; + width: 100px; + height: 40px; + justify-items: center; +} +.application.sheet.daggerheart.actor.dh-style.companion .companion-header-sheet .status-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.companion .companion-header-sheet .status-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.companion .companion-header-sheet .status-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.companion .companion-header-sheet .status-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.companion .companion-header-sheet .status-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.companion .companion-header-sheet .status-section .status-bar .status-value input[type='number'].bar-input:hover, +.application.sheet.daggerheart.actor.dh-style.companion .companion-header-sheet .status-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.companion .companion-header-sheet .status-section .status-bar .status-value .bar-label { + width: 40px; +} +.application.sheet.daggerheart.actor.dh-style.companion .companion-header-sheet .status-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.companion .companion-header-sheet .status-section .status-bar .progress-bar::-webkit-progress-bar { + border: none; + background: #18162e; + border-radius: 6px; +} +.application.sheet.daggerheart.actor.dh-style.companion .companion-header-sheet .status-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.companion .companion-header-sheet .status-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.companion .companion-header-sheet .status-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.companion .companion-header-sheet .status-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.companion .companion-header-sheet .status-section .level-up-label { + font-size: 24px; + padding-top: 8px; +} +.application.sheet.daggerheart.actor.dh-style.companion .companion-header-sheet .companion-navigation { + display: flex; + gap: 8px; + align-items: center; + width: 100%; +} +.application.sheet.daggerheart.actor.dh-style.companion .partner-section .title, +.application.sheet.daggerheart.actor.dh-style.companion .attack-section .title { + display: flex; + gap: 15px; + align-items: center; +} +.application.sheet.daggerheart.actor.dh-style.companion .partner-section .title h3, +.application.sheet.daggerheart.actor.dh-style.companion .attack-section .title h3 { + font-size: 20px; +} +.application.sheet.daggerheart.actor.dh-style.companion .partner-section .items-list, +.application.sheet.daggerheart.actor.dh-style.companion .attack-section .items-list { + display: flex; + flex-direction: column; + gap: 10px; + align-items: center; +} +.application.sheet.daggerheart.actor.dh-style.companion .experience-list { + display: flex; + flex-direction: column; + gap: 5px; + width: 100%; + margin-top: 10px; + align-items: center; +} +.application.sheet.daggerheart.actor.dh-style.companion .experience-list .experience-row { + display: flex; + gap: 5px; + width: 250px; + align-items: center; + justify-content: space-between; +} +.application.sheet.daggerheart.actor.dh-style.companion .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.companion .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.companion .experience-list .experience-value { + background: url('../assets/svg/experience-shield-light.svg') no-repeat; +} +.theme-light .application.sheet.daggerheart.actor.dh-style.companion { + background: url('../assets/parchments/dh-parchment-light.png'); +} +.theme-dark .application.sheet.daggerheart.actor.dh-style.companion { + background-image: url('../assets/parchments/dh-parchment-dark.png'); } .application.sheet.daggerheart.actor.dh-style.adversary .window-content { overflow: auto; @@ -5309,6 +5531,16 @@ div.daggerheart.views.multiclass { .application.dh-style button.glow { animation: glow 0.75s infinite alternate; } +.application.dh-style button:disabled { + background: light-dark(transparent, #f3c267); + color: light-dark(#18162e, #18162e); + opacity: 0.6; + cursor: not-allowed; +} +.application.dh-style button:disabled:hover { + background: light-dark(transparent, #f3c267); + color: light-dark(#18162e, #18162e); +} .application.dh-style select { background: light-dark(transparent, transparent); color: light-dark(#222, #efe6d8); diff --git a/styles/daggerheart.less b/styles/daggerheart.less index 362856ce..da04bc9a 100755 --- a/styles/daggerheart.less +++ b/styles/daggerheart.less @@ -40,6 +40,8 @@ @import './less/applications/environment-settings/actions.less'; @import './less/applications/environment-settings/adversaries.less'; +@import './less/actors/companion/header.less'; +@import './less/actors/companion/details.less'; @import './less/actors/companion/sheet.less'; @import './less/actors/adversary.less'; diff --git a/styles/less/actors/companion/details.less b/styles/less/actors/companion/details.less new file mode 100644 index 00000000..33551d9b --- /dev/null +++ b/styles/less/actors/companion/details.less @@ -0,0 +1,63 @@ +@import '../../utils/colors.less'; +@import '../../utils/fonts.less'; + +.application.sheet.daggerheart.actor.dh-style.companion { + .partner-section, + .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-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; + } + } + } +} diff --git a/styles/less/actors/companion/header.less b/styles/less/actors/companion/header.less new file mode 100644 index 00000000..df68747b --- /dev/null +++ b/styles/less/actors/companion/header.less @@ -0,0 +1,197 @@ +@import '../../utils/colors.less'; +@import '../../utils/fonts.less'; + +.application.sheet.daggerheart.actor.dh-style.companion { + .companion-header-sheet { + display: flex; + flex-direction: column; + align-items: center; + gap: 8px; + + .profile { + height: 235px; + width: 100%; + object-fit: cover; + cursor: pointer; + mask-image: linear-gradient(0deg, transparent 0%, black 10%); + } + + .actor-name { + display: flex; + align-items: center; + position: relative; + top: -30px; + gap: 20px; + padding: 0 20px; + margin-bottom: -30px; + + input[type='text'] { + font-size: 24px; + height: 32px; + text-align: center; + border: 1px solid transparent; + outline: 2px solid transparent; + transition: all 0.3s ease; + + &:hover { + outline: 2px solid light-dark(@dark, @golden); + } + } + } + + .status-section { + display: flex; + gap: 5px; + justify-content: center; + + .status-number { + justify-items: center; + + .status-value { + position: relative; + display: flex; + width: 50px; + height: 40px; + border: 1px solid light-dark(@dark-blue, @golden); + border-bottom: none; + border-radius: 6px 6px 0 0; + padding: 0 6px; + font-size: 1.5rem; + 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); + } + } + } + + .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; + } + } + } + + .level-up-label { + font-size: 24px; + padding-top: 8px; + } + } + + .companion-navigation { + display: flex; + gap: 8px; + align-items: center; + width: 100%; + } + } +} diff --git a/styles/less/actors/companion/sheet.less b/styles/less/actors/companion/sheet.less index 1beb28a7..db221597 100644 --- a/styles/less/actors/companion/sheet.less +++ b/styles/less/actors/companion/sheet.less @@ -1,11 +1,18 @@ .application.sheet.daggerheart.actor.dh-style.companion { - .profile { - height: 80px; - width: 80px; + .theme-light & { + background: url('../assets/parchments/dh-parchment-light.png'); + } + .theme-dark & { + background-image: url('../assets/parchments/dh-parchment-dark.png'); } - .temp-container { - position: relative; - top: 32px; - } + // .profile { + // height: 80px; + // width: 80px; + // } + + // .temp-container { + // position: relative; + // top: 32px; + // } } diff --git a/styles/less/global/elements.less b/styles/less/global/elements.less index 1f6e5988..62ef38d1 100755 --- a/styles/less/global/elements.less +++ b/styles/less/global/elements.less @@ -52,6 +52,18 @@ &.glow { animation: glow 0.75s infinite alternate; } + + &:disabled { + background: light-dark(transparent, @golden); + color: light-dark(@dark-blue, @dark-blue); + opacity: 0.6; + cursor: not-allowed; + + &:hover { + background: light-dark(transparent, @golden); + color: light-dark(@dark-blue, @dark-blue); + } + } } select { diff --git a/templates/sheets/actors/companion/details.hbs b/templates/sheets/actors/companion/details.hbs new file mode 100644 index 00000000..8f8c4b4f --- /dev/null +++ b/templates/sheets/actors/companion/details.hbs @@ -0,0 +1,39 @@ +
+
+
+ +

Partner

+ +
+
    + {{> 'systems/daggerheart/templates/sheets/global/partials/inventory-item.hbs' item=(getActor document.system.partner.uuid) type='actor' isSidebar=true isActor=true}} +
+
+
+
+ +

Attack

+ +
+
    + {{> 'systems/daggerheart/templates/sheets/global/partials/inventory-item.hbs' item=source.system.attack type=source.system.attack.systemPath isSidebar=true isCompanion=true}} +
+
+
+ {{#each source.system.experiences as |experience id|}} +
+
+ +{{experience.value}} +
+ {{experience.name}} +
+ +
+
+ {{/each}} +
+
\ No newline at end of file diff --git a/templates/sheets/actors/companion/effects.hbs b/templates/sheets/actors/companion/effects.hbs new file mode 100644 index 00000000..9046fff8 --- /dev/null +++ b/templates/sheets/actors/companion/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/companion/header.hbs b/templates/sheets/actors/companion/header.hbs new file mode 100644 index 00000000..90b2c046 --- /dev/null +++ b/templates/sheets/actors/companion/header.hbs @@ -0,0 +1,46 @@ +
+ {{document.name}} +

+ +

+
+
+
+

{{document.system.evasion.value}}

+
+
+

Evasion

+
+
+
+
+

+

/

+

{{document.system.resources.stress.maxTotal}}

+
+ +
+

Stress

+
+
+

+ {{localize "DAGGERHEART.Sheets.Companion.Level"}} + {{source.system.levelData.level.changed}} +

+
+
+ {{> 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}} + +
+
\ No newline at end of file diff --git a/templates/sheets/applications/companion-settings/attack.hbs b/templates/sheets/applications/companion-settings/attack.hbs new file mode 100644 index 00000000..e3e0d16c --- /dev/null +++ b/templates/sheets/applications/companion-settings/attack.hbs @@ -0,0 +1,22 @@ +
+
+ {{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="system.attack.range" localize=true}} + {{#if systemFields.attack.fields.target.fields}} + {{ 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}} + {{/if}} +
+
\ No newline at end of file diff --git a/templates/sheets/applications/companion-settings/details.hbs b/templates/sheets/applications/companion-settings/details.hbs new file mode 100644 index 00000000..d047752c --- /dev/null +++ b/templates/sheets/applications/companion-settings/details.hbs @@ -0,0 +1,23 @@ +
+
+ {{localize 'DAGGERHEART.General.basics'}} +
+ {{formGroup systemFields.evasion.fields.value value=document.system.evasion.value localize=true}} + {{formGroup systemFields.resources.fields.stress.fields.value value=document.system.resources.stress.value label='Current Stress'}} + {{formGroup systemFields.resources.fields.stress.fields.max value=document.system.resources.stress.max label='Max Stress'}} +
+
+
+ + +
+
+
+ +
\ No newline at end of file diff --git a/templates/sheets/applications/companion-settings/experiences.hbs b/templates/sheets/applications/companion-settings/experiences.hbs new file mode 100644 index 00000000..d211b75b --- /dev/null +++ b/templates/sheets/applications/companion-settings/experiences.hbs @@ -0,0 +1,18 @@ +
+
+ {{localize tabs.experiences.label}} +
    + {{#each document.system.experiences as |experience key|}} +
  • + + +
  • + {{/each}} +
+
+ +
\ No newline at end of file diff --git a/templates/sheets/applications/companion-settings/header.hbs b/templates/sheets/applications/companion-settings/header.hbs new file mode 100644 index 00000000..0978f2c3 --- /dev/null +++ b/templates/sheets/applications/companion-settings/header.hbs @@ -0,0 +1,3 @@ +
+

{{document.name}}

+
\ No newline at end of file diff --git a/templates/sheets/global/partials/inventory-item.hbs b/templates/sheets/global/partials/inventory-item.hbs index b69f1a2d..e1840a76 100644 --- a/templates/sheets/global/partials/inventory-item.hbs +++ b/templates/sheets/global/partials/inventory-item.hbs @@ -1,7 +1,11 @@
  • -
    {{item.name}}
    + {{#if isCompanion}} + {{item.name}} + {{else}} +
    {{item.name}}
    + {{/if}} {{#if (eq type 'weapon')}}
    {{#if isSidebar}} @@ -114,6 +118,11 @@ {{#unless hideControls}} {{#if isActor}}
    + {{#if (eq type 'actor')}} + + + + {{/if}} {{#if (eq type 'adversary')}}