diff --git a/daggerheart.mjs b/daggerheart.mjs index 5960c6b1..05b57ac9 100644 --- a/daggerheart.mjs +++ b/daggerheart.mjs @@ -233,11 +233,6 @@ Hooks.once('init', () => { return handlebarsRegistration(); }); -Hooks.on('i18nInit', () => { - // Setup homebrew resources - game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).refreshConfig(); -}); - Hooks.on('setup', () => { CONFIG.statusEffects = [ ...CONFIG.statusEffects.filter(x => !['dead', 'unconscious'].includes(x.id)), diff --git a/lang/en.json b/lang/en.json index 98cae76b..c9d21944 100755 --- a/lang/en.json +++ b/lang/en.json @@ -74,15 +74,6 @@ "invalidDrop": "You can only drop Actor entities to summon.", "chatMessageTitle": "Test2", "chatMessageHeaderTitle": "Summoning" - }, - "transform": { - "name": "Transform", - "tooltip": "Transform one actor into another", - "noTransformActor": "There is no assigned actor to transform into", - "transformActorMissing": "The assigned actor to transform into does not exist. It was probably deleted or moved in/out of a compendium", - "canvasError": "There is no active scene.", - "prototypeError": "You can only use a transform action from a Token", - "actorLinkError": "You cannot transform a token with Actor Link set to true" } }, "Config": { @@ -138,12 +129,6 @@ }, "summon": { "dropSummonsHere": "Drop Summons Here" - }, - "transform": { - "dropTransformHere": "Drop Transform Here", - "actorIsMissing": "The linked actor is missing. You should delete this link.", - "clearHitPoints": "Clear Hitpoints", - "clearStress": "Clear Stress" } } }, @@ -1058,10 +1043,6 @@ "fear": "Fear", "spotlight": "Spotlight" }, - "DaggerheartDiceAnimationEvents": { - "critical": { "name": "Critical" }, - "higher": { "name": "Highest Roll" } - }, "DamageType": { "physical": { "name": "Physical", @@ -2285,7 +2266,6 @@ "identify": "Identity", "imagePath": "Image Path", "inactiveEffects": "Inactive Effects", - "initial": "Initial", "inventory": "Inventory", "itemResource": "Item Resource", "itemQuantity": "Item Quantity", @@ -2313,7 +2293,6 @@ "plurial": "Players" }, "portrait": "Portrait", - "preview": "Preview", "proficiency": "Proficiency", "quantity": "Quantity", "range": "Range", @@ -2650,14 +2629,6 @@ "title": "Triggers" } }, - "Metagaming": { - "FIELDS": { - "hideObserverPermissionInChat": { - "label": "Hide Chat Info From Players", - "hint": "Information such as hit/miss on attack rolls against adversaries will be hidden" - } - } - }, "Homebrew": { "newDowntimeMove": "Downtime Move", "downtimeMove": "Downtime Move", @@ -2672,8 +2643,6 @@ "resetMovesText": "Are you sure you want to reset?", "deleteItemTitle": "Delete Homebrew Item", "deleteItemText": "Are you sure you want to delete the item?", - "deleteResourceTitle": "Delete Homebrew Resource", - "deleteResourceText": "Are you sure you want to delete the resource?", "FIELDS": { "maxFear": { "label": "Max Fear" }, "maxHope": { "label": "Max Hope" }, @@ -2682,13 +2651,6 @@ "label": "Max Cards in Loadout", "hint": "Set to blank or 0 for unlimited maximum" }, - "resources": { - "resources": { - "value": { "label": "Icon" }, - "isIcon": { "label": "Font Awesome Icon" }, - "noColorFilter": { "label": "Disable Color Filter" } - } - }, "maxDomains": { "label": "Max Class Domains", "hint": "Max domains you can set on a class" } }, "currency": { @@ -2717,13 +2679,6 @@ "adversaryType": { "title": "Custom Adversary Types", "newType": "Adversary Type" - }, - "resources": { - "typeTitle": "{type} Resources", - "filledIcon": "Filled Icon", - "emptyIcon": "Empty Icon", - "resourceIdentifier": "Resource Identifier", - "setResourceIdentifier": "Set Resource Identifier" } }, "Menu": { @@ -2733,11 +2688,6 @@ "label": "Configure Automation", "hint": "Various settings automating resource management and more" }, - "metagaming": { - "name": "Metagaming Settings", - "label": "Configure Metagaming", - "hint": "Various settings controlling the flow of information to players" - }, "homebrew": { "name": "Homebrew Settings", "label": "Configure Homebrew", @@ -2763,12 +2713,7 @@ "colorset": "Theme", "material": "Material", "system": "Dice Preset", - "font": "Font", - "critical": "Duality Critical Animation", - "diceAppearance": "Dice Appearance", - "animations": "Animations", - "defaultAnimations": "Set Animations As Player Defaults", - "previewAnimation": "Preview Animation" + "font": "Font" } }, "variantRules": { diff --git a/module/applications/settings/_module.mjs b/module/applications/settings/_module.mjs index 28972397..b565777c 100644 --- a/module/applications/settings/_module.mjs +++ b/module/applications/settings/_module.mjs @@ -1,5 +1,4 @@ export { default as DhAppearanceSettings } from './appearanceSettings.mjs'; export { default as DhAutomationSettings } from './automationSettings.mjs'; export { default as DhHomebrewSettings } from './homebrewSettings.mjs'; -export { default as DhMetagamingSettings } from './metagamingSettings.mjs'; export { default as DhVariantRuleSettings } from './variantRuleSettings.mjs'; diff --git a/module/applications/settings/appearanceSettings.mjs b/module/applications/settings/appearanceSettings.mjs index 151648e1..9eb0cfbf 100644 --- a/module/applications/settings/appearanceSettings.mjs +++ b/module/applications/settings/appearanceSettings.mjs @@ -12,7 +12,7 @@ export default class DHAppearanceSettings extends HandlebarsApplicationMixin(App static DEFAULT_OPTIONS = { tag: 'form', id: 'daggerheart-appearance-settings', - classes: ['daggerheart', 'dialog', 'dh-style', 'setting', 'appearance-settings'], + classes: ['daggerheart', 'dialog', 'dh-style', 'setting'], position: { width: '600', height: 'auto' }, window: { title: 'DAGGERHEART.SETTINGS.Menu.title', @@ -70,14 +70,6 @@ export default class DHAppearanceSettings extends HandlebarsApplicationMixin(App } } - _attachPartListeners(partId, htmlElement, options) { - super._attachPartListeners(partId, htmlElement, options); - - htmlElement - .querySelector('.default-animations-input') - ?.addEventListener('change', this.toggleSFXOverride.bind(this)); - } - /** @inheritdoc */ _configureRenderParts(options) { const parts = super._configureRenderParts(options); @@ -91,20 +83,15 @@ export default class DHAppearanceSettings extends HandlebarsApplicationMixin(App /**@inheritdoc */ async _prepareContext(options) { const context = await super._prepareContext(options); - if (options.isFirstRender) { + if (options.isFirstRender) this.setting = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance); - this.globalOverrides = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.GlobalOverrides); - } context.setting = this.setting; - context.globalOverrides = this.globalOverrides; context.fields = this.setting.schema.fields; context.tabs = this._prepareTabs('general'); context.dsnTabs = this._prepareTabs('diceSoNice'); - context.isGM = game.user.isGM; - return context; } @@ -133,9 +120,6 @@ export default class DHAppearanceSettings extends HandlebarsApplicationMixin(App * @protected */ async prepareDiceSoNiceContext(context) { - context.animationEvents = CONFIG.DH.GENERAL.daggerheartDiceAnimationEvents; - context.previewAnimation = this.previewAnimation; - context.diceSoNiceTextures = Object.entries(game.dice3d.exports.TEXTURELIST).reduce( (acc, [k, v]) => ({ ...acc, @@ -162,13 +146,6 @@ export default class DHAppearanceSettings extends HandlebarsApplicationMixin(App ); context.diceSoNiceFonts = game.dice3d.exports.Utils.prepareFontList(); - const getAnimationsOptions = key => { - const fields = context.fields.diceSoNice.fields[key].fields.sfx.fields; - return { - higher: fields.higher.fields.class.choices - }; - }; - foundry.utils.mergeObject( context.dsnTabs, ['hope', 'fear', 'advantage', 'disadvantage'].reduce( @@ -176,8 +153,7 @@ export default class DHAppearanceSettings extends HandlebarsApplicationMixin(App ...acc, [key]: { values: this.setting.diceSoNice[key], - fields: this.setting.schema.getField(`diceSoNice.${key}`).fields, - animations: ['hope', 'fear'].includes(key) ? getAnimationsOptions(key) : {} + fields: this.setting.schema.getField(`diceSoNice.${key}`).fields } }), {} @@ -193,20 +169,13 @@ export default class DHAppearanceSettings extends HandlebarsApplicationMixin(App * @param {foundry.applications.ux.FormDataExtended} formData * @returns {Promise} */ - static async #onSubmit(_event, _form, formData) { + static async #onSubmit(event, form, formData) { const data = this.setting.schema.clean(foundry.utils.expandObject(formData.object)); - await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance, data); } /* -------------------------------------------- */ - async toggleSFXOverride(event) { - await this.globalOverrides.diceSoNiceSFXUpdate(this.setting, event.target.checked); - this.globalOverrides = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.GlobalOverrides); - this.render(); - } - /** * Submit the configuration form. * @this {DHAppearanceSettings} @@ -214,25 +183,13 @@ export default class DHAppearanceSettings extends HandlebarsApplicationMixin(App */ static async #onPreview(_, target) { const formData = new foundry.applications.ux.FormDataExtended(target.closest('form')); - const { diceSoNice, ...rest } = foundry.utils.expandObject(formData.object); + const { diceSoNice } = foundry.utils.expandObject(formData.object); const { key } = target.dataset; const faces = ['advantage', 'disadvantage'].includes(key) ? 'd6' : 'd12'; const preset = await getDiceSoNicePreset(diceSoNice[key], faces); const diceSoNiceRoll = await new foundry.dice.Roll(`1${faces}`).evaluate(); diceSoNiceRoll.dice[0].options.appearance = preset.appearance; diceSoNiceRoll.dice[0].options.modelFile = preset.modelFile; - - const previewAnimation = rest[`${key}PreviewAnimation`]; - const events = CONFIG.DH.GENERAL.daggerheartDiceAnimationEvents; - if (previewAnimation) { - if (previewAnimation === events.critical.id && diceSoNice.sfx.critical.class) { - diceSoNiceRoll.dice[0].options.sfx = { specialEffect: diceSoNice.sfx.critical.class }; - } - if (previewAnimation === events.higher.id && diceSoNice[key].sfx.higher) { - diceSoNiceRoll.dice[0].options.sfx = { specialEffect: diceSoNice[key].sfx.higher.class }; - } - } - await game.dice3d.showForRoll(diceSoNiceRoll, game.user, false); } diff --git a/module/applications/settings/automationSettings.mjs b/module/applications/settings/automationSettings.mjs index 52def7db..e720733e 100644 --- a/module/applications/settings/automationSettings.mjs +++ b/module/applications/settings/automationSettings.mjs @@ -31,8 +31,8 @@ export default class DhAutomationSettings extends HandlebarsApplicationMixin(App }; static PARTS = { - header: { template: 'systems/daggerheart/templates/settings/automation-settings/header.hbs' }, tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' }, + header: { template: 'systems/daggerheart/templates/settings/automation-settings/header.hbs' }, general: { template: 'systems/daggerheart/templates/settings/automation-settings/general.hbs' }, rules: { template: 'systems/daggerheart/templates/settings/automation-settings/deathMoves.hbs' }, roll: { template: 'systems/daggerheart/templates/settings/automation-settings/roll.hbs' }, diff --git a/module/applications/settings/homebrewSettings.mjs b/module/applications/settings/homebrewSettings.mjs index 9cc0ecb1..083c468f 100644 --- a/module/applications/settings/homebrewSettings.mjs +++ b/module/applications/settings/homebrewSettings.mjs @@ -1,5 +1,4 @@ import { DhHomebrew } from '../../data/settings/_module.mjs'; -import { Resource } from '../../data/settings/Homebrew.mjs'; import { slugify } from '../../helpers/utils.mjs'; const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api; @@ -45,9 +44,6 @@ export default class DhHomebrewSettings extends HandlebarsApplicationMixin(Appli addAdversaryType: this.addAdversaryType, deleteAdversaryType: this.deleteAdversaryType, selectAdversaryType: this.selectAdversaryType, - addResource: this.addResource, - removeResource: this.removeResource, - resetResourceImage: this.resetResourceImage, save: this.save, resetTokenSizes: this.resetTokenSizes, reset: this.reset @@ -60,10 +56,6 @@ export default class DhHomebrewSettings extends HandlebarsApplicationMixin(Appli settings: { template: 'systems/daggerheart/templates/settings/homebrew-settings/settings.hbs' }, domains: { template: 'systems/daggerheart/templates/settings/homebrew-settings/domains.hbs' }, types: { template: 'systems/daggerheart/templates/settings/homebrew-settings/types.hbs' }, - resources: { - template: 'systems/daggerheart/templates/settings/homebrew-settings/resources.hbs', - scrollable: ['.resource-types-container'] - }, itemTypes: { template: 'systems/daggerheart/templates/settings/homebrew-settings/itemFeatures.hbs' }, downtime: { template: 'systems/daggerheart/templates/settings/homebrew-settings/downtime.hbs' }, footer: { template: 'systems/daggerheart/templates/settings/homebrew-settings/footer.hbs' } @@ -72,14 +64,7 @@ export default class DhHomebrewSettings extends HandlebarsApplicationMixin(Appli /** @inheritdoc */ static TABS = { main: { - tabs: [ - { id: 'settings' }, - { id: 'domains' }, - { id: 'types' }, - { id: 'resources' }, - { id: 'itemFeatures' }, - { id: 'downtime' } - ], + tabs: [{ id: 'settings' }, { id: 'domains' }, { id: 'types' }, { id: 'itemFeatures' }, { id: 'downtime' }], initial: 'settings', labelPrefix: 'DAGGERHEART.GENERAL.Tabs' } @@ -92,17 +77,9 @@ export default class DhHomebrewSettings extends HandlebarsApplicationMixin(Appli this.render(); } - _attachPartListeners(partId, htmlElement, options) { - super._attachPartListeners(partId, htmlElement, options); - - for (const element of htmlElement.querySelectorAll('.path-field input')) - element.addEventListener('change', this.toggleResourceIsIcon.bind(this)); - } - async _prepareContext(_options) { const context = await super._prepareContext(_options); context.settingFields = this.settings; - context.schemaFields = context.settingFields.schema.fields; return context; } @@ -126,8 +103,6 @@ export default class DhHomebrewSettings extends HandlebarsApplicationMixin(Appli ? { id: this.selected.adversaryType, ...this.settings.adversaryTypes[this.selected.adversaryType] } : null; break; - case 'resources': - break; case 'downtime': context.restOptions = { shortRest: CONFIG.DH.GENERAL.defaultRestOptions.shortRest(), @@ -149,33 +124,6 @@ export default class DhHomebrewSettings extends HandlebarsApplicationMixin(Appli this.render(); } - async toggleResourceIsIcon(event) { - const element = event.target.closest('.resource-icon-container'); - const { actorType, resourceKey, imageKey } = element.dataset; - - const current = this.settings.resources[actorType].resources[resourceKey].images[imageKey]; - await this.settings.updateSource({ - [`resources.${actorType}.resources.${resourceKey}.images.${imageKey}`]: { - isIcon: !current.isIcon, - value: '' - } - }); - - this.render(); - } - - static async resetResourceImage(_event, button) { - const element = button.closest('.resource-icon-container'); - const { actorType, resourceKey, imageKey } = element.dataset; - - await this.settings.updateSource({ - [`resources.${actorType}.resources.${resourceKey}.images.${imageKey}`]: - Resource.getDefaultImageData(imageKey) - }); - - this.render(); - } - static async changeCurrencyIcon(_, target) { const type = target.dataset.currency; const currentIcon = this.settings.currency[type].icon; @@ -518,58 +466,6 @@ export default class DhHomebrewSettings extends HandlebarsApplicationMixin(Appli this.render(); } - static async addResource(_, target) { - const { actorType } = target.dataset; - const content = new foundry.data.fields.StringField({ - label: game.i18n.localize('DAGGERHEART.SETTINGS.Homebrew.resources.resourceIdentifier'), - required: true - }).toFormGroup({}, { name: 'identifier', localize: true }).outerHTML; - - async function callback(_, button) { - const identifier = button.form.elements.identifier.value; - if (!identifier) return; - - const sluggedIdentifier = slugify(identifier); - - await this.settings.updateSource({ - [`resources.${actorType}.resources.${sluggedIdentifier}`]: Resource.getDefaultResourceData(identifier) - }); - - game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew, this.settings.toObject()); - this.render(); - } - - await foundry.applications.api.DialogV2.prompt({ - content: content, - rejectClose: false, - modal: true, - ok: { callback: callback.bind(this) }, - window: { - title: game.i18n.localize('DAGGERHEART.SETTINGS.Homebrew.resources.setResourceIdentifier') - }, - position: { width: 400 } - }); - } - - static async removeResource(_, target) { - const confirmed = await foundry.applications.api.DialogV2.confirm({ - window: { - title: game.i18n.localize(`DAGGERHEART.SETTINGS.Homebrew.deleteResourceTitle`) - }, - content: game.i18n.localize('DAGGERHEART.SETTINGS.Homebrew.deleteResourceText') - }); - - if (!confirmed) return; - - const { actorType, resourceKey } = target.dataset; - await this.settings.updateSource({ - [`resources.${actorType}.resources.-=${resourceKey}`]: null - }); - - game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew, this.settings.toObject()); - this.render(); - } - static async save() { await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew, this.settings.toObject()); this.close(); diff --git a/module/applications/settings/metagamingSettings.mjs b/module/applications/settings/metagamingSettings.mjs deleted file mode 100644 index c29a021b..00000000 --- a/module/applications/settings/metagamingSettings.mjs +++ /dev/null @@ -1,62 +0,0 @@ -import { DhMetagaming } from '../../data/settings/_module.mjs'; - -const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api; - -export default class DhMetagamingSettings extends HandlebarsApplicationMixin(ApplicationV2) { - constructor() { - super({}); - - this.settings = new DhMetagaming( - game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Metagaming).toObject() - ); - } - - get title() { - return game.i18n.localize('DAGGERHEART.SETTINGS.Menu.title'); - } - - static DEFAULT_OPTIONS = { - tag: 'form', - id: 'daggerheart-metagaming-settings', - classes: ['daggerheart', 'dh-style', 'dialog', 'setting'], - position: { width: '600', height: 'auto' }, - window: { - icon: 'fa-solid fa-eye-low-vision' - }, - actions: { - reset: this.reset, - save: this.save - }, - form: { handler: this.updateData, submitOnChange: true } - }; - - static PARTS = { - header: { template: 'systems/daggerheart/templates/settings/metagaming-settings/header.hbs' }, - general: { template: 'systems/daggerheart/templates/settings/metagaming-settings/general.hbs' }, - footer: { template: 'systems/daggerheart/templates/settings/metagaming-settings/footer.hbs' } - }; - - async _prepareContext(_options) { - const context = await super._prepareContext(_options); - context.settingFields = this.settings; - - return context; - } - - static async updateData(_event, _element, formData) { - const updatedSettings = foundry.utils.expandObject(formData.object); - - await this.settings.updateSource(updatedSettings); - this.render(); - } - - static async reset() { - this.settings = new DhMetagaming(); - this.render(); - } - - static async save() { - await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Metagaming, this.settings.toObject()); - this.close(); - } -} diff --git a/module/applications/sheets-configs/action-base-config.mjs b/module/applications/sheets-configs/action-base-config.mjs index ce0e7e24..34543086 100644 --- a/module/applications/sheets-configs/action-base-config.mjs +++ b/module/applications/sheets-configs/action-base-config.mjs @@ -28,7 +28,6 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2) removeEffect: this.removeEffect, addElement: this.addElement, removeElement: this.removeElement, - removeTransformActor: this.removeTransformActor, editEffect: this.editEffect, addDamage: this.addDamage, removeDamage: this.removeDamage, @@ -42,7 +41,7 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2) submitOnChange: true, closeOnSubmit: false }, - dragDrop: [{ dragSelector: null, dropSelector: '[data-is-drop-zone]', handlers: ['_onDrop'] }] + dragDrop: [{ dragSelector: null, dropSelector: '#summon-drop-zone', handlers: ['_onDrop'] }] }; static PARTS = { @@ -121,10 +120,6 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2) htmlElement.querySelectorAll('.summon-count-wrapper input').forEach(element => { element.addEventListener('change', this.updateSummonCount.bind(this)); }); - - htmlElement.querySelectorAll('.transform-resource input').forEach(element => { - element.addEventListener('change', this.updateTransformResource.bind(this)); - }); } async _prepareContext(_options) { @@ -138,18 +133,6 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2) context.summons.push({ actor, count: summon.count }); } - if (context.source.transform) { - const actor = await foundry.utils.fromUuid(context.source.transform.actorUUID); - context.transform = { - ...context.source.transform, - actor: - actor ?? - (context.source.transform.actorUUID && !actor - ? { error: game.i18n.localize('DAGGERHEART.ACTIONS.Settings.transform.actorIsMissing') } - : null) - }; - } - context.openSection = this.openSection; context.tabs = this._getTabs(this.constructor.TABS); context.config = CONFIG.DH; @@ -283,12 +266,6 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2) if (doc) return doc.sheet.render({ force: true }); } - static async removeTransformActor() { - const data = this.action.toObject(); - data.transform.actorUUID = null; - this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) }); - } - static addDamage(_event) { if (!this.action.damage.parts) return; const data = this.action.toObject(), @@ -369,14 +346,6 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2) this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) }); } - updateTransformResource(event) { - event.stopPropagation(); - - const data = this.action.toObject(); - data.transform.resourceRefresh[event.target.dataset.resource] = event.target.checked; - this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) }); - } - /** Specific implementation in extending classes **/ static async addEffect(_event) {} static removeEffect(_event, _button) {} @@ -395,18 +364,6 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2) return; } - const dropZone = event.target.closest('[data-is-drop-zone]'); - if (!dropZone) return; - - switch (dropZone.id) { - case 'summon-drop-zone': - return this.onSummonDrop(data); - case 'transform-drop-zone': - return this.onTransformDrop(data); - } - } - - async onSummonDrop(data) { const actionData = this.action.toObject(); let countvalue = 1; for (const entry of actionData.summon) { @@ -423,10 +380,4 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2) actionData.summon.push({ actorUUID: data.uuid, count: countvalue }); await this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(actionData) }); } - - async onTransformDrop(data) { - const actionData = this.action.toObject(); - actionData.transform.actorUUID = data.uuid; - await this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(actionData) }); - } } diff --git a/module/applications/sheets/actors/character.mjs b/module/applications/sheets/actors/character.mjs index 14dd1ae7..4ecaeb06 100644 --- a/module/applications/sheets/actors/character.mjs +++ b/module/applications/sheets/actors/character.mjs @@ -33,7 +33,6 @@ export default class CharacterSheet extends DHBaseActorSheet { handleResourceDice: CharacterSheet.#handleResourceDice, advanceResourceDie: CharacterSheet.#advanceResourceDie, cancelBeastform: CharacterSheet.#cancelBeastform, - toggleResourceManagement: CharacterSheet.#toggleResourceManagement, useDowntime: this.useDowntime, viewParty: CharacterSheet.#viewParty }, @@ -227,9 +226,6 @@ export default class CharacterSheet extends DHBaseActorSheet { async _preparePartContext(partId, context, options) { context = await super._preparePartContext(partId, context, options); switch (partId) { - case 'header': - await this._prepareHeaderContext(context, options); - break; case 'loadout': await this._prepareLoadoutContext(context, options); break; @@ -244,12 +240,6 @@ export default class CharacterSheet extends DHBaseActorSheet { return context; } - async _prepareHeaderContext(context, _options) { - context.hasExtraResources = Object.keys(CONFIG.DH.RESOURCE.character.all).some( - key => !CONFIG.DH.RESOURCE.character.base[key] - ); - } - /** * Prepare render context for the Loadout part. * @param {ApplicationRenderContext} context @@ -952,78 +942,6 @@ export default class CharacterSheet extends DHBaseActorSheet { }); } - static async #toggleResourceManagement(event, button) { - event.stopPropagation(); - const existingTooltip = document.body.querySelector('.locked-tooltip .resource-management-container'); - if (existingTooltip) { - game.tooltip.dismissLockedTooltips(); - return; - } - - const extraResources = Object.values(CONFIG.DH.RESOURCE.character.all).reduce((acc, resource) => { - if (CONFIG.DH.RESOURCE.character.base[resource.id]) return acc; - - const resourceData = this.document.system.resources[resource.id]; - acc[resource.id] = { - id: resource.id, - label: game.i18n.localize(resource.label), - value: resourceData.value, - max: resourceData.max, - fullIcon: resource.images?.full ?? { value: 'fa-solid fa-circle', isIcon: true }, - emptyIcon: resource.images?.empty ?? { value: 'fa-regular fa-circle', isIcon: true } - }; - - return acc; - }, {}); - - const html = document.createElement('div'); - html.innerHTML = await foundry.applications.handlebars.renderTemplate( - `systems/daggerheart/templates/ui/tooltip/resourceManagement.hbs`, - { - resources: extraResources - } - ); - - const target = button.closest('.resource-section'); - - game.tooltip.dismissLockedTooltips(); - game.tooltip.activate(target, { - html, - locked: true, - cssClass: 'bordered-tooltip', - direction: 'DOWN', - noOffset: true - }); - - const resourceManager = target.querySelector('.resource-manager'); - resourceManager.classList.toggle('inverted'); - - Hooks.once(CONFIG.DH.HOOKS.hooksConfig.lockedTooltipDismissed, () => { - resourceManager.classList.toggle('inverted'); - }); - - for (const element of html.querySelectorAll('.resource-value')) - element.addEventListener('click', this.onUpdateResource.bind(this)); - } - - async onUpdateResource(event) { - const target = event.target.closest('.resource-value'); - const { resource, value: textValue } = target.dataset; - - const inputValue = Number.parseInt(textValue); - const decreasing = inputValue <= this.document.system.resources[resource].value; - const value = decreasing ? inputValue - 1 : inputValue; - await this.document.update({ [`system.resources.${resource}.value`]: value }, { render: false }); - - /* Update resource symbols */ - const section = target.closest('.resource-section'); - for (const element of section.querySelectorAll('.resource-value')) { - const showFull = Number.parseInt(element.dataset.value) <= value; - element.querySelector('.full').classList.toggle('hidden', !showFull); - element.querySelector('.empty').classList.toggle('hidden', showFull); - } - } - /** * Open the downtime application. * @type {ApplicationClickAction} diff --git a/module/applications/sheets/api/actor-setting.mjs b/module/applications/sheets/api/actor-setting.mjs index 738f7002..d8cfb40f 100644 --- a/module/applications/sheets/api/actor-setting.mjs +++ b/module/applications/sheets/api/actor-setting.mjs @@ -44,32 +44,8 @@ export default class DHBaseActorSettings extends DHApplicationMixin(DocumentShee const context = await super._prepareContext(options); context.isNPC = this.actor.isNPC; - if (context.systemFields.attack) { + if (context.systemFields.attack) context.systemFields.attack.fields = this.actor.system.attack.schema.fields; - } - - // Create fake fields for actor configurable max resource value. - const resourceConfig = CONFIG.DH.RESOURCE[this.actor.type]?.all; - if (resourceConfig) { - const relevant = ['hitPoints', 'stress'].filter(r => r in resourceConfig); - context.resources = relevant.map(key => { - const data = this.actor._source.system.resources[key]; - const config = resourceConfig[key]; - return { - label: config.label, - name: `system.resources.${key}.max`, - value: data.max ?? config.max, - tooltip: key === 'hitPoints' ? game.i18n.localize('DAGGERHEART.UI.Tooltip.maxHPClassBound') : null, - field: new foundry.data.fields.NumberField({ - initial: config.max, - integer: true, - label: game.i18n.format('DAGGERHEART.GENERAL.maxWithThing', { - thing: game.i18n.localize(config.label) - }) - }) - }; - }); - } return context; } diff --git a/module/applications/sheets/api/application-mixin.mjs b/module/applications/sheets/api/application-mixin.mjs index b18176ec..449880fb 100644 --- a/module/applications/sheets/api/application-mixin.mjs +++ b/module/applications/sheets/api/application-mixin.mjs @@ -691,9 +691,6 @@ export default function DHApplicationMixin(Base) { case 'weapon': presets.folder = 'equipments.folders.weapons'; break; - case 'feature': - presets.folder = 'features'; - break; case 'domainCard': presets.folder = 'domains'; presets.filter = { diff --git a/module/applications/ui/itemBrowser.mjs b/module/applications/ui/itemBrowser.mjs index f6235101..2d882eba 100644 --- a/module/applications/ui/itemBrowser.mjs +++ b/module/applications/ui/itemBrowser.mjs @@ -251,12 +251,6 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) { /* If any noticeable slowdown occurs, consider replacing with enriching description on clicking to expand descriptions */ for (const item of this.items) { - if (["weapon", "armor"].includes(item.type)) { - item.system.enrichedTags = await foundry.applications.handlebars.renderTemplate( - 'systems/daggerheart/templates/sheets/global/partials/item-tags.hbs', - item.system, - ); - } item.system.enrichedDescription = (await item.system.getEnrichedDescription?.()) ?? (await foundry.applications.ux.TextEditor.implementation.enrichHTML(item.description)); diff --git a/module/config/_module.mjs b/module/config/_module.mjs index 7a725f54..560f3fec 100644 --- a/module/config/_module.mjs +++ b/module/config/_module.mjs @@ -11,4 +11,3 @@ export * as settingsConfig from './settingsConfig.mjs'; export * as systemConfig from './system.mjs'; export * as itemBrowserConfig from './itemBrowserConfig.mjs'; export * as triggerConfig from './triggerConfig.mjs'; -export * as resourceConfig from './resourceConfig.mjs'; diff --git a/module/config/actionConfig.mjs b/module/config/actionConfig.mjs index 0b1bf91d..c9b70193 100644 --- a/module/config/actionConfig.mjs +++ b/module/config/actionConfig.mjs @@ -35,12 +35,6 @@ export const actionTypes = { icon: 'fa-ghost', tooltip: 'DAGGERHEART.ACTIONS.TYPES.summon.tooltip' }, - transform: { - id: 'transform', - name: 'DAGGERHEART.ACTIONS.TYPES.transform.name', - icon: 'fa-dragon', - tooltip: 'DAGGERHEART.ACTIONS.TYPES.transform.tooltip' - }, effect: { id: 'effect', name: 'DAGGERHEART.ACTIONS.TYPES.effect.name', diff --git a/module/config/actorConfig.mjs b/module/config/actorConfig.mjs index aa7c3cf7..ac55117a 100644 --- a/module/config/actorConfig.mjs +++ b/module/config/actorConfig.mjs @@ -55,6 +55,24 @@ export const abilities = { } }; +export const scrollingTextResource = { + hitPoints: { + label: 'DAGGERHEART.GENERAL.HitPoints.plural', + reversed: true + }, + stress: { + label: 'DAGGERHEART.GENERAL.stress', + reversed: true + }, + hope: { + label: 'DAGGERHEART.GENERAL.hope' + }, + armor: { + label: 'DAGGERHEART.GENERAL.armor', + reversed: true + } +}; + export const featureProperties = { agility: { name: 'DAGGERHEART.CONFIG.Traits.agility.name', @@ -488,8 +506,8 @@ export const subclassFeatureLabels = { * @property {number[]} damage */ -/** - * @type {Record} +/** + * @type {Record} * Scaling data used to change an adversary's tier. Each rank is applied incrementally. */ export const adversaryScalingData = { @@ -500,7 +518,7 @@ export const adversaryScalingData = { severeThreshold: 10, hp: 1, stress: 2, - attack: 2 + attack: 2, }, 3: { difficulty: 2, @@ -508,7 +526,7 @@ export const adversaryScalingData = { severeThreshold: 15, hp: 1, stress: 0, - attack: 2 + attack: 2, }, 4: { difficulty: 2, @@ -516,7 +534,7 @@ export const adversaryScalingData = { severeThreshold: 25, hp: 1, stress: 0, - attack: 2 + attack: 2, } }, horde: { @@ -526,7 +544,7 @@ export const adversaryScalingData = { severeThreshold: 8, hp: 2, stress: 0, - attack: 0 + attack: 0, }, 3: { difficulty: 2, @@ -534,7 +552,7 @@ export const adversaryScalingData = { severeThreshold: 12, hp: 0, stress: 1, - attack: 1 + attack: 1, }, 4: { difficulty: 2, @@ -542,7 +560,7 @@ export const adversaryScalingData = { severeThreshold: 15, hp: 2, stress: 0, - attack: 0 + attack: 0, } }, leader: { @@ -552,7 +570,7 @@ export const adversaryScalingData = { severeThreshold: 10, hp: 0, stress: 0, - attack: 1 + attack: 1, }, 3: { difficulty: 2, @@ -560,7 +578,7 @@ export const adversaryScalingData = { severeThreshold: 15, hp: 1, stress: 0, - attack: 2 + attack: 2, }, 4: { difficulty: 2, @@ -568,7 +586,7 @@ export const adversaryScalingData = { severeThreshold: 25, hp: 1, stress: 1, - attack: 3 + attack: 3, } }, minion: { @@ -578,7 +596,7 @@ export const adversaryScalingData = { severeThreshold: 0, hp: 0, stress: 0, - attack: 1 + attack: 1, }, 3: { difficulty: 2, @@ -586,7 +604,7 @@ export const adversaryScalingData = { severeThreshold: 0, hp: 0, stress: 1, - attack: 1 + attack: 1, }, 4: { difficulty: 2, @@ -594,7 +612,7 @@ export const adversaryScalingData = { severeThreshold: 0, hp: 0, stress: 0, - attack: 1 + attack: 1, } }, ranged: { @@ -604,7 +622,7 @@ export const adversaryScalingData = { severeThreshold: 6, hp: 1, stress: 0, - attack: 1 + attack: 1, }, 3: { difficulty: 2, @@ -612,7 +630,7 @@ export const adversaryScalingData = { severeThreshold: 14, hp: 1, stress: 1, - attack: 2 + attack: 2, }, 4: { difficulty: 2, @@ -620,7 +638,7 @@ export const adversaryScalingData = { severeThreshold: 10, hp: 1, stress: 1, - attack: 1 + attack: 1, } }, skulk: { @@ -630,7 +648,7 @@ export const adversaryScalingData = { severeThreshold: 8, hp: 1, stress: 1, - attack: 1 + attack: 1, }, 3: { difficulty: 2, @@ -638,7 +656,7 @@ export const adversaryScalingData = { severeThreshold: 12, hp: 1, stress: 1, - attack: 1 + attack: 1, }, 4: { difficulty: 2, @@ -646,7 +664,7 @@ export const adversaryScalingData = { severeThreshold: 10, hp: 1, stress: 1, - attack: 1 + attack: 1, } }, solo: { @@ -656,7 +674,7 @@ export const adversaryScalingData = { severeThreshold: 10, hp: 0, stress: 1, - attack: 2 + attack: 2, }, 3: { difficulty: 2, @@ -664,7 +682,7 @@ export const adversaryScalingData = { severeThreshold: 15, hp: 2, stress: 1, - attack: 2 + attack: 2, }, 4: { difficulty: 2, @@ -672,7 +690,7 @@ export const adversaryScalingData = { severeThreshold: 25, hp: 0, stress: 1, - attack: 3 + attack: 3, } }, standard: { @@ -682,7 +700,7 @@ export const adversaryScalingData = { severeThreshold: 8, hp: 0, stress: 0, - attack: 1 + attack: 1, }, 3: { difficulty: 2, @@ -690,7 +708,7 @@ export const adversaryScalingData = { severeThreshold: 15, hp: 1, stress: 1, - attack: 1 + attack: 1, }, 4: { difficulty: 2, @@ -698,7 +716,7 @@ export const adversaryScalingData = { severeThreshold: 15, hp: 0, stress: 1, - attack: 1 + attack: 1, } }, support: { @@ -708,7 +726,7 @@ export const adversaryScalingData = { severeThreshold: 8, hp: 1, stress: 1, - attack: 1 + attack: 1, }, 3: { difficulty: 2, @@ -716,7 +734,7 @@ export const adversaryScalingData = { severeThreshold: 12, hp: 0, stress: 0, - attack: 1 + attack: 1, }, 4: { difficulty: 2, @@ -724,27 +742,27 @@ export const adversaryScalingData = { severeThreshold: 10, hp: 1, stress: 1, - attack: 1 + attack: 1, } } }; -/** +/** * Scaling data used for an adversary's damage. * Tier 4 is missing certain adversary types and therefore skews upwards. * We manually set tier 4 data to hopefully lead to better results */ export const adversaryExpectedDamage = { - basic: { - 1: { mean: 7.321428571428571, deviation: 1.962519002770912 }, - 2: { mean: 12.444444444444445, deviation: 2.0631069425529676 }, - 3: { mean: 15.722222222222221, deviation: 2.486565208464823 }, - 4: { mean: 26, deviation: 5.2 } - }, - minion: { - 1: { mean: 2.142857142857143, deviation: 1.0690449676496976 }, - 2: { mean: 5, deviation: 0.816496580927726 }, - 3: { mean: 6.5, deviation: 2.1213203435596424 }, - 4: { mean: 11, deviation: 1 } - } + basic: { + 1: { mean: 7.321428571428571, deviation: 1.962519002770912 }, + 2: { mean: 12.444444444444445, deviation: 2.0631069425529676 }, + 3: { mean: 15.722222222222221, deviation: 2.486565208464823 }, + 4: { mean: 26, deviation: 5.2 } + }, + minion: { + 1: { mean: 2.142857142857143, deviation: 1.0690449676496976 }, + 2: { mean: 5, deviation: 0.816496580927726 }, + 3: { mean: 6.5, deviation: 2.1213203435596424 }, + 4: { mean: 11, deviation: 1 } + } }; diff --git a/module/config/generalConfig.mjs b/module/config/generalConfig.mjs index f1c21d26..d46db23a 100644 --- a/module/config/generalConfig.mjs +++ b/module/config/generalConfig.mjs @@ -630,95 +630,7 @@ export const diceSetNumbers = { flat: 'Flat' }; -export const diceSoNiceSFXClasses = { - PlayAnimationBright: { - id: 'PlayAnimationBright', - label: 'DICESONICE.PlayAnimationBright' - }, - PlayAnimationDark: { - id: 'PlayAnimationDark', - label: 'DICESONICE.PlayAnimationDark' - }, - PlayAnimationOutline: { - id: 'PlayAnimationOutline', - label: 'DICESONICE.PlayAnimationOutline' - }, - PlayAnimationImpact: { - id: 'PlayAnimationImpact', - label: 'DICESONICE.PlayAnimationImpact' - }, - // PlayConfettiStrength1: { - // id: 'PlayConfettiStrength1', - // label: 'DICESONICE.PlayConfettiStrength1' - // }, - // PlayConfettiStrength2: { - // id: 'PlayConfettiStrength2', - // label: 'DICESONICE.PlayConfettiStrength2' - // }, - // PlayConfettiStrength3: { - // id: 'PlayConfettiStrength3', - // label: 'DICESONICE.PlayConfettiStrength3' - // }, - PlayAnimationThormund: { - id: 'PlayAnimationThormund', - label: 'DICESONICE.PlayAnimationThormund' - }, - PlayAnimationParticleSpiral: { - id: 'PlayAnimationParticleSpiral', - label: 'DICESONICE.PlayAnimationParticleSpiral' - }, - PlayAnimationParticleSparkles: { - id: 'PlayAnimationParticleSparkles', - label: 'DICESONICE.PlayAnimationParticleSparkles' - }, - PlayAnimationParticleVortex: { - id: 'PlayAnimationParticleVortex', - label: 'DICESONICE.PlayAnimationParticleVortex' - }, - PlaySoundEpicWin: { - id: 'PlaySoundEpicWin', - label: 'DICESONICE.PlaySoundEpicWin' - }, - PlaySoundEpicFail: { - id: 'PlaySoundEpicFail', - label: 'DICESONICE.PlaySoundEpicFail' - } - // "PlaySoundCustom", - // "PlayMacro" -}; - -export const daggerheartDiceAnimationEvents = { - critical: { - id: 'critical', - label: 'DAGGERHEART.CONFIG.DaggerheartDiceAnimationEvents.critical.name' - }, - higher: { - id: 'higher', - label: 'DAGGERHEART.CONFIG.DaggerheartDiceAnimationEvents.higher.name' - } -}; - -const getDiceSoNiceSFX = sfxOptions => { - const diceSoNice = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance).diceSoNiceData; - const criticalAnimationData = diceSoNice.sfx.critical; - if (sfxOptions.critical && criticalAnimationData.class) { - return { - specialEffect: criticalAnimationData.class, - options: {} - }; - } - - if (sfxOptions.higher && sfxOptions.data.higher) { - return { - specialEffect: sfxOptions.data.higher.class, - options: {} - }; - } - - return {}; -}; - -export const getDiceSoNicePreset = async (type, faces, sfxOptions = {}) => { +export const getDiceSoNicePreset = async (type, faces) => { const system = game.dice3d.DiceFactory.systems.get(type.system).dice.get(faces); if (!system) { ui.notifications.error( @@ -741,33 +653,16 @@ export const getDiceSoNicePreset = async (type, faces, sfxOptions = {}) => { appearance: { ...system.appearance, ...type - }, - sfx: getDiceSoNiceSFX(sfxOptions) + } }; }; -export const getDiceSoNicePresets = async ( - result, - hopeFaces, - fearFaces, - advantageFaces = 'd6', - disadvantageFaces = 'd6' -) => { - const diceSoNice = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance).diceSoNiceData; - - const { isCritical, withHope, withFear } = result; +export const getDiceSoNicePresets = async (hopeFaces, fearFaces, advantageFaces = 'd6', disadvantageFaces = 'd6') => { + const { diceSoNice } = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance); return { - hope: await getDiceSoNicePreset(diceSoNice.hope, hopeFaces, { - critical: isCritical, - higher: withHope, - data: diceSoNice.hope.sfx - }), - fear: await getDiceSoNicePreset(diceSoNice.fear, fearFaces, { - critical: isCritical, - higher: withFear, - data: diceSoNice.fear.sfx - }), + hope: await getDiceSoNicePreset(diceSoNice.hope, hopeFaces), + fear: await getDiceSoNicePreset(diceSoNice.fear, fearFaces), advantage: await getDiceSoNicePreset(diceSoNice.advantage, advantageFaces), disadvantage: await getDiceSoNicePreset(diceSoNice.disadvantage, disadvantageFaces) }; diff --git a/module/config/hooksConfig.mjs b/module/config/hooksConfig.mjs index 61ba594c..9140ea0a 100644 --- a/module/config/hooksConfig.mjs +++ b/module/config/hooksConfig.mjs @@ -1,4 +1,3 @@ export const hooksConfig = { - effectDisplayToggle: 'DHEffectDisplayToggle', - lockedTooltipDismissed: 'DHLockedTooltipDismissed' + effectDisplayToggle: 'DHEffectDisplayToggle' }; diff --git a/module/config/resourceConfig.mjs b/module/config/resourceConfig.mjs deleted file mode 100644 index 56ef6cd5..00000000 --- a/module/config/resourceConfig.mjs +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Full custom typing: - * id - * initial - * max - * reverse - * label - * images { - * full { value, isIcon, noColorFilter } - * empty { value, isIcon noColorFilter } - * } - */ - -const characterBaseResources = Object.freeze({ - hitPoints: { - id: 'hitPoints', - initial: 0, - max: 0, - reverse: true, - label: 'DAGGERHEART.GENERAL.HitPoints.plural', - maxLabel: 'DAGGERHEART.ACTORS.Character.maxHPBonus' - }, - stress: { - id: 'stress', - initial: 0, - max: 6, - reverse: true, - label: 'DAGGERHEART.GENERAL.stress' - }, - hope: { - id: 'hope', - initial: 2, - reverse: false, - label: 'DAGGERHEART.GENERAL.hope' - } -}); - -const adversaryBaseResources = Object.freeze({ - hitPoints: { - id: 'hitPoints', - initial: 0, - max: 0, - reverse: true, - label: 'DAGGERHEART.GENERAL.HitPoints.plural', - maxLabel: 'DAGGERHEART.ACTORS.Character.maxHPBonus' - }, - stress: { - id: 'stress', - initial: 0, - max: 0, - reverse: true, - label: 'DAGGERHEART.GENERAL.stress' - } -}); - -const companionBaseResources = Object.freeze({ - stress: { - id: 'stress', - initial: 0, - max: 0, - reverse: true, - label: 'DAGGERHEART.GENERAL.stress' - }, - hope: { - id: 'hope', - initial: 0, - reverse: false, - label: 'DAGGERHEART.GENERAL.hope' - } -}); - -export const character = { - base: characterBaseResources, - custom: {}, // module stuff goes here - all: { ...characterBaseResources } -}; - -export const adversary = { - base: adversaryBaseResources, - custom: {}, // module stuff goes here - all: { ...adversaryBaseResources } -}; - -export const companion = { - base: companionBaseResources, - custom: {}, // module stuff goes here - all: { ...companionBaseResources } -}; diff --git a/module/config/settingsConfig.mjs b/module/config/settingsConfig.mjs index 0b28f0ab..d3f752bb 100644 --- a/module/config/settingsConfig.mjs +++ b/module/config/settingsConfig.mjs @@ -3,10 +3,6 @@ export const menu = { Name: 'GameSettingsAutomation', Icon: 'fa-solid fa-robot' }, - Metagaming: { - Name: 'GameSettingsMetagaming', - Icon: 'fa-solid fa-eye-low-vision' - }, Homebrew: { Name: 'GameSettingsHomebrew', Icon: 'fa-solid fa-flask-vial' @@ -23,10 +19,8 @@ export const menu = { export const gameSettings = { Automation: 'Automation', - Metagaming: 'Metagaming', Homebrew: 'Homebrew', appearance: 'Appearance', - GlobalOverrides: 'GlobalOverrides', variantRules: 'VariantRules', Resources: { Fear: 'ResourcesFear' diff --git a/module/config/system.mjs b/module/config/system.mjs index 31dba518..47a41e8d 100644 --- a/module/config/system.mjs +++ b/module/config/system.mjs @@ -2,7 +2,6 @@ import * as GENERAL from './generalConfig.mjs'; import * as DOMAIN from './domainConfig.mjs'; import * as ENCOUNTER from './encounterConfig.mjs'; import * as ACTOR from './actorConfig.mjs'; -import * as RESOURCE from './resourceConfig.mjs'; import * as ITEM from './itemConfig.mjs'; import * as SETTINGS from './settingsConfig.mjs'; import * as EFFECTS from './effectConfig.mjs'; @@ -20,7 +19,6 @@ export const SYSTEM = { GENERAL, DOMAIN, ACTOR, - RESOURCE, ITEM, SETTINGS, EFFECTS, diff --git a/module/data/action/_module.mjs b/module/data/action/_module.mjs index 043b039c..9cfc48cb 100644 --- a/module/data/action/_module.mjs +++ b/module/data/action/_module.mjs @@ -7,7 +7,6 @@ import EffectAction from './effectAction.mjs'; import HealingAction from './healingAction.mjs'; import MacroAction from './macroAction.mjs'; import SummonAction from './summonAction.mjs'; -import TransformAction from './transformAction.mjs'; export const actionsTypes = { base: BaseAction, @@ -18,6 +17,5 @@ export const actionsTypes = { summon: SummonAction, effect: EffectAction, macro: MacroAction, - beastform: BeastformAction, - transform: TransformAction + beastform: BeastformAction }; diff --git a/module/data/action/baseAction.mjs b/module/data/action/baseAction.mjs index 992e1714..f6ffe75f 100644 --- a/module/data/action/baseAction.mjs +++ b/module/data/action/baseAction.mjs @@ -197,7 +197,7 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel async executeWorkflow(config) { for (const [key, part] of this.workflow) { if (Hooks.call(`${CONFIG.DH.id}.pre${key.capitalize()}Action`, this, config) === false) return; - if ((await part.execute(config)) === false) return false; + if ((await part.execute(config)) === false) return; if (Hooks.call(`${CONFIG.DH.id}.post${key.capitalize()}Action`, this, config) === false) return; } } @@ -224,9 +224,7 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel } // Execute the Action Worflow in order based of schema fields - const result = await this.executeWorkflow(config); - if (result === false) return; - + await this.executeWorkflow(config); await config.resourceUpdates.updateResources(); if (Hooks.call(`${CONFIG.DH.id}.postUseAction`, this, config) === false) return; diff --git a/module/data/action/transformAction.mjs b/module/data/action/transformAction.mjs deleted file mode 100644 index 7e552902..00000000 --- a/module/data/action/transformAction.mjs +++ /dev/null @@ -1,5 +0,0 @@ -import DHBaseAction from './baseAction.mjs'; - -export default class DHTransformAction extends DHBaseAction { - static extraSchemas = [...super.extraSchemas, 'transform']; -} diff --git a/module/data/actor/adversary.mjs b/module/data/actor/adversary.mjs index 2053ac99..0a446c15 100644 --- a/module/data/actor/adversary.mjs +++ b/module/data/actor/adversary.mjs @@ -2,7 +2,7 @@ import DHAdversarySettings from '../../applications/sheets-configs/adversary-set import { ActionField } from '../fields/actionField.mjs'; import { commonActorRules } from './base.mjs'; import DhCreature from './creature.mjs'; -import { bonusField } from '../fields/actorField.mjs'; +import { resourceField, bonusField } from '../fields/actorField.mjs'; import { calculateExpectedValue, parseTermsFromSimpleFormula } from '../../helpers/utils.mjs'; import { adversaryExpectedDamage, adversaryScalingData } from '../../config/actorConfig.mjs'; @@ -65,6 +65,10 @@ export default class DhpAdversary extends DhCreature { label: 'DAGGERHEART.GENERAL.DamageThresholds.severeThreshold' }) }), + resources: new fields.SchemaField({ + hitPoints: resourceField(0, 0, 'DAGGERHEART.GENERAL.HitPoints.plural', true), + stress: resourceField(0, 0, 'DAGGERHEART.GENERAL.stress', true) + }), rules: new fields.SchemaField({ ...commonActorRules() }), @@ -187,7 +191,6 @@ export default class DhpAdversary extends DhCreature { } prepareDerivedData() { - super.prepareDerivedData(); this.attack.roll.isStandardAttack = true; } diff --git a/module/data/actor/base.mjs b/module/data/actor/base.mjs index e2f910a0..5e16bac9 100644 --- a/module/data/actor/base.mjs +++ b/module/data/actor/base.mjs @@ -213,7 +213,7 @@ export default class BaseDataActor extends foundry.abstract.TypeDataModel { const textData = Object.keys(changes.system.resources).reduce((acc, key) => { const resource = changes.system.resources[key]; if (resource.value !== undefined && resource.value !== this.resources[key].value) { - acc.push(getScrollTextData(this.parent, resource, key)); + acc.push(getScrollTextData(this.resources, resource, key)); } return acc; diff --git a/module/data/actor/character.mjs b/module/data/actor/character.mjs index 3d18fbbe..10fba63c 100644 --- a/module/data/actor/character.mjs +++ b/module/data/actor/character.mjs @@ -3,7 +3,7 @@ import ForeignDocumentUUIDField from '../fields/foreignDocumentUUIDField.mjs'; import DhLevelData from '../levelData.mjs'; import { commonActorRules } from './base.mjs'; import DhCreature from './creature.mjs'; -import { attributeField, stressDamageReductionRule, bonusField } from '../fields/actorField.mjs'; +import { attributeField, resourceField, stressDamageReductionRule, bonusField } from '../fields/actorField.mjs'; import { ActionField } from '../fields/actionField.mjs'; import DHCharacterSettings from '../../applications/sheets-configs/character-settings.mjs'; @@ -27,6 +27,28 @@ export default class DhCharacter extends DhCreature { return { ...super.defineSchema(), + resources: new fields.SchemaField({ + hitPoints: resourceField( + 0, + 0, + 'DAGGERHEART.GENERAL.HitPoints.plural', + true, + 'DAGGERHEART.ACTORS.Character.maxHPBonus' + ), + stress: resourceField(6, 0, 'DAGGERHEART.GENERAL.stress', true), + hope: new fields.SchemaField( + { + value: new fields.NumberField({ + initial: 2, + min: 0, + integer: true, + label: 'DAGGERHEART.GENERAL.hope' + }), + isReversed: new fields.BooleanField({ initial: false }) + }, + { label: 'DAGGERHEART.GENERAL.hope' } + ) + }), traits: new fields.SchemaField({ agility: attributeField('DAGGERHEART.CONFIG.Traits.agility.name'), strength: attributeField('DAGGERHEART.CONFIG.Traits.strength.name'), @@ -587,7 +609,6 @@ export default class DhCharacter extends DhCreature { } prepareBaseData() { - super.prepareBaseData(); this.evasion += this.class.value?.system?.evasion ?? 0; const currentLevel = this.levelData.level.current; @@ -659,7 +680,6 @@ export default class DhCharacter extends DhCreature { } prepareDerivedData() { - super.prepareDerivedData(); let baseHope = this.resources.hope.value; if (this.companion) { for (let levelKey in this.companion.system.levelData.levelups) { @@ -679,7 +699,6 @@ export default class DhCharacter extends DhCreature { this.attack.roll.trait = this.rules.attack.roll.trait ?? this.attack.roll.trait; this.resources.armor = { - label: 'DAGGERHEART.GENERAL.armor', value: this.armor?.system?.marks?.value ?? 0, max: this.armorScore, isReversed: true @@ -721,8 +740,7 @@ export default class DhCharacter extends DhCreature { const newHopeMax = this.system.resources.hope.max + diff; const newHopeValue = Math.min(newHopeMax, this.system.resources.hope.value); if (newHopeValue != this.system.resources.hope.value) { - if (!changes.system.resources.hope) changes.system.resources.hope = { value: 0 }; - + if (!changes.system.resources) changes.system.resources = { hope: { value: 0 } }; changes.system.resources.hope = { ...changes.system.resources.hope, value: changes.system.resources.hope.value + newHopeValue diff --git a/module/data/actor/companion.mjs b/module/data/actor/companion.mjs index 7a8f0e64..6f51b593 100644 --- a/module/data/actor/companion.mjs +++ b/module/data/actor/companion.mjs @@ -4,7 +4,7 @@ import ForeignDocumentUUIDField from '../fields/foreignDocumentUUIDField.mjs'; import { ActionField } from '../fields/actionField.mjs'; import { adjustDice, adjustRange } from '../../helpers/utils.mjs'; import DHCompanionSettings from '../../applications/sheets-configs/companion-settings.mjs'; -import { bonusField } from '../fields/actorField.mjs'; +import { resourceField, bonusField } from '../fields/actorField.mjs'; export default class DhCompanion extends DhCreature { static LOCALIZATION_PREFIXES = ['DAGGERHEART.ACTORS.Companion']; @@ -26,6 +26,10 @@ export default class DhCompanion extends DhCreature { return { ...super.defineSchema(), partner: new ForeignDocumentUUIDField({ type: 'Actor' }), + resources: new fields.SchemaField({ + stress: resourceField(3, 0, 'DAGGERHEART.GENERAL.stress', true), + hope: new fields.NumberField({ initial: 0, integer: true, label: 'DAGGERHEART.GENERAL.hope' }) + }), evasion: new fields.NumberField({ required: true, min: 1, @@ -123,7 +127,6 @@ export default class DhCompanion extends DhCreature { } prepareBaseData() { - super.prepareBaseData(); this.attack.roll.bonus = this.partner?.system?.spellcastModifier ?? 0; for (let levelKey in this.levelData.levelups) { @@ -158,7 +161,6 @@ export default class DhCompanion extends DhCreature { } prepareDerivedData() { - super.prepareDerivedData(); /* Partner Related Setup */ if (this.partner) { this.levelData.level.changed = this.partner.system.levelData.level.current; diff --git a/module/data/actor/creature.mjs b/module/data/actor/creature.mjs index 601068ad..c8bf8448 100644 --- a/module/data/actor/creature.mjs +++ b/module/data/actor/creature.mjs @@ -1,4 +1,3 @@ -import { ResourcesField } from '../fields/actorField.mjs'; import BaseDataActor from './base.mjs'; export default class DhCreature extends BaseDataActor { @@ -8,7 +7,6 @@ export default class DhCreature extends BaseDataActor { return { ...super.defineSchema(), - resources: new ResourcesField(this.metadata.type), advantageSources: new fields.ArrayField(new fields.StringField(), { label: 'DAGGERHEART.ACTORS.Character.advantageSources.label', hint: 'DAGGERHEART.ACTORS.Character.advantageSources.hint' diff --git a/module/data/fields/action/_module.mjs b/module/data/fields/action/_module.mjs index fa3b1cd5..0bdffca2 100644 --- a/module/data/fields/action/_module.mjs +++ b/module/data/fields/action/_module.mjs @@ -10,4 +10,3 @@ export { default as DamageField } from './damageField.mjs'; export { default as RollField } from './rollField.mjs'; export { default as MacroField } from './macroField.mjs'; export { default as SummonField } from './summonField.mjs'; -export { default as TransformField } from './transformField.mjs'; diff --git a/module/data/fields/action/transformField.mjs b/module/data/fields/action/transformField.mjs deleted file mode 100644 index 07b32166..00000000 --- a/module/data/fields/action/transformField.mjs +++ /dev/null @@ -1,103 +0,0 @@ -const fields = foundry.data.fields; - -export default class DHSummonField extends fields.SchemaField { - /** - * Action Workflow order - */ - static order = 130; - - constructor(options = {}, context = {}) { - const transformFields = { - actorUUID: new fields.DocumentUUIDField({ - type: 'Actor', - required: true - }), - resourceRefresh: new fields.SchemaField({ - hitPoints: new fields.BooleanField({ initial: true }), - stress: new fields.BooleanField({ initial: true }) - }) - }; - super(transformFields, options, context); - } - - static async execute() { - if (!this.transform.actorUUID) { - ui.notifications.warn(game.i18n.localize('DAGGERHEART.ACTIONS.TYPES.transform.noTransformActor')); - return false; - } - - const baseActor = await foundry.utils.fromUuid(this.transform.actorUUID); - if (!baseActor) { - ui.notifications.warn(game.i18n.localize('DAGGERHEART.ACTIONS.TYPES.transform.transformActorMissing')); - return false; - } - - if (!canvas.scene) { - ui.notifications.warn(game.i18n.localize('DAGGERHEART.ACTIONS.TYPES.transform.canvasError')); - return false; - } - - if (this.actor.prototypeToken.actorLink) { - ui.notifications.warn(game.i18n.localize('DAGGERHEART.ACTIONS.TYPES.transform.actorLinkError')); - return false; - } - - if (!this.actor.token) { - ui.notifications.warn(game.i18n.localize('DAGGERHEART.ACTIONS.TYPES.transform.prototypeError')); - return false; - } - - const actor = await DHSummonField.getWorldActor(baseActor); - const tokenSizes = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).tokenSizes; - const tokenSize = actor?.system.metadata.usesSize ? tokenSizes[actor.system.size] : actor.prototypeToken.width; - - await this.actor.token.update( - { ...actor.prototypeToken.toJSON(), actorId: actor.id, width: tokenSize, height: tokenSize }, - { diff: false, recursive: false, noHook: true } - ); - - if (this.actor.token.combatant) { - this.actor.token.combatant.update({ actorId: actor.id, img: actor.prototypeToken.texture.src }); - } - - const marks = { hitPoints: 0, stress: 0 }; - if (!this.transform.resourceRefresh.hitPoints) { - marks.hitPoints = Math.min( - this.actor.system.resources.hitPoints.value, - this.actor.token.actor.system.resources.hitPoints.max - 1 - ); - } - if (!this.transform.resourceRefresh.stress) { - marks.stress = Math.min( - this.actor.system.resources.stress.value, - this.actor.token.actor.system.resources.stress.max - 1 - ); - } - if (marks.hitPoints || marks.stress) { - this.actor.token.actor.update({ - 'system.resources': { - hitPoints: { value: marks.hitPoints }, - stress: { value: marks.stress } - } - }); - } - - const prevPosition = { ...this.actor.sheet.position }; - this.actor.sheet.close(); - this.actor.token.actor.sheet.render({ force: true, position: prevPosition }); - } - - /* Check for any available instances of the actor present in the world, or create a world actor based on compendium */ - static async getWorldActor(baseActor) { - if (!baseActor.inCompendium) return baseActor; - - const dataType = game.system.api.data.actors[`Dh${baseActor.type.capitalize()}`]; - if (dataType && baseActor.img === dataType.DEFAULT_ICON) { - const worldActorCopy = game.actors.find(x => x.name === baseActor.name); - if (worldActorCopy) return worldActorCopy; - } - - const worldActor = await game.system.api.documents.DhpActor.create(baseActor.toObject()); - return worldActor; - } -} diff --git a/module/data/fields/actorField.mjs b/module/data/fields/actorField.mjs index 1399fb32..db1faad4 100644 --- a/module/data/fields/actorField.mjs +++ b/module/data/fields/actorField.mjs @@ -6,6 +6,22 @@ const attributeField = label => tierMarked: new fields.BooleanField({ initial: false }) }); +const resourceField = (max = 0, initial = 0, label, reverse = false, maxLabel) => + new fields.SchemaField( + { + value: new fields.NumberField({ initial: initial, min: 0, integer: true, label }), + max: new fields.NumberField({ + initial: max, + integer: true, + label: + maxLabel ?? + game.i18n.format('DAGGERHEART.GENERAL.maxWithThing', { thing: game.i18n.localize(label) }) + }), + isReversed: new fields.BooleanField({ initial: reverse }) + }, + { label } + ); + const stressDamageReductionRule = localizationPath => new fields.SchemaField({ cost: new fields.NumberField({ @@ -21,67 +37,4 @@ const bonusField = label => dice: new fields.ArrayField(new fields.StringField(), { label: `${game.i18n.localize(label)} Dice` }) }); -/** - * Field used for actor resources. It is a resource that validates dynamically based on the config. - * Because "max" may be defined during runtime, we don't attempt to clamp the maximum value. - */ -class ResourcesField extends fields.TypedObjectField { - constructor(actorType) { - super( - new fields.SchemaField({ - value: new fields.NumberField({ min: 0, initial: 0, integer: true }), - // Some resources allow changing max. A null max means its the default - max: new fields.NumberField({ initial: null, integer: true, nullable: true }) - }) - ); - this.actorType = actorType; - } - - getInitialValue() { - const resources = CONFIG.DH.RESOURCE[this.actorType].all; - return Object.values(resources).reduce((result, resource) => { - result[resource.id] = { - value: resource.initial, - max: null - }; - return result; - }, {}); - } - - _validateKey(key) { - return key in CONFIG.DH.RESOURCE[this.actorType].all; - } - - _cleanType(value, options) { - value = super._cleanType(value, options); - - // If not partial, ensure all data exists - if (!options.partial) { - value = foundry.utils.mergeObject(this.getInitialValue(), value); - } - - return value; - } - - /** Initializes the original source data, returning prepared data */ - initialize(...args) { - const data = super.initialize(...args); - const resources = CONFIG.DH.RESOURCE[this.actorType].all; - for (const [key, value] of Object.entries(data)) { - // TypedObjectField only calls _validateKey when persisting, so we also call it here - if (!this._validateKey(key)) { - delete value[key]; - continue; - } - - // Add basic prepared data. - const resource = resources[key]; - value.label = resource.label; - value.isReversed = resources[key].reverse; - value.max = typeof resource.max === 'number' ? (value.max ?? resource.max) : null; - } - return data; - } -} - -export { attributeField, ResourcesField, stressDamageReductionRule, bonusField }; +export { attributeField, resourceField, stressDamageReductionRule, bonusField }; diff --git a/module/data/item/base.mjs b/module/data/item/base.mjs index 6f3256e3..84f39103 100644 --- a/module/data/item/base.mjs +++ b/module/data/item/base.mjs @@ -224,7 +224,7 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel { const armorChanged = changed.system?.marks?.value !== undefined && changed.system.marks.value !== this.marks.value; if (armorChanged && autoSettings.resourceScrollTexts && this.parent.parent?.type === 'character') { - const armorData = getScrollTextData(this.parent.parent, changed.system.marks, 'armor'); + const armorData = getScrollTextData(this.parent.parent.system.resources, changed.system.marks, 'armor'); options.scrollingTextData = [armorData]; } diff --git a/module/data/item/weapon.mjs b/module/data/item/weapon.mjs index bb7fde0a..051fd42d 100644 --- a/module/data/item/weapon.mjs +++ b/module/data/item/weapon.mjs @@ -112,14 +112,24 @@ export default class DHWeapon extends AttachableItem { async getDescriptionData() { const baseDescription = this.description; + const tier = game.i18n.localize(`DAGGERHEART.GENERAL.Tiers.${this.tier}`); + const trait = game.i18n.localize(CONFIG.DH.ACTOR.abilities[this.attack.roll.trait].label); + const range = game.i18n.localize(`DAGGERHEART.CONFIG.Range.${this.attack.range}.name`); + const damage = Roll.replaceFormulaData(this.attack.damageFormula, this.parent.parent ?? this.parent); + const burden = game.i18n.localize(CONFIG.DH.GENERAL.burden[this.burden].label); + const allFeatures = CONFIG.DH.ITEM.allWeaponFeatures(); const features = this.weaponFeatures.map(x => allFeatures[x.value]).filter(x => x); const prefix = await foundry.applications.handlebars.renderTemplate( 'systems/daggerheart/templates/sheets/items/weapon/description.hbs', { - item: this, - features + features, + tier, + trait, + range, + damage, + burden } ); diff --git a/module/data/settings/Appearance.mjs b/module/data/settings/Appearance.mjs index 9da3afac..cd98d6f9 100644 --- a/module/data/settings/Appearance.mjs +++ b/module/data/settings/Appearance.mjs @@ -1,16 +1,6 @@ export default class DhAppearance extends foundry.abstract.DataModel { static LOCALIZATION_PREFIXES = ['DAGGERHEART.SETTINGS.Appearance']; - static sfxSchema = () => - new foundry.data.fields.SchemaField({ - class: new foundry.data.fields.StringField({ - nullable: true, - initial: null, - blank: true, - choices: CONFIG.DH.GENERAL.diceSoNiceSFXClasses - }) - }); - static defineSchema() { const { StringField, ColorField, BooleanField, SchemaField } = foundry.data.fields; @@ -25,10 +15,7 @@ export default class DhAppearance extends foundry.abstract.DataModel { colorset: new StringField({ initial: 'inspired', required: true, blank: false }), material: new StringField({ initial: 'metal', required: true, blank: false }), system: new StringField({ initial: 'standard', required: true, blank: false }), - font: new StringField({ initial: 'auto', required: true, blank: false }), - sfx: new SchemaField({ - higher: DhAppearance.sfxSchema() - }) + font: new StringField({ initial: 'auto', required: true, blank: false }) }); return { @@ -43,10 +30,7 @@ export default class DhAppearance extends foundry.abstract.DataModel { hope: diceStyle({ fg: '#ffffff', bg: '#ffe760', outline: '#000000', edge: '#ffffff' }), fear: diceStyle({ fg: '#000000', bg: '#0032b1', outline: '#ffffff', edge: '#000000' }), advantage: diceStyle({ fg: '#ffffff', bg: '#008000', outline: '#000000', edge: '#ffffff' }), - disadvantage: diceStyle({ fg: '#000000', bg: '#b30000', outline: '#ffffff', edge: '#000000' }), - sfx: new SchemaField({ - critical: DhAppearance.sfxSchema() - }) + disadvantage: diceStyle({ fg: '#000000', bg: '#b30000', outline: '#ffffff', edge: '#000000' }) }), extendCharacterDescriptions: new BooleanField(), extendAdversaryDescriptions: new BooleanField(), @@ -81,48 +65,4 @@ export default class DhAppearance extends foundry.abstract.DataModel { showGenericStatusEffects: new BooleanField({ initial: true }) }; } - - get diceSoNiceData() { - const globalOverrides = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.GlobalOverrides); - const getSFX = (baseClientData, overrideKey) => { - if (!globalOverrides.diceSoNice.sfx.overrideEnabled) return baseClientData; - const overrideData = globalOverrides.diceSoNice.sfx[overrideKey]; - const clientData = foundry.utils.deepClone(baseClientData); - return Object.keys(clientData).reduce((acc, key) => { - const data = clientData[key]; - acc[key] = Object.keys(data).reduce((acc, dataKey) => { - const value = data[dataKey]; - acc[dataKey] = value ? value : overrideData[key][dataKey]; - return acc; - }, {}); - return acc; - }, {}); - }; - - return { - ...this.diceSoNice, - sfx: getSFX(this.diceSoNice.sfx, 'global'), - hope: { - ...this.diceSoNice.hope, - sfx: getSFX(this.diceSoNice.hope.sfx, 'hope') - }, - fear: { - ...this.diceSoNice.fear, - sfx: getSFX(this.diceSoNice.fear.sfx, 'fear') - } - }; - } - - /** Invoked by the setting when data changes */ - handleChange() { - if (this.displayFear) { - if (ui.resources) { - if (this.displayFear === 'hide') ui.resources.close({ allowed: true }); - else ui.resources.render({ force: true }); - } - } - - const globalOverrides = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.GlobalOverrides); - globalOverrides.diceSoNiceSFXUpdate(this); - } } diff --git a/module/data/settings/GlobalOverrides.mjs b/module/data/settings/GlobalOverrides.mjs deleted file mode 100644 index 746a6355..00000000 --- a/module/data/settings/GlobalOverrides.mjs +++ /dev/null @@ -1,55 +0,0 @@ -import DhAppearance from './Appearance.mjs'; - -/** - * A setting to handle cases where we want to allow the GM to set a global default for client settings. - */ -export default class DhGlobalOverrides extends foundry.abstract.DataModel { - static defineSchema() { - const fields = foundry.data.fields; - return { - diceSoNice: new fields.SchemaField({ - sfx: new fields.SchemaField({ - overrideEnabled: new fields.BooleanField(), - global: new fields.SchemaField({ - critical: DhAppearance.sfxSchema() - }), - hope: new fields.SchemaField({ - higher: DhAppearance.sfxSchema() - }), - fear: new fields.SchemaField({ - higher: DhAppearance.sfxSchema() - }) - }) - }) - }; - } - - async diceSoNiceSFXUpdate(appearanceSettings, enabled) { - if (!game.user.isGM) return; - - const newEnabled = enabled !== undefined ? enabled : this.diceSoNice.sfx.overrideEnabled; - if (newEnabled) { - const newOverrides = foundry.utils.mergeObject(this.toObject(), { - diceSoNice: { - sfx: { - overrideEnabled: true, - global: appearanceSettings.diceSoNice.sfx, - hope: appearanceSettings.diceSoNice.hope.sfx, - fear: appearanceSettings.diceSoNice.fear.sfx - } - } - }); - await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.GlobalOverrides, newOverrides); - } else { - const newOverrides = { - ...this.toObject(), - diceSoNice: { - sfx: { - overrideEnabled: false - } - } - }; - await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.GlobalOverrides, newOverrides); - } - } -} diff --git a/module/data/settings/Homebrew.mjs b/module/data/settings/Homebrew.mjs index d4b7b03f..b8804fa7 100644 --- a/module/data/settings/Homebrew.mjs +++ b/module/data/settings/Homebrew.mjs @@ -145,16 +145,6 @@ export default class DhHomebrew extends foundry.abstract.DataModel { description: new fields.StringField() }) ), - resources: new fields.TypedObjectField( - new fields.SchemaField({ - resources: new fields.TypedObjectField(new fields.EmbeddedDataField(Resource)) - }), - { - initial: { - character: { resources: {} } - } - } - ), itemFeatures: new fields.SchemaField({ weaponFeatures: new fields.TypedObjectField( new fields.SchemaField({ @@ -195,117 +185,4 @@ export default class DhHomebrew extends foundry.abstract.DataModel { } return source; } - - /** Invoked by the setting when data changes */ - handleChange() { - if (this.maxFear) { - if (ui.resources) ui.resources.render({ force: true }); - } - - this.refreshConfig(); - this.#resetActors(); - } - - /** Update config values based on homebrew data. Make sure the references don't change */ - refreshConfig() { - for (const [actorType, actorData] of Object.entries(this.resources)) { - const config = CONFIG.DH.RESOURCE[actorType]; - for (const key of Object.keys(config.all)) { - delete config.all[key]; - } - Object.assign(config.all, { - ...Object.entries(actorData.resources).reduce((result, [key, value]) => { - result[key] = value.toObject(); - result[key].id = key; - return result; - }, {}), - ...config.custom, - ...config.base - }); - } - } - - /** - * Triggers a reset and non-forced re-render on all given actors (if given) - * or all world actors and actors in all scenes to show immediate results for a changed setting. - */ - #resetActors() { - const actors = new Set( - [ - game.actors.contents, - game.scenes.contents.flatMap(s => s.tokens.contents).flatMap(t => t.actor ?? []) - ].flat() - ); - for (const actor of actors) { - for (const app of Object.values(actor.apps)) { - for (const element of app.element?.querySelectorAll('prose-mirror.active')) { - element.open = false; // This triggers a save - } - } - - actor.reset(); - actor.render(); - } - } } - -export class Resource extends foundry.abstract.DataModel { - static defineSchema() { - const fields = foundry.data.fields; - return { - initial: new fields.NumberField({ - required: true, - integer: true, - initial: 0, - min: 0, - label: 'DAGGERHEART.GENERAL.initial' - }), - max: new fields.NumberField({ - nullable: true, - initial: null, - min: 0, - label: 'DAGGERHEART.GENERAL.max' - }), - label: new fields.StringField({ label: 'DAGGERHEART.GENERAL.label' }), - images: new fields.SchemaField({ - full: imageIconField('fa solid fa-circle'), - empty: imageIconField('fa-regular fa-circle') - }) - }; - } - - static getDefaultResourceData = label => { - const images = Resource.schema.fields.images.getInitialValue(); - return { - initial: 0, - max: 0, - label: label ?? '', - images - }; - }; - - static getDefaultImageData = imageKey => { - return Resource.schema.fields.images.fields[imageKey].getInitialValue(); - }; -} - -const imageIconField = defaultValue => - new foundry.data.fields.SchemaField( - { - value: new foundry.data.fields.StringField({ - initial: defaultValue, - label: 'DAGGERHEART.SETTINGS.Homebrew.FIELDS.resources.resources.value.label' - }), - isIcon: new foundry.data.fields.BooleanField({ - required: true, - initial: true, - label: 'DAGGERHEART.SETTINGS.Homebrew.FIELDS.resources.resources.isIcon.label' - }), - noColorFilter: new foundry.data.fields.BooleanField({ - required: true, - initial: false, - label: 'DAGGERHEART.SETTINGS.Homebrew.FIELDS.resources.resources.noColorFilter.label' - }) - }, - { required: true } - ); diff --git a/module/data/settings/Metagaming.mjs b/module/data/settings/Metagaming.mjs deleted file mode 100644 index 2bb5afdf..00000000 --- a/module/data/settings/Metagaming.mjs +++ /dev/null @@ -1,12 +0,0 @@ -export default class DhMetagaming extends foundry.abstract.DataModel { - static defineSchema() { - const fields = foundry.data.fields; - return { - hideObserverPermissionInChat: new fields.BooleanField({ - initial: false, - label: 'DAGGERHEART.SETTINGS.Metagaming.FIELDS.hideObserverPermissionInChat.label', - hint: 'DAGGERHEART.SETTINGS.Metagaming.FIELDS.hideObserverPermissionInChat.hint' - }) - }; - } -} diff --git a/module/data/settings/_module.mjs b/module/data/settings/_module.mjs index 1343c0c4..db1fbfec 100644 --- a/module/data/settings/_module.mjs +++ b/module/data/settings/_module.mjs @@ -1,6 +1,4 @@ export { default as DhAppearance } from './Appearance.mjs'; export { default as DhAutomation } from './Automation.mjs'; export { default as DhHomebrew } from './Homebrew.mjs'; -export { default as DhMetagaming } from './Metagaming.mjs'; export { default as DhVariantRules } from './VariantRules.mjs'; -export { default as DhGlobalOverrides } from './GlobalOverrides.mjs'; diff --git a/module/dice/dhRoll.mjs b/module/dice/dhRoll.mjs index 912824e7..d8e5f6dd 100644 --- a/module/dice/dhRoll.mjs +++ b/module/dice/dhRoll.mjs @@ -140,14 +140,8 @@ export default class DHRoll extends Roll { /** @inheritDoc */ async render({ flavor, template = this.constructor.CHAT_TEMPLATE, isPrivate = false, ...options } = {}) { if (!this._evaluated) return; - - const metagamingSettings = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Metagaming); const chatData = await this._prepareChatRenderContext({ flavor, isPrivate, ...options }); - return foundry.applications.handlebars.renderTemplate(template, { - ...chatData, - parent: chatData.parent, - metagamingSettings - }); + return foundry.applications.handlebars.renderTemplate(template, chatData); } /** @inheritDoc */ diff --git a/module/dice/dualityRoll.mjs b/module/dice/dualityRoll.mjs index 75fbdf55..9037250a 100644 --- a/module/dice/dualityRoll.mjs +++ b/module/dice/dualityRoll.mjs @@ -378,8 +378,6 @@ export default class DualityRoll extends D20Roll { let parsedRoll = game.system.api.dice.DualityRoll.fromData({ ...rollString, evaluated: false }); const term = parsedRoll.terms[target.dataset.dieIndex]; await term.reroll(`/r1=${term.total}`); - const result = await parsedRoll.evaluate(); - if (game.modules.get('dice-so-nice')?.active) { const diceSoNiceRoll = { _evaluated: true, @@ -393,7 +391,7 @@ export default class DualityRoll extends D20Roll { options: { appearance: {} } }; - const diceSoNicePresets = await getDiceSoNicePresets(result, `d${term._faces}`, `d${term._faces}`); + const diceSoNicePresets = await getDiceSoNicePresets(`d${term._faces}`, `d${term._faces}`); const type = target.dataset.type; if (diceSoNicePresets[type]) { diceSoNiceRoll.dice[0].options = diceSoNicePresets[type]; @@ -402,6 +400,8 @@ export default class DualityRoll extends D20Roll { await game.dice3d.showForRoll(diceSoNiceRoll, game.user, true); } + await parsedRoll.evaluate(); + const newRoll = game.system.api.dice.DualityRoll.postEvaluate(parsedRoll, { targets: message.system.targets, roll: { diff --git a/module/documents/chatMessage.mjs b/module/documents/chatMessage.mjs index 53921329..668ad06b 100644 --- a/module/documents/chatMessage.mjs +++ b/module/documents/chatMessage.mjs @@ -68,11 +68,8 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage { document = fromUuidSync(uuid); if (!document) return; + e.setAttribute('data-view-perm', document.testUserPermission(game.user, 'OBSERVER')); e.setAttribute('data-use-perm', document.testUserPermission(game.user, 'OWNER')); - - const settings = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Metagaming); - if (settings.hideObserverPermissionInChat) - e.setAttribute('data-view-perm', document.testUserPermission(game.user, 'OBSERVER')); }); if (this.isContentVisible) { diff --git a/module/documents/tooltipManager.mjs b/module/documents/tooltipManager.mjs index 4793f1f7..c4b52bb5 100644 --- a/module/documents/tooltipManager.mjs +++ b/module/documents/tooltipManager.mjs @@ -3,7 +3,6 @@ import { AdversaryBPPerEncounter, BaseBPPerEncounter } from '../config/encounter export default class DhTooltipManager extends foundry.helpers.interaction.TooltipManager { #wide = false; #bordered = false; - #active = false; async activate(element, options = {}) { const { TextEditor } = foundry.applications.ux; @@ -169,100 +168,7 @@ export default class DhTooltipManager extends foundry.helpers.interaction.Toolti } } - this.baseActivate(element, { ...options, html: html }); - } - - /* Need to pass more options to _setAnchor, so have to copy whole foundry method >_< */ - async baseActivate(element, options) { - let { text, direction, cssClass, locked = false, html, content } = options; - if (content && !html) { - foundry.utils.logCompatibilityWarning( - 'The content option has been deprecated in favor of the html option', - { since: 13, until: 15, once: true } - ); - html = content; - } - if (text && html) throw new Error('Cannot provide both text and html options to TooltipManager#activate.'); - // Deactivate currently active element - this.deactivate(); - // Check if the element still exists in the DOM. - if (!document.body.contains(element)) return; - // Mark the new element as active - this.#active = true; - this.element = element; - element.setAttribute('aria-describedby', 'tooltip'); - html ||= element.dataset.tooltipHtml; - if (html) { - if (typeof html === 'string') this.tooltip.innerHTML = foundry.utils.cleanHTML(html); - else { - this.tooltip.innerHTML = ''; // Clear existing HTML - this.tooltip.appendChild(html); - } - } else { - text ||= element.dataset.tooltipText; - if (text) this.tooltip.textContent = text; - else { - text = element.dataset.tooltip; - // Localized message should be safe - if (game.i18n.has(text)) this.tooltip.innerHTML = game.i18n.localize(text); - else this.tooltip.innerHTML = foundry.utils.cleanHTML(text); - } - } - - // Activate display of the tooltip - this.tooltip.removeAttribute('class'); - this.tooltip.classList.add('active', 'themed', 'theme-dark'); - this.tooltip.showPopover(); - cssClass ??= element.closest('[data-tooltip-class]')?.dataset.tooltipClass; - if (cssClass) this.tooltip.classList.add(...cssClass.split(' ')); - - // Set tooltip position - direction ??= element.closest('[data-tooltip-direction]')?.dataset.tooltipDirection; - if (!direction) direction = this._determineDirection(); - this._setAnchor(direction, options); - - if (locked || element.dataset.hasOwnProperty('locked')) this.lockTooltip(); - } - - _setAnchor(direction, options) { - const directions = this.constructor.TOOLTIP_DIRECTIONS; - const pad = this.constructor.TOOLTIP_MARGIN_PX; - const pos = this.element.getBoundingClientRect(); - - const { innerHeight, innerWidth } = this.tooltip.ownerDocument.defaultView; - const tooltipPadding = 16; - const horizontalOffset = options.noOffset ? tooltipPadding : this.tooltip.offsetWidth / 2 - pos.width / 2; - const verticalOffset = options.noOffset ? tooltipPadding : this.tooltip.offsetHeight / 2 - pos.height / 2; - - const style = {}; - switch (direction) { - case directions.DOWN: - style.textAlign = 'center'; - style.left = pos.left - horizontalOffset; - style.top = pos.bottom + pad; - break; - case directions.LEFT: - style.textAlign = 'left'; - style.right = innerWidth - pos.left + pad; - style.top = pos.top - verticalOffset; - break; - case directions.RIGHT: - style.textAlign = 'right'; - style.left = pos.right + pad; - style.top = pos.top - verticalOffset; - break; - case directions.UP: - style.textAlign = 'center'; - style.left = pos.left - horizontalOffset; - style.bottom = innerHeight - pos.top + pad; - break; - case directions.CENTER: - style.textAlign = 'center'; - style.left = pos.left - horizontalOffset; - style.top = pos.top - verticalOffset; - break; - } - return this._setStyle(style); + super.activate(element, { ...options, html: html }); } _determineItemTooltipDirection(element, prefered = this.constructor.TOOLTIP_DIRECTIONS.LEFT) { @@ -364,12 +270,6 @@ export default class DhTooltipManager extends foundry.helpers.interaction.Toolti return clone; } - /**@inheritdoc */ - dismissLockedTooltips() { - super.dismissLockedTooltips(); - Hooks.callAll(CONFIG.DH.HOOKS.hooksConfig.lockedTooltipDismissed); - } - /** Get HTML for Battlepoints tooltip */ async getBattlepointHTML(combatId) { const combat = game.combats.get(combatId); diff --git a/module/helpers/utils.mjs b/module/helpers/utils.mjs index b49a98ca..c8b62ff6 100644 --- a/module/helpers/utils.mjs +++ b/module/helpers/utils.mjs @@ -60,13 +60,7 @@ export const getCommandTarget = (options = {}) => { export const setDiceSoNiceForDualityRoll = async (rollResult, advantageState, hopeFaces, fearFaces, advantageFaces) => { if (!game.modules.get('dice-so-nice')?.active) return; - const diceSoNicePresets = await getDiceSoNicePresets( - rollResult, - hopeFaces, - fearFaces, - advantageFaces, - advantageFaces - ); + const diceSoNicePresets = await getDiceSoNicePresets(hopeFaces, fearFaces, advantageFaces, advantageFaces); rollResult.dice[0].options = diceSoNicePresets.hope; rollResult.dice[1].options = diceSoNicePresets.fear; if (rollResult.dice[2] && advantageState) { @@ -384,18 +378,17 @@ export const arraysEqual = (a, b) => export const setsEqual = (a, b) => a.size === b.size && [...a].every(value => b.has(value)); -export function getScrollTextData(actor, resource, key) { +export function getScrollTextData(resources, resource, key) { + const { reversed, label } = CONFIG.DH.ACTOR.scrollingTextResource[key]; const { BOTTOM, TOP } = CONST.TEXT_ANCHOR_POINTS; - - const resources = actor.system.resources; const increased = resources[key].value < resource.value; const value = -1 * (resources[key].value - resource.value); - const { label, isReversed } = resources[key]; const text = `${game.i18n.localize(label)} ${value.signedString()}`; - const stroke = increased ? (isReversed ? 0xffffff : 0x000000) : isReversed ? 0x000000 : 0xffffff; - const fill = increased ? (isReversed ? 0x0032b1 : 0xffe760) : isReversed ? 0xffe760 : 0x0032b1; - const direction = increased ? (isReversed ? BOTTOM : TOP) : isReversed ? TOP : BOTTOM; + + const stroke = increased ? (reversed ? 0xffffff : 0x000000) : reversed ? 0x000000 : 0xffffff; + const fill = increased ? (reversed ? 0x0032b1 : 0xffe760) : reversed ? 0xffe760 : 0x0032b1; + const direction = increased ? (reversed ? BOTTOM : TOP) : reversed ? TOP : BOTTOM; return { text, stroke, fill, direction }; } diff --git a/module/systemRegistration/handlebars.mjs b/module/systemRegistration/handlebars.mjs index f51e1035..ad8c741a 100644 --- a/module/systemRegistration/handlebars.mjs +++ b/module/systemRegistration/handlebars.mjs @@ -17,10 +17,9 @@ export const preloadHandlebarsTemplates = async function () { 'systems/daggerheart/templates/sheets/global/partials/resource-section/dice-value.hbs', 'systems/daggerheart/templates/sheets/global/partials/resource-section/die.hbs', 'systems/daggerheart/templates/sheets/global/partials/resource-bar.hbs', - 'systems/daggerheart/templates/sheets/global/partials/feature-section-item.hbs', - 'systems/daggerheart/templates/sheets/global/partials/item-tags.hbs', 'systems/daggerheart/templates/components/card-preview.hbs', 'systems/daggerheart/templates/levelup/parts/selectable-card-preview.hbs', + 'systems/daggerheart/templates/sheets/global/partials/feature-section-item.hbs', 'systems/daggerheart/templates/ui/combatTracker/combatTrackerSection.hbs', 'systems/daggerheart/templates/actionTypes/damage.hbs', 'systems/daggerheart/templates/actionTypes/resource.hbs', @@ -34,7 +33,6 @@ export const preloadHandlebarsTemplates = async function () { 'systems/daggerheart/templates/actionTypes/beastform.hbs', 'systems/daggerheart/templates/actionTypes/countdown.hbs', 'systems/daggerheart/templates/actionTypes/summon.hbs', - 'systems/daggerheart/templates/actionTypes/transform.hbs', 'systems/daggerheart/templates/settings/components/settings-item-line.hbs', 'systems/daggerheart/templates/ui/tooltip/parts/tooltipChips.hbs', 'systems/daggerheart/templates/ui/tooltip/parts/tooltipTags.hbs', @@ -46,7 +44,6 @@ export const preloadHandlebarsTemplates = async function () { 'systems/daggerheart/templates/ui/chat/parts/target-part.hbs', 'systems/daggerheart/templates/ui/chat/parts/button-part.hbs', 'systems/daggerheart/templates/ui/itemBrowser/itemContainer.hbs', - 'systems/daggerheart/templates/scene/dh-config.hbs', - 'systems/daggerheart/templates/settings/appearance-settings/diceSoNiceTab.hbs' + 'systems/daggerheart/templates/scene/dh-config.hbs' ]); }; diff --git a/module/systemRegistration/settings.mjs b/module/systemRegistration/settings.mjs index e7ec37f5..c4acf7ed 100644 --- a/module/systemRegistration/settings.mjs +++ b/module/systemRegistration/settings.mjs @@ -1,18 +1,10 @@ import { defaultLevelTiers, DhLevelTiers } from '../data/levelTier.mjs'; import DhCountdowns from '../data/countdowns.mjs'; -import { - DhAppearance, - DhAutomation, - DhGlobalOverrides, - DhHomebrew, - DhMetagaming, - DhVariantRules -} from '../data/settings/_module.mjs'; +import { DhAppearance, DhAutomation, DhHomebrew, DhVariantRules } from '../data/settings/_module.mjs'; import { DhAppearanceSettings, DhAutomationSettings, DhHomebrewSettings, - DhMetagamingSettings, DhVariantRuleSettings } from '../applications/settings/_module.mjs'; import { CompendiumBrowserSettings, DhTagTeamRoll } from '../data/_module.mjs'; @@ -46,25 +38,18 @@ const registerMenuSettings = () => { type: DhAutomation }); - game.settings.register(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Metagaming, { - scope: 'world', - config: false, - type: DhMetagaming - }); - game.settings.register(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew, { scope: 'world', config: false, type: DhHomebrew, onChange: value => { - value.handleChange(); - } - }); + if (value.maxFear) { + if (ui.resources) ui.resources.render({ force: true }); + } - game.settings.register(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.GlobalOverrides, { - scope: 'world', - config: false, - type: DhGlobalOverrides + // Some homebrew settings may change sheets in various ways, so trigger a re-render + resetActors(); + } }); game.settings.register(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance, { @@ -72,7 +57,12 @@ const registerMenuSettings = () => { config: false, type: DhAppearance, onChange: value => { - value.handleChange(); + if (value.displayFear) { + if (ui.resources) { + if (value.displayFear === 'hide') ui.resources.close({ allowed: true }); + else ui.resources.render({ force: true }); + } + } } }); }; @@ -86,16 +76,6 @@ const registerMenus = () => { type: DhAutomationSettings, restricted: true }); - - game.settings.registerMenu(CONFIG.DH.id, CONFIG.DH.SETTINGS.menu.Metagaming.Name, { - name: game.i18n.localize('DAGGERHEART.SETTINGS.Menu.metagaming.name'), - label: game.i18n.localize('DAGGERHEART.SETTINGS.Menu.metagaming.label'), - hint: game.i18n.localize('DAGGERHEART.SETTINGS.Menu.metagaming.hint'), - icon: CONFIG.DH.SETTINGS.menu.Metagaming.Icon, - type: DhMetagamingSettings, - restricted: true - }); - game.settings.registerMenu(CONFIG.DH.id, CONFIG.DH.SETTINGS.menu.Homebrew.Name, { name: game.i18n.localize('DAGGERHEART.SETTINGS.Menu.homebrew.name'), label: game.i18n.localize('DAGGERHEART.SETTINGS.Menu.homebrew.label'), @@ -164,8 +144,30 @@ const registerNonConfigSettings = () => { }); game.settings.register(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.CompendiumBrowserSettings, { - scope: 'world', + scope: 'client', config: false, type: CompendiumBrowserSettings }); }; + +/** + * Triggers a reset and non-forced re-render on all given actors (if given) + * or all world actors and actors in all scenes to show immediate results for a changed setting. + */ +function resetActors(actors) { + actors ??= [ + game.actors.contents, + game.scenes.contents.flatMap(s => s.tokens.contents).flatMap(t => t.actor ?? []) + ].flat(); + actors = new Set(actors); + for (const actor of actors) { + for (const app of Object.values(actor.apps)) { + for (const element of app.element?.querySelectorAll('prose-mirror.active')) { + element.open = false; // This triggers a save + } + } + + actor.reset(); + actor.render(); + } +} diff --git a/src/packs/adversaries/adversary_Fallen_Warlord__Realm_Breaker_hxZ0sgoFJubh5aj6.json b/src/packs/adversaries/adversary_Fallen_Warlord__Realm_Breaker_hxZ0sgoFJubh5aj6.json index 8f3865e9..b2cdc489 100644 --- a/src/packs/adversaries/adversary_Fallen_Warlord__Realm_Breaker_hxZ0sgoFJubh5aj6.json +++ b/src/packs/adversaries/adversary_Fallen_Warlord__Realm_Breaker_hxZ0sgoFJubh5aj6.json @@ -717,35 +717,7 @@ "system": { "description": "

When the @Lookup[@name] marks their last HP, replace them with the @UUID[Compendium.daggerheart.adversaries.Actor.RXkZTwBRi4dJ3JE5]{Fallen Warlord: Undefeated Champion} and immediately spotlight them.

", "resource": null, - "actions": { - "gP426WmWbtrZEWCD": { - "type": "transform", - "_id": "gP426WmWbtrZEWCD", - "systemPath": "actions", - "baseAction": false, - "description": "", - "chatDisplay": true, - "originItem": { - "type": "itemCollection" - }, - "actionType": "action", - "triggers": [], - "cost": [], - "uses": { - "value": null, - "max": null, - "recovery": null, - "consumeOnSuccess": false - }, - "transform": { - "actorUUID": "Compendium.daggerheart.adversaries.Actor.RXkZTwBRi4dJ3JE5", - "resourceRefresh": { - "hitPoints": true, - "stress": true - } - } - } - }, + "actions": {}, "originItemType": null, "originId": null, "featureForm": "reaction" diff --git a/src/packs/adversaries/adversary_Volcanic_Dragon__Molten_Scourge_eArAPuB38CNR0ZIM.json b/src/packs/adversaries/adversary_Volcanic_Dragon__Molten_Scourge_eArAPuB38CNR0ZIM.json index 7f9deb6c..b23da064 100644 --- a/src/packs/adversaries/adversary_Volcanic_Dragon__Molten_Scourge_eArAPuB38CNR0ZIM.json +++ b/src/packs/adversaries/adversary_Volcanic_Dragon__Molten_Scourge_eArAPuB38CNR0ZIM.json @@ -846,37 +846,7 @@ "system": { "description": "

When the @Lookup[@name] marks their last HP, replace them with the @UUID[Compendium.daggerheart.adversaries.Actor.pMuXGCSOQaxpi5tb]{Ashen Tyrant} and immediately spotlight them.

", "resource": null, - "actions": { - "cFqFjemAfAjB0OB0": { - "type": "transform", - "_id": "cFqFjemAfAjB0OB0", - "systemPath": "actions", - "baseAction": false, - "description": "", - "chatDisplay": true, - "originItem": { - "type": "itemCollection" - }, - "actionType": "action", - "triggers": [], - "cost": [], - "uses": { - "value": null, - "max": "", - "recovery": null, - "consumeOnSuccess": false - }, - "transform": { - "actorUUID": "Compendium.daggerheart.adversaries.Actor.pMuXGCSOQaxpi5tb", - "resourceRefresh": { - "hitPoints": true, - "stress": true - } - }, - "name": "Transform", - "range": "" - } - }, + "actions": {}, "originItemType": null, "originId": null, "featureForm": "reaction" diff --git a/src/packs/adversaries/adversary_Volcanic_Dragon__Obsidian_Predator_ladm7wykhZczYzrQ.json b/src/packs/adversaries/adversary_Volcanic_Dragon__Obsidian_Predator_ladm7wykhZczYzrQ.json index 5f32aae5..2e2adbdd 100644 --- a/src/packs/adversaries/adversary_Volcanic_Dragon__Obsidian_Predator_ladm7wykhZczYzrQ.json +++ b/src/packs/adversaries/adversary_Volcanic_Dragon__Obsidian_Predator_ladm7wykhZczYzrQ.json @@ -742,37 +742,7 @@ "system": { "description": "

When the @Lookup[@name] marks their last HP, replace them with the @UUID[Compendium.daggerheart.adversaries.Actor.eArAPuB38CNR0ZIM]{Molten Scourge} and immediately spotlight them.

", "resource": null, - "actions": { - "OxGkCGgIl4vGFufD": { - "type": "transform", - "_id": "OxGkCGgIl4vGFufD", - "systemPath": "actions", - "baseAction": false, - "description": "", - "chatDisplay": true, - "originItem": { - "type": "itemCollection" - }, - "actionType": "action", - "triggers": [], - "cost": [], - "uses": { - "value": null, - "max": "", - "recovery": null, - "consumeOnSuccess": false - }, - "transform": { - "actorUUID": "Compendium.daggerheart.adversaries.Actor.eArAPuB38CNR0ZIM", - "resourceRefresh": { - "hitPoints": true, - "stress": true - } - }, - "name": "Transform", - "range": "" - } - }, + "actions": {}, "originItemType": null, "originId": null, "featureForm": "reaction" diff --git a/src/packs/domains/domainCard_Book_of_Tyfar_1VXzwRbvbBj5bd5V.json b/src/packs/domains/domainCard_Book_of_Tyfar_1VXzwRbvbBj5bd5V.json index 4eabb038..5e5cb054 100644 --- a/src/packs/domains/domainCard_Book_of_Tyfar_1VXzwRbvbBj5bd5V.json +++ b/src/packs/domains/domainCard_Book_of_Tyfar_1VXzwRbvbBj5bd5V.json @@ -153,9 +153,9 @@ }, "effects": [], "roll": { - "type": "spellcast", + "type": null, "trait": null, - "difficulty": 13, + "difficulty": null, "bonus": null, "advState": "neutral", "diceRolling": { diff --git a/styles/less/global/elements.less b/styles/less/global/elements.less index beffefbb..f5e92e2c 100755 --- a/styles/less/global/elements.less +++ b/styles/less/global/elements.less @@ -565,11 +565,60 @@ } .application.setting.dh-style { - h2, - h3, - h4 { - margin: 8px 0 4px; - text-align: center; + fieldset { + h2, + h3, + h4 { + margin: 8px 0 4px; + text-align: center; + } + .title-hint { + font-size: var(--font-size-12); + font-variant: small-caps; + text-align: center; + } + + .field-section { + display: flex; + flex-direction: column; + gap: 10px; + + .split-section { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 10px; + } + } + + .label-container { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 10px; + + &.full-width { + grid-template-columns: 1fr 1fr 1fr 1fr; + + select { + grid-column: span 3; + } + } + + label { + align-self: center; + text-align: center; + white-space: nowrap; + } + } + + .button-container { + display: grid; + grid-template-columns: 1fr; + gap: 10px; + text-align: center; + display: flex; + justify-content: center; + width: 100%; + } } footer { diff --git a/styles/less/global/global.less b/styles/less/global/global.less index b9af67c0..fb995b8c 100644 --- a/styles/less/global/global.less +++ b/styles/less/global/global.less @@ -73,24 +73,6 @@ } } } - - .item-tags { - display: flex; - gap: 10px; - - .tag { - align-items: center; - background: light-dark(@dark-15, @beige-15); - border-radius: 3px; - border: 1px solid light-dark(@dark, @beige); - display: flex; - flex-direction: row; - flex-wrap: wrap; - font-size: var(--font-size-12); - justify-content: start; - padding: 3px 5px; - } - } } /* TODO: Remove me when this issue is resolved https://github.com/foundryvtt/foundryvtt/issues/13734 */ diff --git a/styles/less/global/inventory-item.less b/styles/less/global/inventory-item.less index 4bd4d0bb..d703d189 100644 --- a/styles/less/global/inventory-item.less +++ b/styles/less/global/inventory-item.less @@ -138,6 +138,24 @@ display: none; } } + + .item-tags { + display: flex; + gap: 10px; + + .tag { + align-items: center; + background: light-dark(@dark-15, @beige-15); + border-radius: 3px; + border: 1px solid light-dark(@dark, @beige); + display: flex; + flex-direction: row; + flex-wrap: wrap; + font-size: var(--font-size-12); + justify-content: start; + padding: 3px 5px; + } + } } .item-resource { diff --git a/styles/less/sheets/actions/actions.less b/styles/less/sheets/actions/actions.less index 5c21dc60..9be56c8e 100644 --- a/styles/less/sheets/actions/actions.less +++ b/styles/less/sheets/actions/actions.less @@ -4,78 +4,48 @@ display: flex; flex-direction: column; gap: 10px; - } - .transform-container { - width: 100%; - display: flex; - flex-direction: column; - gap: 10px; - - .transform-resources { + .actor-summon-line { display: flex; - flex-direction: column; + align-items: center; + gap: 5px; + border-radius: 3px; - .transform-resource { + .actor-summon-name { + flex: 2; display: flex; align-items: center; - gap: 2px; + gap: 5px; - .resource-title { - font-size: var(--font-size-18); + img { + height: 40px; + } + } + + .actor-summon-controls { + flex: 1; + display: flex; + align-items: center; + gap: 5px; + + .controls { + display: flex; + gap: 5px; } } } - } - .actor-drop-line { - display: flex; - align-items: center; - gap: 5px; - border-radius: 3px; - - .actor-drop-name { - flex: 2; + .summon-dragger { display: flex; align-items: center; - gap: 5px; - - img { - height: 40px; - } + justify-content: center; + box-sizing: border-box; + height: 40px; + margin-top: 10px; + border: 1px dashed light-dark(@dark-blue-50, @beige-50); + border-radius: 3px; + color: light-dark(@dark-blue-50, @beige-50); } - - .actor-drop-controls { - flex: 1; - display: flex; - align-items: center; - gap: 5px; - - &.transform { - justify-content: flex-end; - } - - .controls { - display: flex; - gap: 5px; - } - } - - .actor-drop-hint { - flex: none; - } - } - - .drop-dragger { - display: flex; - align-items: center; - justify-content: center; - box-sizing: border-box; - height: 40px; - margin-top: 10px; - border: 1px dashed light-dark(@dark-blue-50, @beige-50); - border-radius: 3px; - color: light-dark(@dark-blue-50, @beige-50); } .trigger-data { diff --git a/styles/less/sheets/actors/character/header.less b/styles/less/sheets/actors/character/header.less index 31fd4256..5e8ef002 100644 --- a/styles/less/sheets/actors/character/header.less +++ b/styles/less/sheets/actors/character/header.less @@ -133,19 +133,8 @@ padding: 0; margin-bottom: 15px; - .resource-section { - display: flex; - align-items: center; - gap: 4px; + .hope-section { margin-right: 20px; - - .resource-manager { - transition: all 0.1s ease; - - &.inverted { - transform: rotate(180deg); - } - } } .downtime-section { diff --git a/styles/less/ui/chat/chat.less b/styles/less/ui/chat/chat.less index e9ef9147..3591fc65 100644 --- a/styles/less/ui/chat/chat.less +++ b/styles/less/ui/chat/chat.less @@ -450,10 +450,6 @@ .target-data { flex: 1; - - .target-name { - text-align: left; - } } .target-save { diff --git a/styles/less/ui/index.less b/styles/less/ui/index.less index 31ea8955..065e43c5 100644 --- a/styles/less/ui/index.less +++ b/styles/less/ui/index.less @@ -27,8 +27,6 @@ @import './settings/settings.less'; @import './settings/homebrew-settings/domains.less'; @import './settings/homebrew-settings/types.less'; -@import './settings/homebrew-settings/resources.less'; -@import './settings/appearance-settings/diceSoNice.less'; @import './sidebar/tabs.less'; @import './sidebar/daggerheartMenu.less'; diff --git a/styles/less/ui/item-browser/item-browser.less b/styles/less/ui/item-browser/item-browser.less index f558a0ba..b395f8c8 100644 --- a/styles/less/ui/item-browser/item-browser.less +++ b/styles/less/ui/item-browser/item-browser.less @@ -304,15 +304,7 @@ padding: 0 0 0 50px; display: flex; flex-direction: column; - - .item-description-outer-container:has(div, p) { - margin-top: 8px; - } - - /* Some items don't include an outer container, so we attempt a catch-all */ - > *:last-child { - padding-bottom: 6px; - } + gap: 5px; h1 { font-size: var(--font-size-32); @@ -358,7 +350,6 @@ .filter-content, .item-desc { display: grid; - opacity: 0; grid-template-rows: 0fr; transition: all 0.3s ease-in-out; width: 100%; @@ -387,8 +378,8 @@ } .expanded + .extensible { - opacity: 1; grid-template-rows: 1fr; + padding-top: 10px; } .welcome-message { diff --git a/styles/less/ui/settings/appearance-settings/diceSoNice.less b/styles/less/ui/settings/appearance-settings/diceSoNice.less deleted file mode 100644 index 079bebc5..00000000 --- a/styles/less/ui/settings/appearance-settings/diceSoNice.less +++ /dev/null @@ -1,72 +0,0 @@ -.daggerheart.dh-style.setting.appearance-settings { - .tab.active[data-tab='diceSoNice'] { - display: flex; - flex-direction: column; - align-items: center; - gap: 0.5rem; - } - - .diceSoNice-footer { - display: grid; - align-items: center; - grid-template-columns: 1fr 1fr 1fr 1fr; - gap: 8px; - margin-top: 32px; - - label { - text-align: center; - } - - select { - grid-column: span 2; - } - } - - .title-hint { - font-size: var(--font-size-14); - font-variant: small-caps; - text-align: center; - } - - .split-section { - display: grid; - grid-template-columns: 1fr 1fr; - gap: 10px; - - > label { - grid-column: span 2; - text-align: center; - font-size: var(--font-size-18); - font-weight: bold; - } - } - - .field-section { - display: flex; - flex-direction: column; - gap: 10px; - margin-bottom: 4px; - width: 100%; - padding: 0 8px; - } - - .label-container { - display: grid; - grid-template-columns: 1fr 1fr; - gap: 10px; - - &.full-width { - grid-template-columns: 1fr 1fr 1fr 1fr; - - select { - grid-column: span 3; - } - } - - label { - align-self: center; - text-align: center; - white-space: nowrap; - } - } -} diff --git a/styles/less/ui/settings/homebrew-settings/resources.less b/styles/less/ui/settings/homebrew-settings/resources.less deleted file mode 100644 index 5333e54d..00000000 --- a/styles/less/ui/settings/homebrew-settings/resources.less +++ /dev/null @@ -1,87 +0,0 @@ -.daggerheart.dh-style.setting.homebrew-settings .resources.tab { - .resource-types-container { - display: flex; - flex-direction: column; - gap: 16px; - overflow: auto; - max-height: 570px; - - fieldset legend { - display: flex; - align-items: center; - gap: 4px; - } - - .resource-type-container { - width: 100%; - - .resources-container { - display: flex; - flex-direction: column; - gap: 4px; - - .resource-container { - .resource-icons-container { - display: flex; - justify-content: space-between; - gap: 8px; - width: 100%; - - .resource-icon-container { - display: flex; - flex-direction: column; - gap: 4px; - flex: 1; - - .resource-icon-title-container { - display: flex; - align-items: center; - justify-content: center; - gap: 4px; - - &::before, - &::after { - color: @dark-blue; - content: ''; - flex: 1; - height: 2px; - } - - &::before { - background: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, @golden 100%); - } - - &::after { - background: linear-gradient(90deg, @golden 0%, rgba(0, 0, 0, 0) 100%); - } - - .resource-icon-title { - font-size: var(--font-size-16); - white-space: nowrap; - display: flex; - align-items: center; - gap: 4px; - color: light-dark(@dark-blue, @golden); - - i { - font-size: 14px; - } - } - } - } - } - } - } - } - } - - .two-columns { - width: 100%; - } - - .form-group.vertical { - > * { - flex: 0 0 100%; - } - } -} diff --git a/styles/less/ux/index.less b/styles/less/ux/index.less index c6c40f78..0bd1b71e 100644 --- a/styles/less/ux/index.less +++ b/styles/less/ux/index.less @@ -4,5 +4,3 @@ @import './tooltip/domain-cards.less'; @import './autocomplete/autocomplete.less'; - -@import './tooltip/resource-management.less'; diff --git a/styles/less/ux/tooltip/resource-management.less b/styles/less/ux/tooltip/resource-management.less deleted file mode 100644 index ff1f4dd2..00000000 --- a/styles/less/ux/tooltip/resource-management.less +++ /dev/null @@ -1,56 +0,0 @@ -.bordered-tooltip.locked-tooltip .daggerheart.resource-management-container, -#tooltip .daggerheart.resource-management-container { - display: flex; - flex-direction: column; - gap: 16px; - - .resource-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; - - h4 { - font-family: var(--dh-font-body, 'Montserrat'), sans-serif; - font-size: var(--font-size-14); - font-weight: bold; - text-transform: uppercase; - color: light-dark(@dark-blue, @golden); - margin: 0; - } - - .resource-value { - display: flex; - cursor: pointer; - - .hidden { - display: none; - } - - img { - width: 14px; - height: 14px; - - &.empty { - opacity: 0.4; - } - - &.filter { - filter: @golden-filter; - } - - &.non-transparent { - border-radius: 50%; - border: 1px solid @golden; - } - } - } - } -} diff --git a/system.json b/system.json index b8c4955b..fc5e1615 100644 --- a/system.json +++ b/system.json @@ -2,7 +2,7 @@ "id": "daggerheart", "title": "Daggerheart", "description": "An unofficial implementation of the Daggerheart system", - "version": "1.9.1", + "version": "1.8.0", "compatibility": { "minimum": "13.346", "verified": "13.351", diff --git a/templates/actionTypes/summon.hbs b/templates/actionTypes/summon.hbs index 18fed2e2..429977d9 100644 --- a/templates/actionTypes/summon.hbs +++ b/templates/actionTypes/summon.hbs @@ -1,19 +1,19 @@ -
+
{{localize "DAGGERHEART.ACTIONS.TYPES.summon.name"}}
    {{#each @root.summons as |summon index|}} -
  • -
    +
  • +

    {{summon.actor.name}}

    -
    +
    @@ -43,7 +43,7 @@
  • {{/each}} -
    +
    {{localize "DAGGERHEART.ACTIONS.Settings.summon.dropSummonsHere"}}
diff --git a/templates/actionTypes/transform.hbs b/templates/actionTypes/transform.hbs deleted file mode 100644 index ae17862a..00000000 --- a/templates/actionTypes/transform.hbs +++ /dev/null @@ -1,62 +0,0 @@ -
- - {{localize "DAGGERHEART.ACTIONS.TYPES.transform.name"}} - - -
- {{#if transform.actor}} -
- {{#if transform.actor.error}} -
{{transform.actor.error}}
- {{else}} -
- -

- {{transform.actor.name}} -

-
- {{/if}} - -
-
- {{#unless transform.actor.error}} - - - - {{/unless}} - - - -
-
-
- - {{/if}} - - {{#unless transform.actor}} -
- {{localize "DAGGERHEART.ACTIONS.Settings.transform.dropTransformHere"}} -
- {{/unless}} - -
-
- - {{localize "DAGGERHEART.ACTIONS.Settings.transform.clearHitPoints"}} -
-
- - {{localize "DAGGERHEART.ACTIONS.Settings.transform.clearStress"}} -
-
-
-
\ No newline at end of file diff --git a/templates/settings/appearance-settings/diceSoNice.hbs b/templates/settings/appearance-settings/diceSoNice.hbs index afe7dd5a..6c89fd2f 100644 --- a/templates/settings/appearance-settings/diceSoNice.hbs +++ b/templates/settings/appearance-settings/diceSoNice.hbs @@ -1,37 +1,71 @@
+
{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceSoNice.hint"}}
-
- {{#if isGM}} -
- - -
- {{/if}} -
- -
- {{formInput fields.diceSoNice.fields.sfx.fields.critical.fields.class value=setting.diceSoNice.sfx.critical.class blank="" localize=true}} -
-
-
+
-
{{#each dsnTabs as |dsnTab|}} -
- {{> "systems/daggerheart/templates/settings/appearance-settings/diceSoNiceTab.hbs" dsnTab }} -
+
+
+
+ + {{formInput fields.system value=values.system localize=true choices=@root.diceSoNiceSystems}} +
+
+
+ + {{formInput fields.foreground value=values.foreground localize=true}} +
+
+ + {{formInput fields.background value=values.background localize=true}} +
+
+ + {{formInput fields.outline value=values.outline localize=true}} +
+
+ + {{formInput fields.edge value=values.edge localize=true}} +
+
+ + {{formInput fields.colorset value=values.colorset choices=@root.diceSoNiceColorsets localize=true}} +
+
+ + {{formInput fields.texture value=values.texture choices=@root.diceSoNiceTextures localize=true}} +
+
+ + {{formInput fields.material value=values.material choices=@root.diceSoNiceMaterials localize=true}} +
+
+ + {{formInput fields.font value=values.font choices=@root.diceSoNiceFonts localize=true}} +
+
+
+ +
+
+
{{/each}} +
\ No newline at end of file diff --git a/templates/settings/appearance-settings/diceSoNiceTab.hbs b/templates/settings/appearance-settings/diceSoNiceTab.hbs deleted file mode 100644 index a15b63ec..00000000 --- a/templates/settings/appearance-settings/diceSoNiceTab.hbs +++ /dev/null @@ -1,62 +0,0 @@ -
-

{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceSoNice.diceAppearance"}}

- -
- - {{formInput fields.system value=values.system localize=true choices=@root.diceSoNiceSystems}} -
-
-
- - {{formInput fields.foreground value=values.foreground localize=true}} -
-
- - {{formInput fields.background value=values.background localize=true}} -
-
- - {{formInput fields.outline value=values.outline localize=true}} -
-
- - {{formInput fields.edge value=values.edge localize=true}} -
-
- - {{formInput fields.colorset value=values.colorset choices=@root.diceSoNiceColorsets localize=true}} -
-
- - {{formInput fields.texture value=values.texture choices=@root.diceSoNiceTextures localize=true}} -
-
- - {{formInput fields.material value=values.material choices=@root.diceSoNiceMaterials localize=true}} -
-
- - {{formInput fields.font value=values.font choices=@root.diceSoNiceFonts localize=true}} -
-
- - {{#if animations}} -

{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceSoNice.animations"}}

-
- - {{formInput fields.sfx.fields.higher.fields.class value=values.sfx.higher.class blank="" localize=true}} -
- {{/if}} - - -
\ No newline at end of file diff --git a/templates/settings/homebrew-settings/resources.hbs b/templates/settings/homebrew-settings/resources.hbs deleted file mode 100644 index 7f3dee3e..00000000 --- a/templates/settings/homebrew-settings/resources.hbs +++ /dev/null @@ -1,78 +0,0 @@ -
-
- {{#each settingFields.resources as |type key|}} -
- - {{localize "DAGGERHEART.SETTINGS.Homebrew.resources.typeTitle" type=(localize (concat "TYPES.Actor." key))}} - - - -
-
- {{#each type.resources as |resource key|}} -
- {{resource.label}} - - {{formField @root.schemaFields.resources.element.fields.resources.element.fields.label value=resource.label name=(concat "resources." @../key ".resources." key ".label") classes="vertical" localize=true }} - -
- {{formField @root.schemaFields.resources.element.fields.resources.element.fields.initial value=resource.initial name=(concat "resources." @../key ".resources." key ".initial") classes="vertical" localize=true }} - {{formField @root.schemaFields.resources.element.fields.resources.element.fields.max value=resource.max name=(concat "resources." @../key ".resources." key ".max") classes="vertical" localize=true }} -
- -
-
- {{#with @root.schemaFields.resources.element.fields.resources.element.fields.images.fields.full.fields}} -
-
- {{localize "DAGGERHEART.SETTINGS.Homebrew.resources.filledIcon"}} - -
-
-
- {{#if ../images.full.isIcon}} - {{formGroup this.value value=../images.full.value name=(concat "resources." @../key ".resources." key ".images.full.value") localize=true }} - {{else}} -
- -
- {{/if}} - {{formGroup this.isIcon value=../images.full.isIcon name="" classes="path-field" localize=true }} - {{formGroup this.noColorFilter value=../images.full.noColorFilter name=(concat "resources." @../key ".resources." key ".images.full.noColorFilter") localize=true }} -
- {{/with}} -
-
- {{#with @root.schemaFields.resources.element.fields.resources.element.fields.images.fields.empty.fields}} -
-
- {{localize "DAGGERHEART.SETTINGS.Homebrew.resources.emptyIcon"}} - -
-
-
- {{#if ../images.empty.isIcon}} - {{formGroup this.value value=../images.empty.value name=(concat "resources." @../key ".resources." key ".images.empty.value") localize=true }} - {{else}} -
- -
- {{/if}} - {{formGroup this.isIcon value=resource.images.empty.isIcon name="" classes="path-field" localize=true }} - {{formGroup this.noColorFilter value=resource.images.empty.noColorFilter name=(concat "resources." @../key ".resources." key ".images.empty.noColorFilter") localize=true }} -
- {{/with}} -
-
-
- {{/each}} -
-
-
- {{/each}} -
-
\ No newline at end of file diff --git a/templates/settings/metagaming-settings/footer.hbs b/templates/settings/metagaming-settings/footer.hbs deleted file mode 100644 index 54939c17..00000000 --- a/templates/settings/metagaming-settings/footer.hbs +++ /dev/null @@ -1,10 +0,0 @@ -
- - -
\ No newline at end of file diff --git a/templates/settings/metagaming-settings/general.hbs b/templates/settings/metagaming-settings/general.hbs deleted file mode 100644 index 7f36715e..00000000 --- a/templates/settings/metagaming-settings/general.hbs +++ /dev/null @@ -1,3 +0,0 @@ -
- {{formGroup settingFields.schema.fields.hideObserverPermissionInChat value=settingFields._source.hideObserverPermissionInChat localize=true}} -
\ No newline at end of file diff --git a/templates/settings/metagaming-settings/header.hbs b/templates/settings/metagaming-settings/header.hbs deleted file mode 100644 index e0f72ee8..00000000 --- a/templates/settings/metagaming-settings/header.hbs +++ /dev/null @@ -1,3 +0,0 @@ -
-

{{localize 'DAGGERHEART.SETTINGS.Menu.metagaming.name'}}

-
\ No newline at end of file diff --git a/templates/sheets-settings/action-settings/effect.hbs b/templates/sheets-settings/action-settings/effect.hbs index 1bdd0304..e94f4328 100644 --- a/templates/sheets-settings/action-settings/effect.hbs +++ b/templates/sheets-settings/action-settings/effect.hbs @@ -11,5 +11,4 @@ {{#if fields.beastform}}{{> 'systems/daggerheart/templates/actionTypes/beastform.hbs' fields=fields.beastform.fields source=source.beastform}}{{/if}} {{#if fields.summon}}{{> 'systems/daggerheart/templates/actionTypes/summon.hbs' fields=fields.summon.element.fields source=source.summon}}{{/if}} {{#if fields.countdown}}{{> 'systems/daggerheart/templates/actionTypes/countdown.hbs' fields=fields.countdown.element.fields source=source.countdown}}{{/if}} - {{#if fields.transform}}{{> 'systems/daggerheart/templates/actionTypes/transform.hbs' fields=fields.transform.fields source=source.transform}}{{/if}} \ No newline at end of file diff --git a/templates/sheets-settings/adversary-settings/details.hbs b/templates/sheets-settings/adversary-settings/details.hbs index dc2fd386..065ebe74 100644 --- a/templates/sheets-settings/adversary-settings/details.hbs +++ b/templates/sheets-settings/adversary-settings/details.hbs @@ -20,11 +20,15 @@
- {{localize "DAGGERHEART.GENERAL.Resource.plural"}} - {{#each resources as |resource|}} - {{formGroup resource.field value=resource.value name=resource.name}} - {{/each}} -
+ {{localize "DAGGERHEART.GENERAL.HitPoints.plural"}} + {{formGroup systemFields.resources.fields.hitPoints.fields.value value=document._source.system.resources.hitPoints.value label=(localize "DAGGERHEART.ACTORS.Adversary.FIELDS.resources.hitPoints.value.label")}} + {{formGroup systemFields.resources.fields.hitPoints.fields.max value=document._source.system.resources.hitPoints.max label=(localize "DAGGERHEART.ACTORS.Adversary.FIELDS.resources.hitPoints.max.label")}} +
+
+ {{localize "DAGGERHEART.GENERAL.stress"}} + {{formGroup systemFields.resources.fields.stress.fields.value value=document._source.system.resources.stress.value label=(localize "DAGGERHEART.ACTORS.Adversary.FIELDS.resources.stress.value.label")}} + {{formGroup systemFields.resources.fields.stress.fields.max value=document._source.system.resources.stress.max label=(localize "DAGGERHEART.ACTORS.Adversary.FIELDS.resources.stress.max.label")}} +
@@ -32,4 +36,4 @@ {{formGroup systemFields.damageThresholds.fields.major value=document._source.system.damageThresholds.major label=(localize "DAGGERHEART.GENERAL.DamageThresholds.majorThreshold")}} {{formGroup systemFields.damageThresholds.fields.severe value=document._source.system.damageThresholds.severe label=(localize "DAGGERHEART.GENERAL.DamageThresholds.severeThreshold")}}
- + \ No newline at end of file diff --git a/templates/sheets-settings/character-settings/details.hbs b/templates/sheets-settings/character-settings/details.hbs index 4bda501e..3f9247e0 100644 --- a/templates/sheets-settings/character-settings/details.hbs +++ b/templates/sheets-settings/character-settings/details.hbs @@ -22,12 +22,15 @@ {{localize 'DAGGERHEART.GENERAL.basics'}}
- {{#each resources as |resource|}} - - {{formGroup resource.field value=resource.value name=resource.name}} - - {{/each}} + {{formGroup systemFields.resources.fields.hitPoints.fields.value value=document._source.system.resources.hitPoints.value localize=true}} + + {{formGroup systemFields.resources.fields.hitPoints.fields.max value=document._source.system.resources.hitPoints.max localize=true}} + + {{formGroup systemFields.resources.fields.stress.fields.value value=document._source.system.resources.stress.value localize=true}} + {{formGroup systemFields.resources.fields.stress.fields.max value=document._source.system.resources.stress.max localize=true}} + + {{formGroup systemFields.resources.fields.hope.fields.value value=document._source.system.resources.hope.value localize=true}} {{formGroup systemFields.scars value=document._source.system.scars localize=true}} {{formGroup systemFields.proficiency value=document._source.system.proficiency localize=true}} @@ -36,4 +39,4 @@
- + \ No newline at end of file diff --git a/templates/sheets-settings/companion-settings/details.hbs b/templates/sheets-settings/companion-settings/details.hbs index 6a602d38..88878d67 100644 --- a/templates/sheets-settings/companion-settings/details.hbs +++ b/templates/sheets-settings/companion-settings/details.hbs @@ -7,9 +7,8 @@ {{localize 'DAGGERHEART.GENERAL.basics'}}
{{formGroup systemFields.evasion value=document._source.system.evasion localize=true}} - {{#each resources as |resource|}} - {{formGroup resource.field value=resource.value name=resource.name}} - {{/each}} + {{formGroup systemFields.resources.fields.stress.fields.value value=document._source.system.resources.stress.value label='DAGGERHEART.ACTORS.Companion.FIELDS.resources.stress.currentStress.label' localize=true}} + {{formGroup systemFields.resources.fields.stress.fields.max value=document._source.system.resources.stress.max label='DAGGERHEART.ACTORS.Companion.FIELDS.resources.stress.maxStress.label' localize=true}}
@@ -20,4 +19,4 @@
- + \ No newline at end of file diff --git a/templates/sheets/actors/character/features.hbs b/templates/sheets/actors/character/features.hbs index 3e942468..acabd37e 100644 --- a/templates/sheets/actors/character/features.hbs +++ b/templates/sheets/actors/character/features.hbs @@ -4,21 +4,19 @@ {{#each document.system.sheetLists as |category|}} {{#if (eq category.type 'feature' )}} {{> 'daggerheart.inventory-items' - title=category.title - type='feature' - actorType='character' - collection=category.values - canCreate=true - showActions=true + title=category.title + type='feature' + collection=category.values + canCreate=true + showActions=true }} {{else if category.values}} {{> 'daggerheart.inventory-items' - title=category.title - type='feature' - actorType='character' - collection=category.values - canCreate=false - showActions=true + title=category.title + type='feature' + collection=category.values + canCreate=false + showActions=true }} {{/if}} diff --git a/templates/sheets/actors/character/header.hbs b/templates/sheets/actors/character/header.hbs index 06f464fa..d2c01f3c 100644 --- a/templates/sheets/actors/character/header.hbs +++ b/templates/sheets/actors/character/header.hbs @@ -65,25 +65,22 @@
-
-
-

{{localize "DAGGERHEART.GENERAL.hope"}}

- {{#times document.system.resources.hope.max}} - - {{#if (gte ../document.system.resources.hope.value (add this 1))}} - - {{else}} - - {{/if}} - - {{/times}} - {{#times document.system.scars}} - - - - {{/times}} - {{#if hasExtraResources}}{{/if}} -
+
+

{{localize "DAGGERHEART.GENERAL.hope"}}

+ {{#times document.system.resources.hope.max}} + + {{#if (gte ../document.system.resources.hope.value (add this 1))}} + + {{else}} + + {{/if}} + + {{/times}} + {{#times document.system.scars}} + + + + {{/times}}
{{#if document.system.class.value}} diff --git a/templates/sheets/global/partials/item-tags.hbs b/templates/sheets/global/partials/item-tags.hbs deleted file mode 100644 index b30fcbf2..00000000 --- a/templates/sheets/global/partials/item-tags.hbs +++ /dev/null @@ -1,8 +0,0 @@ -
- {{#each _getTags as |tag|}} -
- {{tag}} -
- {{/each}} - {{#if @partial-block}}{{> @partial-block}}{{/if}} -
\ No newline at end of file diff --git a/templates/sheets/items/armor/description.hbs b/templates/sheets/items/armor/description.hbs index af2698ef..c234fa10 100644 --- a/templates/sheets/items/armor/description.hbs +++ b/templates/sheets/items/armor/description.hbs @@ -1,6 +1,19 @@
+
+
+

{{localize "DAGGERHEART.ITEMS.Armor.baseThresholds.base"}}

+ {{item.system.baseThresholds.major}}/{{item.system.baseThresholds.severe}} +
+ +
+

{{localize "DAGGERHEART.ITEMS.Armor.baseScore"}}

+ {{item.system.baseScore}} +
+
+ {{#if features.length}}
+

{{localize "DAGGERHEART.GENERAL.features"}}

{{#each features as | feature |}}
{{localize feature.label}}: {{{localize feature.description}}}
{{/each}} diff --git a/templates/sheets/items/weapon/description.hbs b/templates/sheets/items/weapon/description.hbs index af2698ef..d8e128e7 100644 --- a/templates/sheets/items/weapon/description.hbs +++ b/templates/sheets/items/weapon/description.hbs @@ -1,6 +1,36 @@
+
+
+

{{localize "DAGGERHEART.GENERAL.Tiers.singular"}}

+ {{tier}} +
+ +
+

{{localize "DAGGERHEART.GENERAL.Trait.single"}}

+ {{trait}} +
+ +
+

{{localize "DAGGERHEART.GENERAL.range"}}

+ {{range}} +
+
+ +
+
+

{{localize "DAGGERHEART.GENERAL.damage"}}

+ {{damage}} +
+ +
+

{{localize "DAGGERHEART.GENERAL.burden"}}

+ {{burden}} +
+
+ {{#if features.length}}
+

{{localize "DAGGERHEART.GENERAL.features"}}

{{#each features as | feature |}}
{{localize feature.label}}: {{{localize feature.description}}}
{{/each}} diff --git a/templates/ui/chat/parts/target-part.hbs b/templates/ui/chat/parts/target-part.hbs index 9a545926..477445a3 100644 --- a/templates/ui/chat/parts/target-part.hbs +++ b/templates/ui/chat/parts/target-part.hbs @@ -1,6 +1,6 @@
{{pluralize currentTargets.length "DAGGERHEART.GENERAL.Target"}}
- {{#if (or isGM (not metagamingSettings.hideObserverPermissionInChat))}} + {{#if isGM}}
{{#if (or (gt targetShort.hit 0) (gt targetShort.miss 0))}} diff --git a/templates/ui/itemBrowser/itemContainer.hbs b/templates/ui/itemBrowser/itemContainer.hbs index 8dd75156..0040a692 100644 --- a/templates/ui/itemBrowser/itemContainer.hbs +++ b/templates/ui/itemBrowser/itemContainer.hbs @@ -10,10 +10,7 @@
- - {{{system.enrichedTags}}} - {{{system.enrichedDescription}}} - + {{{system.enrichedDescription}}}
{{/each}} \ No newline at end of file diff --git a/templates/ui/tooltip/domainCard.hbs b/templates/ui/tooltip/domainCard.hbs index 0380a523..9388f1a4 100644 --- a/templates/ui/tooltip/domainCard.hbs +++ b/templates/ui/tooltip/domainCard.hbs @@ -5,7 +5,7 @@ - {{#with (lookup allDomains item.system.domain) as | domain |}} + {{#with (lookup config.DOMAIN.domains item.system.domain) as | domain |}} {{/with}} diff --git a/templates/ui/tooltip/resourceManagement.hbs b/templates/ui/tooltip/resourceManagement.hbs deleted file mode 100644 index b9817e6e..00000000 --- a/templates/ui/tooltip/resourceManagement.hbs +++ /dev/null @@ -1,21 +0,0 @@ -
- {{#each resources as |resource|}} -
-

{{resource.label}}

- {{#times resource.max}} - - {{#if resource.fullIcon.isIcon}} - - {{else}} - - {{/if}} - {{#if resource.emptyIcon.isIcon}} - - {{else}} - - {{/if}} - - {{/times}} -
- {{/each}} -
\ No newline at end of file