diff --git a/daggerheart.mjs b/daggerheart.mjs index 1b7be686..09736c12 100644 --- a/daggerheart.mjs +++ b/daggerheart.mjs @@ -1,32 +1,25 @@ -import { SYSTEM } from './module/config/system.mjs'; +import { SYSTEM } from './module/applications/config/system.mjs'; import * as applications from './module/applications/_module.mjs'; import * as models from './module/data/_module.mjs'; import * as documents from './module/documents/_module.mjs'; import RegisterHandlebarsHelpers from './module/helpers/handlebarsHelper.mjs'; -import DhCombatTracker from './module/ui/combatTracker.mjs'; -import { handleSocketEvent, registerSocketHooks } from './module/helpers/socket.mjs'; -import { registerDHSettings } from './module/applications/settings.mjs'; -import DhpChatLog from './module/ui/chatLog.mjs'; -import DhpRuler from './module/ui/ruler.mjs'; -import DhpTokenRuler from './module/ui/tokenRuler.mjs'; import { DhDualityRollEnricher, DhTemplateEnricher } from './module/enrichers/_module.mjs'; -import { getCommandTarget, rollCommandToJSON, setDiceSoNiceForDualityRoll } from './module/helpers/utils.mjs'; -import { abilities } from './module/config/actorConfig.mjs'; -import Resources from './module/applications/resources.mjs'; -import { NarrativeCountdowns, registerCountdownApplicationHooks } from './module/applications/countdowns.mjs'; -import DHDualityRoll from './module/data/chat-message/dualityRoll.mjs'; +import { getCommandTarget, rollCommandToJSON } from './module/helpers/utils.mjs'; +import { NarrativeCountdowns, registerCountdownApplicationHooks } from './module/applications/ui/countdowns.mjs'; import { DualityRollColor } from './module/data/settings/Appearance.mjs'; -import { DHRoll, DualityRoll, D20Roll, DamageRoll, DualityDie } from './module/applications/roll.mjs'; -import { DhMeasuredTemplate } from './module/placeables/_module.mjs'; +import { DHRoll, DualityRoll, D20Roll, DamageRoll, DualityDie } from './module/documents/roll.mjs'; import { renderDualityButton } from './module/enrichers/DualityRollEnricher.mjs'; import { renderMeasuredTemplate } from './module/enrichers/TemplateEnricher.mjs'; import { registerCountdownHooks } from './module/data/countdowns.mjs'; - -globalThis.SYSTEM = SYSTEM; +import { + handlebarsRegistration, + settingsRegistration, + socketRegistration +} from './module/systemRegistration/_module.mjs'; +import { DhPlaceables } from './module/canvas/_module.mjs'; Hooks.once('init', () => { - CONFIG.daggerheart = SYSTEM; - + CONFIG.DH = SYSTEM; game.system.api = { applications, models, @@ -60,7 +53,7 @@ Hooks.once('init', () => { }; CONFIG.Dice.rolls = [...CONFIG.Dice.rolls, ...[DHRoll, DualityRoll, D20Roll, DamageRoll]]; - CONFIG.MeasuredTemplate.objectClass = DhMeasuredTemplate; + CONFIG.MeasuredTemplate.objectClass = DhPlaceables.DhMeasuredTemplate; CONFIG.Item.documentClass = documents.DHItem; @@ -116,28 +109,27 @@ Hooks.once('init', () => { }; CONFIG.ChatMessage.dataModels = models.messages.config; - CONFIG.ChatMessage.documentClass = applications.DhpChatMessage; + CONFIG.ChatMessage.documentClass = documents.DhChatMessage; - CONFIG.Canvas.rulerClass = DhpRuler; + CONFIG.Canvas.rulerClass = DhPlaceables.DhRuler; CONFIG.Combat.documentClass = documents.DhpCombat; - CONFIG.ui.combat = DhCombatTracker; - CONFIG.ui.chat = DhpChatLog; - // CONFIG.ui.players = DhpPlayers; - CONFIG.Token.rulerClass = DhpTokenRuler; + CONFIG.ui.combat = applications.ui.DhCombatTracker; + CONFIG.ui.chat = applications.ui.DhChatLog; + CONFIG.Token.rulerClass = DhPlaceables.DhTokenRuler; - CONFIG.ui.resources = Resources; + CONFIG.ui.resources = applications.ui.DhFearTracker; CONFIG.ux.ContextMenu = applications.DhContextMenu; - CONFIG.ux.TooltipManager = applications.DhTooltipManager; + CONFIG.ux.TooltipManager = documents.DhTooltipManager; - game.socket.on(`system.${SYSTEM.id}`, handleSocketEvent); + game.socket.on(`system.${SYSTEM.id}`, socketRegistration.handleSocketEvent); // Make Compendium Dialog resizable foundry.applications.sidebar.apps.Compendium.DEFAULT_OPTIONS.window.resizable = true; - registerDHSettings(); + settingsRegistration.registerDHSettings(); RegisterHandlebarsHelpers.registerHelpers(); - return preloadHandlebarsTemplates(); + return handlebarsRegistration(); }); Hooks.on('ready', () => { @@ -152,7 +144,7 @@ Hooks.on('ready', () => { ); registerCountdownHooks(); - registerSocketHooks(); + socketRegistration.registerSocketHooks(); registerCountdownApplicationHooks(); }); @@ -212,7 +204,7 @@ Hooks.on('chatMessage', (_, message) => { const title = traitValue ? game.i18n.format('DAGGERHEART.Chat.DualityRoll.AbilityCheckTitle', { - ability: game.i18n.localize(abilities[traitValue].label) + ability: game.i18n.localize(applications.config.actorConfig.abilities[traitValue].label) }) : game.i18n.localize('DAGGERHEART.General.Duality'); @@ -266,46 +258,3 @@ Hooks.on('renderJournalDirectory', async (tab, html, _, options) => { }; } }); - -const preloadHandlebarsTemplates = async function () { - return foundry.applications.handlebars.loadTemplates([ - 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs', - 'systems/daggerheart/templates/sheets/global/partials/inventory-item.hbs', - 'systems/daggerheart/templates/sheets/global/partials/action-item.hbs', - 'systems/daggerheart/templates/sheets/global/partials/domain-card-item.hbs', - 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs', - 'systems/daggerheart/templates/sheets/parts/attributes.hbs', - 'systems/daggerheart/templates/sheets/parts/defense.hbs', - 'systems/daggerheart/templates/sheets/parts/armor.hbs', - 'systems/daggerheart/templates/sheets/parts/experience.hbs', - 'systems/daggerheart/templates/sheets/parts/features.hbs', - 'systems/daggerheart/templates/sheets/parts/gold.hbs', - 'systems/daggerheart/templates/sheets/parts/health.hbs', - 'systems/daggerheart/templates/sheets/parts/hope.hbs', - 'systems/daggerheart/templates/sheets/parts/weapons.hbs', - 'systems/daggerheart/templates/sheets/parts/domainCard.hbs', - 'systems/daggerheart/templates/sheets/parts/heritage.hbs', - 'systems/daggerheart/templates/sheets/parts/subclassFeature.hbs', - 'systems/daggerheart/templates/sheets/parts/effects.hbs', - 'systems/daggerheart/templates/sheets/items/subclass/parts/subclass-features.hbs', - 'systems/daggerheart/templates/sheets/items/subclass/parts/subclass-feature.hbs', - 'systems/daggerheart/templates/components/card-preview.hbs', - 'systems/daggerheart/templates/views/levelup/parts/selectable-card-preview.hbs', - 'systems/daggerheart/templates/sheets/global/partials/feature-section-item.hbs', - 'systems/daggerheart/templates/ui/combat/combatTrackerSection.hbs', - 'systems/daggerheart/templates/views/actionTypes/damage.hbs', - 'systems/daggerheart/templates/views/actionTypes/healing.hbs', - 'systems/daggerheart/templates/views/actionTypes/resource.hbs', - 'systems/daggerheart/templates/views/actionTypes/uuid.hbs', - 'systems/daggerheart/templates/views/actionTypes/uses.hbs', - 'systems/daggerheart/templates/views/actionTypes/roll.hbs', - 'systems/daggerheart/templates/views/actionTypes/save.hbs', - 'systems/daggerheart/templates/views/actionTypes/cost.hbs', - 'systems/daggerheart/templates/views/actionTypes/range-target.hbs', - 'systems/daggerheart/templates/views/actionTypes/effect.hbs', - 'systems/daggerheart/templates/views/actionTypes/beastform.hbs', - 'systems/daggerheart/templates/settings/components/settings-item-line.hbs', - 'systems/daggerheart/templates/chat/parts/damage-chat.hbs', - 'systems/daggerheart/templates/chat/parts/target-chat.hbs' - ]); -}; diff --git a/module/applications/_module.mjs b/module/applications/_module.mjs index a1574a33..72412f95 100644 --- a/module/applications/_module.mjs +++ b/module/applications/_module.mjs @@ -11,12 +11,12 @@ export { default as DhpMiscellaneous } from './sheets/items/miscellaneous.mjs'; export { default as DhpConsumable } from './sheets/items/consumable.mjs'; export { default as DhpWeapon } from './sheets/items/weapon.mjs'; export { default as DhpArmor } from './sheets/items/armor.mjs'; -export { default as DhpChatMessage } from './chatMessage.mjs'; export { default as DhpEnvironment } from './sheets/actors/environment.mjs'; export { default as DhActiveEffectConfig } from './sheets/activeEffectConfig.mjs'; -export { default as DhContextMenu } from './contextMenu.mjs'; +export { default as DhContextMenu } from './ux/contextMenu.mjs'; export { default as DhBeastform } from './sheets/items/beastform.mjs'; -export { default as DhTooltipManager } from './tooltipManager.mjs'; +export * as config from './config/_module.mjs'; export * as api from './sheets/api/_modules.mjs'; +export * as ui from './ui/_module.mjs'; export * as ux from './ux/_module.mjs'; diff --git a/module/applications/ancestrySelectionDialog.mjs b/module/applications/ancestrySelectionDialog.mjs deleted file mode 100644 index bc2f6b5e..00000000 --- a/module/applications/ancestrySelectionDialog.mjs +++ /dev/null @@ -1,250 +0,0 @@ -const { ApplicationV2, HandlebarsApplicationMixin } = foundry.applications.api; - -export default class AncestrySelectionDialog extends HandlebarsApplicationMixin(ApplicationV2) { - constructor(resolve) { - super({}); - - this.resolve = resolve; - this.data = { - ancestries: [], - features: [], - ancestryInfo: { - name: '', - img: null, - customImg: 'icons/svg/mystery-man.svg', - description: '' - } - }; - } - - static DEFAULT_OPTIONS = { - tag: 'form', - classes: ['daggerheart', 'views', 'ancestry-selection'], - position: { - width: 800, - height: 'auto' - }, - actions: { - selectAncestry: this.selectAncestry, - selectFeature: this.selectFeature, - viewItem: this.viewItem, - selectImage: this.selectImage, - editImage: this._onEditImage, - saveAncestry: this.saveAncestry - }, - form: { - submitOnChange: true, - closeOnSubmit: false - } - }; - - /** @override */ - static PARTS = { - damageSelection: { - id: 'ancestrySelection', - template: 'systems/daggerheart/templates/views/ancestrySelection.hbs' - } - }; - - /* -------------------------------------------- */ - - /** @inheritDoc */ - get title() { - return `Ancestry Selection`; - } - - _attachPartListeners(partId, htmlElement, options) { - super._attachPartListeners(partId, htmlElement, options); - - const ancestryNameInput = $(htmlElement).find('.ancestry-name'); - if (ancestryNameInput.length > 0) { - ancestryNameInput.on('change', this.setName.bind(this)); - $(htmlElement).find('.ancestry-description').on('change', this.setDescription.bind(this)); - } - // $(htmlElement).find(".ancestry-image").on("change", this.selectImage.bind(this)); - } - - async _prepareContext(_options) { - const systemAncestries = Array.from((await game.packs.get('daggerheart.ancestries')).index).map(x => ({ - ...x, - selected: this.data.ancestries.some(selected => selected.uuid === x.uuid) - })); - - const customAncestries = game.items.reduce((acc, x) => { - if (x.type === 'ancestry') { - acc.push({ - ...x, - uuid: x.uuid, - selected: this.data.ancestries.some(selected => selected.uuid === x.uuid) - }); - } - - return acc; - }, []); - - const ancestryFeatures = this.data.ancestries.flatMap(x => - x.system.abilities.map(x => ({ - ...x, - selected: this.data.features.some(selected => selected.uuid === x.uuid) - })) - ); - - return { - systemAncestries, - customAncestries, - ancestryFeatures, - selectedAncestries: this.data.ancestries, - selectedFeatures: this.data.features, - ancestryInfo: this.data.ancestryInfo - }; - } - - static async selectAncestry(_, button) { - const newAncestries = [...this.data.ancestries]; - if (!newAncestries.findSplice(x => x.uuid === button.dataset.uuid) && this.data.ancestries.length < 2) { - const ancestry = await fromUuid(button.dataset.uuid); - newAncestries.push(ancestry); - } - - this.data.ancestries = newAncestries; - this.data.features = newAncestries.length === 1 ? newAncestries[0].system.abilities : []; - - this.render(true); - } - - static async selectFeature(_, button) { - const newFeatures = [...this.data.features]; - if (!newFeatures.findSplice(x => x.uuid === button.dataset.uuid) && this.data.features.length < 2) { - const feature = await fromUuid(button.dataset.uuid); - newFeatures.push(feature); - } - - this.data.features = newFeatures; - this.render(true); - } - - static async viewItem(_, button) { - (await fromUuid(button.dataset.uuid)).sheet.render(true); - } - - setName(event) { - this.data.ancestryInfo.name = event.currentTarget.value; - this.render(true); - } - - setDescription(event) { - this.data.ancestryInfo.description = event.currentTarget.value; - this.render(true); - } - - static selectImage(_, button) { - this.data.ancestryInfo.img = button.dataset.img; - this.render(true); - } - - static _onEditImage() { - const fp = new foundry.applications.apps.FilePicker.implementation({ - current: this.data.ancestryInfo.img, - type: 'image', - redirectToRoot: ['icons/svg/mystery-man.svg'], - callback: async path => this._updateImage.bind(this)(path), - top: this.position.top + 40, - left: this.position.left + 10 - }); - return fp.browse(); - } - - _updateImage(path) { - this.data.ancestryInfo.customImg = path; - this.data.ancestryInfo.img = path; - this.render(true); - } - - static async saveAncestry(_, button) { - if (this.data.ancestries.length === 2) { - const { name, img, description } = this.data.ancestryInfo; - - this.resolve({ - data: { - name: name, - img: img, - type: 'ancestry', - system: { - description: description, - abilities: this.data.features.map(x => ({ - name: x.name, - img: x.img, - uuid: x.uuid, - subclassLevel: '' - })) - } - } - }); - } else { - this.resolve({ data: this.data.ancestries[0].toObject() }); - } - - this.close(); - } -} - -// export default class DamageSelectionDialog extends FormApplication { -// constructor(rollString, bonusDamage, resolve){ -// super({}, {}); - -// this.data = { -// rollString, -// bonusDamage: bonusDamage.map(x => ({ -// ...x, -// hopeUses: 0 -// })), -// } -// this.resolve = resolve; -// } - -// get title (){ -// return 'Damage Options'; -// } - -// static get defaultOptions() { -// const defaults = super.defaultOptions; -// const overrides = { -// height: 'auto', -// width: 400, -// id: 'damage-selection', -// template: 'systems/daggerheart/templates/views/damageSelection.hbs', -// closeOnSubmit: false, -// classes: ["daggerheart", "views", "damage-selection"], -// }; - -// const mergedOptions = foundry.utils.mergeObject(defaults, overrides); - -// return mergedOptions; -// } - -// async getData(){ -// const context = super.getData(); -// context.rollString = this.data.rollString; -// context.bonusDamage = this.data.bonusDamage; - -// return context; -// } - -// activateListeners(html) { -// super.activateListeners(html); - -// html.find('.roll-button').click(this.finish.bind(this)); -// html.find('.').change(); -// } - -// // async _updateObject(_, formData) { -// // const data = foundry.utils.expandObject(formData); -// // this.data = foundry.utils.mergeObject(this.data, data); -// // this.render(true); -// // } - -// finish(){ -// this.resolve(this.data); -// this.close(); -// } -// } diff --git a/module/applications/characterCreation.mjs b/module/applications/characterCreation/characterCreation.mjs similarity index 97% rename from module/applications/characterCreation.mjs rename to module/applications/characterCreation/characterCreation.mjs index da76d0a9..9ff64e09 100644 --- a/module/applications/characterCreation.mjs +++ b/module/applications/characterCreation/characterCreation.mjs @@ -74,11 +74,11 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl }; static PARTS = { - tabs: { template: 'systems/daggerheart/templates/views/characterCreation/tabs.hbs' }, - setup: { template: 'systems/daggerheart/templates/views/characterCreation/tabs/setup.hbs' }, - equipment: { template: 'systems/daggerheart/templates/views/characterCreation/tabs/equipment.hbs' }, - // story: { template: 'systems/daggerheart/templates/views/characterCreation/tabs/story.hbs' }, - footer: { template: 'systems/daggerheart/templates/views/characterCreation/footer.hbs' } + tabs: { template: 'systems/daggerheart/templates/characterCreation/tabs.hbs' }, + setup: { template: 'systems/daggerheart/templates/characterCreation/tabs/setup.hbs' }, + equipment: { template: 'systems/daggerheart/templates/characterCreation/tabs/equipment.hbs' }, + // story: { template: 'systems/daggerheart/templates/characterCreation/tabs/story.hbs' }, + footer: { template: 'systems/daggerheart/templates/characterCreation/footer.hbs' } }; static TABS = { @@ -176,7 +176,7 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl switch (partId) { case 'setup': const availableTraitModifiers = game.settings - .get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Homebrew) + .get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew) .traitArray.map(trait => ({ key: trait, name: trait })); for (let trait of Object.values(this.setup.traits).filter(x => x.value !== null)) { const index = availableTraitModifiers.findIndex(x => x.key === trait.value); @@ -396,7 +396,7 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl } async _onDrop(event) { - const data = TextEditor.getDragEventData(event); + const data = foundry.applications.ux.TextEditor.implementation.getDragEventData(event); const item = await foundry.utils.fromUuid(data.uuid); if (item.type === 'ancestry' && event.target.closest('.ancestry-card')) { this.setup.ancestry = { diff --git a/module/applications/config/Action.mjs b/module/applications/config/Action.mjs index 803f22fe..61ce3fd7 100644 --- a/module/applications/config/Action.mjs +++ b/module/applications/config/Action.mjs @@ -34,7 +34,7 @@ export default class DHActionConfig extends DaggerheartSheet(ApplicationV2) { static PARTS = { form: { id: 'action', - template: 'systems/daggerheart/templates/views/action.hbs' + template: 'systems/daggerheart/templates/config/action.hbs' } }; @@ -60,7 +60,7 @@ export default class DHActionConfig extends DaggerheartSheet(ApplicationV2) { context.source = this.action.toObject(false); context.openSection = this.openSection; context.tabs = this._getTabs(); - context.config = SYSTEM; + context.config = CONFIG.DH; if (!!this.action.effects) context.effects = this.action.effects.map(e => this.action.item.effects.get(e._id)); if (this.action.damage?.hasOwnProperty('includeBase') && this.action.type === 'attack') context.hasBaseDamage = !!this.action.parent.damage; @@ -70,7 +70,7 @@ export default class DHActionConfig extends DaggerheartSheet(ApplicationV2) { context.isNPC = this.action.actor && this.action.actor.type !== 'character'; context.hasRoll = this.action.hasRoll; - const settingsTiers = game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.LevelTiers).tiers; + const settingsTiers = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LevelTiers).tiers; context.tierOptions = [ { key: 1, label: game.i18n.localize('DAGGERHEART.Tiers.tier1') }, ...Object.values(settingsTiers).map(x => ({ key: x.tier, label: x.name })) diff --git a/module/applications/config/_module.mjs b/module/applications/config/_module.mjs new file mode 100644 index 00000000..b8ac6feb --- /dev/null +++ b/module/applications/config/_module.mjs @@ -0,0 +1,25 @@ +import * as action from './Action.mjs'; +import * as actionConfig from './actionConfig.mjs'; +import * as actorConfig from './actorConfig.mjs'; +import * as domainConfig from './domainConfig.mjs'; +import * as effectConfig from './effectConfig.mjs'; +import * as flagsConfig from './flagsConfig.mjs'; +import * as generalConfig from './generalConfig.mjs'; +import * as hooksConfig from './hooksConfig.mjs'; +import * as itemConfig from './itemConfig.mjs'; +import * as settingsConfig from './settingsConfig.mjs'; +import * as systemConfig from './system.mjs'; + +export { + action, + actionConfig, + actorConfig, + domainConfig, + effectConfig, + flagsConfig, + generalConfig, + hooksConfig, + itemConfig, + settingsConfig, + systemConfig +}; diff --git a/module/config/actionConfig.mjs b/module/applications/config/actionConfig.mjs similarity index 100% rename from module/config/actionConfig.mjs rename to module/applications/config/actionConfig.mjs diff --git a/module/config/actorConfig.mjs b/module/applications/config/actorConfig.mjs similarity index 100% rename from module/config/actorConfig.mjs rename to module/applications/config/actorConfig.mjs diff --git a/module/config/domainConfig.mjs b/module/applications/config/domainConfig.mjs similarity index 100% rename from module/config/domainConfig.mjs rename to module/applications/config/domainConfig.mjs diff --git a/module/config/effectConfig.mjs b/module/applications/config/effectConfig.mjs similarity index 96% rename from module/config/effectConfig.mjs rename to module/applications/config/effectConfig.mjs index 17d5c960..2204b612 100644 --- a/module/config/effectConfig.mjs +++ b/module/applications/config/effectConfig.mjs @@ -1,4 +1,4 @@ -import { range } from './generalConfig.mjs'; +import { range } from '../config/generalConfig.mjs'; export const valueTypes = { numberString: { diff --git a/module/config/flagsConfig.mjs b/module/applications/config/flagsConfig.mjs similarity index 100% rename from module/config/flagsConfig.mjs rename to module/applications/config/flagsConfig.mjs diff --git a/module/config/generalConfig.mjs b/module/applications/config/generalConfig.mjs similarity index 99% rename from module/config/generalConfig.mjs rename to module/applications/config/generalConfig.mjs index 06c75fce..971ee3fe 100644 --- a/module/config/generalConfig.mjs +++ b/module/applications/config/generalConfig.mjs @@ -290,7 +290,7 @@ export const diceSetNumbers = { }; export const getDiceSoNicePresets = () => { - const { diceSoNice } = game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance); + const { diceSoNice } = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance); return { hope: { diff --git a/module/config/hooksConfig.mjs b/module/applications/config/hooksConfig.mjs similarity index 100% rename from module/config/hooksConfig.mjs rename to module/applications/config/hooksConfig.mjs diff --git a/module/config/itemConfig.mjs b/module/applications/config/itemConfig.mjs similarity index 100% rename from module/config/itemConfig.mjs rename to module/applications/config/itemConfig.mjs diff --git a/module/config/settingsConfig.mjs b/module/applications/config/settingsConfig.mjs similarity index 100% rename from module/config/settingsConfig.mjs rename to module/applications/config/settingsConfig.mjs diff --git a/module/config/system.mjs b/module/applications/config/system.mjs similarity index 100% rename from module/config/system.mjs rename to module/applications/config/system.mjs diff --git a/module/dialogs/beastformDialog.mjs b/module/applications/dialogs/beastformDialog.mjs similarity index 96% rename from module/dialogs/beastformDialog.mjs rename to module/applications/dialogs/beastformDialog.mjs index 34b71c24..04fbe2fc 100644 --- a/module/dialogs/beastformDialog.mjs +++ b/module/applications/dialogs/beastformDialog.mjs @@ -35,7 +35,7 @@ export default class BeastformDialog extends HandlebarsApplicationMixin(Applicat /** @override */ static PARTS = { beastform: { - template: 'systems/daggerheart/templates/views/beastformDialog.hbs' + template: 'systems/daggerheart/templates/dialogs/beastformDialog.hbs' } }; diff --git a/module/applications/costSelectionDialog.mjs b/module/applications/dialogs/costSelectionDialog.mjs similarity index 95% rename from module/applications/costSelectionDialog.mjs rename to module/applications/dialogs/costSelectionDialog.mjs index 08bfb1d9..cab0d36d 100644 --- a/module/applications/costSelectionDialog.mjs +++ b/module/applications/dialogs/costSelectionDialog.mjs @@ -30,7 +30,7 @@ export default class CostSelectionDialog extends HandlebarsApplicationMixin(Appl static PARTS = { costSelection: { id: 'costSelection', - template: 'systems/daggerheart/templates/views/costSelection.hbs' + template: 'systems/daggerheart/templates/dialogs/costSelection.hbs' } }; diff --git a/module/dialogs/d20RollDialog.mjs b/module/applications/dialogs/d20RollDialog.mjs similarity index 95% rename from module/dialogs/d20RollDialog.mjs rename to module/applications/dialogs/d20RollDialog.mjs index 26efaf7d..cf620e43 100644 --- a/module/dialogs/d20RollDialog.mjs +++ b/module/applications/dialogs/d20RollDialog.mjs @@ -41,11 +41,11 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio static PARTS = { costSelection: { id: 'costSelection', - template: 'systems/daggerheart/templates/views/costSelection.hbs' + template: 'systems/daggerheart/templates/dialogs/costSelection.hbs' }, rollSelection: { id: 'rollSelection', - template: 'systems/daggerheart/templates/views/rollSelection.hbs' + template: 'systems/daggerheart/templates/dialogs/rollSelection.hbs' } }; @@ -60,7 +60,7 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio })); context.selectedExperiences = this.config.experiences; context.advantage = this.config.roll?.advantage; - context.diceOptions = SYSTEM.GENERAL.diceTypes; + context.diceOptions = CONFIG.DH.GENERAL.diceTypes; context.canRoll = true; context.isLite = this.config.roll?.lite; if (this.config.costs?.length) { diff --git a/module/dialogs/damageDialog.mjs b/module/applications/dialogs/damageDialog.mjs similarity index 95% rename from module/dialogs/damageDialog.mjs rename to module/applications/dialogs/damageDialog.mjs index afec593b..84709251 100644 --- a/module/dialogs/damageDialog.mjs +++ b/module/applications/dialogs/damageDialog.mjs @@ -30,7 +30,7 @@ export default class DamageDialog extends HandlebarsApplicationMixin(Application static PARTS = { damageSelection: { id: 'damageSelection', - template: 'systems/daggerheart/templates/views/damageSelection.hbs' + template: 'systems/daggerheart/templates/dialogs/damageSelection.hbs' } }; diff --git a/module/applications/damageReductionDialog.mjs b/module/applications/dialogs/damageReductionDialog.mjs similarity index 98% rename from module/applications/damageReductionDialog.mjs rename to module/applications/dialogs/damageReductionDialog.mjs index 676def9e..c91bf5d3 100644 --- a/module/applications/damageReductionDialog.mjs +++ b/module/applications/dialogs/damageReductionDialog.mjs @@ -1,4 +1,4 @@ -import { damageKeyToNumber, getDamageLabel } from '../helpers/utils.mjs'; +import { damageKeyToNumber, getDamageLabel } from '../../helpers/utils.mjs'; const { ApplicationV2, HandlebarsApplicationMixin } = foundry.applications.api; @@ -71,7 +71,7 @@ export default class DamageReductionDialog extends HandlebarsApplicationMixin(Ap static PARTS = { damageSelection: { id: 'damageReduction', - template: 'systems/daggerheart/templates/views/damageReduction.hbs' + template: 'systems/daggerheart/templates/dialogs/damageReduction.hbs' } }; diff --git a/module/applications/damageSelectionDialog.mjs b/module/applications/dialogs/damageSelectionDialog.mjs similarity index 95% rename from module/applications/damageSelectionDialog.mjs rename to module/applications/dialogs/damageSelectionDialog.mjs index 8b7071f7..f4f44bc8 100644 --- a/module/applications/damageSelectionDialog.mjs +++ b/module/applications/dialogs/damageSelectionDialog.mjs @@ -7,7 +7,7 @@ export default class DamageSelectionDialog extends HandlebarsApplicationMixin(Ap this.data = { rollString, bonusDamage: bonusDamage.reduce((acc, x) => { - if (x.appliesOn === SYSTEM.EFFECTS.applyLocations.damageRoll.id) { + if (x.appliesOn === CONFIG.DH.EFFECTS.applyLocations.damageRoll.id) { acc.push({ ...x, hopeUses: 0 @@ -44,7 +44,7 @@ export default class DamageSelectionDialog extends HandlebarsApplicationMixin(Ap static PARTS = { damageSelection: { id: 'damageSelection', - template: 'systems/daggerheart/templates/views/damageSelection.hbs' + template: 'systems/daggerheart/templates/dialogs/damageSelection.hbs' } }; diff --git a/module/applications/deathMove.mjs b/module/applications/dialogs/deathMove.mjs similarity index 86% rename from module/applications/deathMove.mjs rename to module/applications/dialogs/deathMove.mjs index ea2c86e6..ecb8ed60 100644 --- a/module/applications/deathMove.mjs +++ b/module/applications/dialogs/deathMove.mjs @@ -24,21 +24,21 @@ export default class DhpDeathMove extends HandlebarsApplicationMixin(Application static PARTS = { application: { id: 'death-move', - template: 'systems/daggerheart/templates/views/deathMove.hbs' + template: 'systems/daggerheart/templates/dialogs/deathMove.hbs' } }; async _prepareContext(_options) { const context = await super._prepareContext(_options); context.selectedMove = this.selectedMove; - context.options = SYSTEM.GENERAL.deathMoves; + context.options = CONFIG.DH.GENERAL.deathMoves; return context; } static selectMove(_, button) { const move = button.dataset.move; - this.selectedMove = SYSTEM.GENERAL.deathMoves[move]; + this.selectedMove = CONFIG.DH.GENERAL.deathMoves[move]; this.render(); } @@ -48,7 +48,7 @@ export default class DhpDeathMove extends HandlebarsApplicationMixin(Application const msg = new cls({ user: game.user.id, content: await foundry.applications.handlebars.renderTemplate( - 'systems/daggerheart/templates/chat/deathMove.hbs', + 'systems/daggerheart/templates/ui/chat/deathMove.hbs', { player: this.actor.name, title: game.i18n.localize(this.selectedMove.name), diff --git a/module/applications/downtime.mjs b/module/applications/dialogs/downtime.mjs similarity index 91% rename from module/applications/downtime.mjs rename to module/applications/dialogs/downtime.mjs index d0fc34b6..a5da3ffb 100644 --- a/module/applications/downtime.mjs +++ b/module/applications/dialogs/downtime.mjs @@ -1,4 +1,4 @@ -import { actionsTypes } from '../data/_module.mjs'; +import { actionsTypes } from '../../data/_module.mjs'; const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api; @@ -9,7 +9,7 @@ export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV this.actor = actor; this.shortrest = shortrest; - const options = game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Homebrew).restMoves; + const options = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).restMoves; this.moveData = shortrest ? options.shortRest : options.longRest; } @@ -31,7 +31,7 @@ export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV static PARTS = { application: { id: 'downtime', - template: 'systems/daggerheart/templates/views/downtime.hbs' + template: 'systems/daggerheart/templates/dialogs/downtime.hbs' } }; @@ -88,7 +88,7 @@ export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV actor: this.actor.uuid }, content: await foundry.applications.handlebars.renderTemplate( - 'systems/daggerheart/templates/chat/downtime.hbs', + 'systems/daggerheart/templates/ui/chat/downtime.hbs', { title: `${this.actor.name} - ${game.i18n.localize(`DAGGERHEART.Downtime.${this.shortRest ? 'ShortRest' : 'LongRest'}.title`)}`, moves: moves diff --git a/module/applications/ownershipSelection.mjs b/module/applications/dialogs/ownershipSelection.mjs similarity index 95% rename from module/applications/ownershipSelection.mjs rename to module/applications/dialogs/ownershipSelection.mjs index 380acfe1..3555b585 100644 --- a/module/applications/ownershipSelection.mjs +++ b/module/applications/dialogs/ownershipSelection.mjs @@ -22,7 +22,7 @@ export default class OwnershipSelection extends HandlebarsApplicationMixin(Appli static PARTS = { selection: { - template: 'systems/daggerheart/templates/views/ownershipSelection.hbs' + template: 'systems/daggerheart/templates/dialogs/ownershipSelection.hbs' } }; diff --git a/module/applications/levelup/characterLevelup.mjs b/module/applications/levelup/characterLevelup.mjs index 26a425e1..b9f36e0c 100644 --- a/module/applications/levelup/characterLevelup.mjs +++ b/module/applications/levelup/characterLevelup.mjs @@ -1,13 +1,15 @@ import LevelUpBase from './levelup.mjs'; import { DhLevelup } from '../../data/levelup.mjs'; -import { domains } from '../../config/domainConfig.mjs'; -import { abilities } from '../../config/actorConfig.mjs'; +import { domains } from '../../applications/config/domainConfig.mjs'; +import { abilities } from '../../applications/config/actorConfig.mjs'; export default class DhCharacterLevelUp extends LevelUpBase { constructor(actor) { super(actor); - this.levelTiers = this.addBonusChoices(game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.LevelTiers)); + this.levelTiers = this.addBonusChoices( + game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LevelTiers) + ); const playerLevelupData = actor.system.levelData; this.levelup = new DhLevelup(DhLevelup.initializeData(this.levelTiers, playerLevelupData)); } diff --git a/module/applications/levelup/companionLevelup.mjs b/module/applications/levelup/companionLevelup.mjs index 64cbef82..e041e1a6 100644 --- a/module/applications/levelup/companionLevelup.mjs +++ b/module/applications/levelup/companionLevelup.mjs @@ -1,7 +1,7 @@ import BaseLevelUp from './levelup.mjs'; import { defaultCompanionTier, LevelOptionType } from '../../data/levelTier.mjs'; import { DhLevelup } from '../../data/levelup.mjs'; -import { diceTypes, range } from '../../config/generalConfig.mjs'; +import { diceTypes, range } from '../../applications/config/generalConfig.mjs'; export default class DhCompanionLevelUp extends BaseLevelUp { constructor(actor) { diff --git a/module/applications/levelup/levelup.mjs b/module/applications/levelup/levelup.mjs index 02291514..fd2c8034 100644 --- a/module/applications/levelup/levelup.mjs +++ b/module/applications/levelup/levelup.mjs @@ -1,5 +1,5 @@ -import { abilities, subclassFeatureLabels } from '../../config/actorConfig.mjs'; -import { domains } from '../../config/domainConfig.mjs'; +import { abilities, subclassFeatureLabels } from '../../applications/config/actorConfig.mjs'; +import { domains } from '../../applications/config/domainConfig.mjs'; import { getDeleteKeys, tagifyElement } from '../../helpers/utils.mjs'; const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api; @@ -43,10 +43,10 @@ export default class DhlevelUp extends HandlebarsApplicationMixin(ApplicationV2) }; static PARTS = { - tabs: { template: 'systems/daggerheart/templates/views/levelup/tabs/tab-navigation.hbs' }, - advancements: { template: 'systems/daggerheart/templates/views/levelup/tabs/advancements.hbs' }, - selections: { template: 'systems/daggerheart/templates/views/levelup/tabs/selections.hbs' }, - summary: { template: 'systems/daggerheart/templates/views/levelup/tabs/summary.hbs' } + tabs: { template: 'systems/daggerheart/templates/levelup/tabs/tab-navigation.hbs' }, + advancements: { template: 'systems/daggerheart/templates/levelup/tabs/advancements.hbs' }, + selections: { template: 'systems/daggerheart/templates/levelup/tabs/selections.hbs' }, + summary: { template: 'systems/daggerheart/templates/levelup/tabs/summary.hbs' } }; static TABS = { diff --git a/module/applications/npcRollSelectionDialog.mjs b/module/applications/npcRollSelectionDialog.mjs deleted file mode 100644 index 1a56f12a..00000000 --- a/module/applications/npcRollSelectionDialog.mjs +++ /dev/null @@ -1,80 +0,0 @@ -/** NOT USED ANYMORE - TO BE DELETED **/ - -const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api; - -export default class NpcRollSelectionDialog extends HandlebarsApplicationMixin(ApplicationV2) { - constructor(experiences, resolve, reject) { - super({}); - - this.experiences = experiences; - this.resolve = resolve; - this.reject = reject; - this.selectedExperiences = []; - this.data = { - advantage: null - }; - } - - get title() { - return game.i18n.localize('DAGGERHEART.Application.RollSelection.Title'); - } - - static DEFAULT_OPTIONS = { - tag: 'form', - classes: ['daggerheart', 'views', 'npc-roll-selection'], - position: { width: '500', height: 'auto' }, - actions: { - updateIsAdvantage: this.updateIsAdvantage, - selectExperience: this.selectExperience - }, - form: { handler: this.updateData, submitOnChange: false } - }; - - static PARTS = { - main: { - id: 'main', - template: 'systems/daggerheart/templates/views/npcRollSelection.hbs' - } - }; - - async _prepareContext(_options) { - const context = await super._prepareContext(_options); - context.advantage = this.data.advantage; - context.experiences = Object.values(this.experiences).map(x => ({ - ...x, - selected: this.selectedExperiences.find(selected => selected.id === x.id), - value: `${x.value >= 0 ? '+' : '-'}${x.value}` - })); - - return context; - } - - static updateIsAdvantage(_, button) { - const advantage = Boolean(button.dataset.advantage); - this.data.advantage = this.data.advantage === advantage ? null : advantage; - this.render(); - } - - static selectExperience(_, button) { - const experience = Object.values(this.experiences).find(experience => experience.id === button.id); - this.selectedExperiences = this.selectedExperiences.find(x => x.id === experience.id) - ? this.selectedExperiences.filter(x => x.id !== experience.id) - : [...this.selectedExperiences, experience]; - - this.render(); - } - - static async updateData() { - this.resolve({ ...this.data, experiences: this.selectedExperiences }); - this.close({ updateClose: true }); - } - - async close(options = {}) { - const { updateClose, ...baseOptions } = options; - if (!updateClose) { - this.reject(); - } - - await super.close(baseOptions); - } -} diff --git a/module/applications/rollSelectionDialog.mjs b/module/applications/rollSelectionDialog.mjs deleted file mode 100644 index 543fa6c5..00000000 --- a/module/applications/rollSelectionDialog.mjs +++ /dev/null @@ -1,111 +0,0 @@ -/** NOT USED ANYMORE - TO BE DELETED **/ - -const { ApplicationV2, HandlebarsApplicationMixin } = foundry.applications.api; - -export default class RollSelectionDialog extends HandlebarsApplicationMixin(ApplicationV2) { - constructor(experiences, costs, action, resolve) { - super({}, {}); - - this.experiences = experiences; - this.costs = costs; - this.action = action; - this.resolve = resolve; - this.isNpc; - this.selectedExperiences = []; - this.data = { - diceOptions: [ - { name: 'd12', value: 'd12' }, - { name: 'd20', value: 'd20' } - ], - hope: ['d12'], - fear: ['d12'], - advantage: null - }; - } - - static DEFAULT_OPTIONS = { - tag: 'form', - id: 'roll-selection', - classes: ['daggerheart', 'views', 'roll-selection'], - position: { - width: 400, - height: 'auto' - }, - actions: { - updateIsAdvantage: this.updateIsAdvantage, - selectExperience: this.selectExperience, - finish: this.finish - }, - form: { - handler: this.updateSelection, - submitOnChange: true, - submitOnClose: false - } - }; - - /** @override */ - static PARTS = { - costSelection: { - id: 'costSelection', - template: 'systems/daggerheart/templates/views/costSelection.hbs' - }, - damageSelection: { - id: 'damageSelection', - template: 'systems/daggerheart/templates/views/rollSelection.hbs' - } - }; - - get title() { - return game.i18n.localize('DAGGERHEART.Application.RollSelection.Title'); - } - - async _prepareContext(_options) { - const context = await super._prepareContext(_options); - context.isNpc = this.isNpc; - context.diceOptions = this.data.diceOptions; - context.hope = this.data.hope; - context.fear = this.data.fear; - context.advantage = this.data.advantage; - context.experiences = Object.keys(this.experiences).map(id => ({ id, ...this.experiences[id] })); - if (this.costs?.length) { - const updatedCosts = this.action.calcCosts(this.costs); - context.costs = updatedCosts; - context.canRoll = this.action.getRealCosts(updatedCosts)?.hasCost; - } else context.canRoll = true; - - return context; - } - - static updateSelection(event, _, formData) { - const { ...rest } = foundry.utils.expandObject(formData.object); - this.data = foundry.utils.mergeObject(this.data, rest); - this.costs = foundry.utils.mergeObject(this.costs, rest.costs); - this.render(); - } - - static selectExperience(_, button) { - if (this.selectedExperiences.find(x => x.id === button.dataset.key)) { - this.selectedExperiences = this.selectedExperiences.filter(x => x.id !== button.dataset.key); - } else { - this.selectedExperiences = [...this.selectedExperiences, button.dataset.key]; - } - - this.render(); - } - - static updateIsAdvantage(_, button) { - const advantage = Boolean(button.dataset.advantage); - this.data.advantage = this.data.advantage === advantage ? null : advantage; - this.render(); - } - - static async finish() { - const { diceOptions, ...rest } = this.data; - this.resolve({ - ...rest, - experiences: this.selectedExperiences.map(x => ({ id: x, ...this.experiences[x] })), - costs: this.action.getRealCosts(this.costs) - }); - this.close(); - } -} diff --git a/module/applications/settings/appearanceSettings.mjs b/module/applications/settings/appearanceSettings.mjs index c11efd0f..51185b81 100644 --- a/module/applications/settings/appearanceSettings.mjs +++ b/module/applications/settings/appearanceSettings.mjs @@ -7,7 +7,7 @@ export default class DHAppearanceSettings extends HandlebarsApplicationMixin(App super({}); this.settings = new DhAppearance( - game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance).toObject() + game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance).toObject() ); } @@ -53,10 +53,10 @@ export default class DHAppearanceSettings extends HandlebarsApplicationMixin(App } static async save() { - await game.settings.set(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance, this.settings.toObject()); + await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance, this.settings.toObject()); document.body.classList.toggle( 'theme-colorful', - game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance).dualityColorScheme === + game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance).dualityColorScheme === DualityRollColor.colorful.value ); diff --git a/module/applications/settings/automationSettings.mjs b/module/applications/settings/automationSettings.mjs index 6de21efd..a32b0dae 100644 --- a/module/applications/settings/automationSettings.mjs +++ b/module/applications/settings/automationSettings.mjs @@ -7,7 +7,7 @@ export default class DhAutomationSettings extends HandlebarsApplicationMixin(App super({}); this.settings = new DhAutomation( - game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Automation).toObject() + game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation).toObject() ); } @@ -53,7 +53,7 @@ export default class DhAutomationSettings extends HandlebarsApplicationMixin(App } static async save() { - await game.settings.set(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Automation, this.settings.toObject()); + await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation, this.settings.toObject()); this.close(); } } diff --git a/module/applications/settings/components/settingsActionsView.mjs b/module/applications/settings/components/settingsActionsView.mjs index ff0f0286..b8cc8fbd 100644 --- a/module/applications/settings/components/settingsActionsView.mjs +++ b/module/applications/settings/components/settingsActionsView.mjs @@ -96,8 +96,8 @@ export default class DhSettingsActionView extends HandlebarsApplicationMixin(App async selectActionType() { const content = await foundry.applications.handlebars.renderTemplate( - 'systems/daggerheart/templates/views/actionType.hbs', - { types: SYSTEM.ACTIONS.actionTypes } + 'systems/daggerheart/templates/actionTypes/actionType.hbs', + { types: CONFIG.DH.ACTIONS.actionTypes } ), title = 'Select Action Type', type = 'form', @@ -123,7 +123,7 @@ export default class DhSettingsActionView extends HandlebarsApplicationMixin(App action = new cls({ _id: foundry.utils.randomID(), type: actionType.type, - name: game.i18n.localize(SYSTEM.ACTIONS.actionTypes[actionType.type].name), + name: game.i18n.localize(CONFIG.DH.ACTIONS.actionTypes[actionType.type].name), ...cls.getSourceConfig(this.document) }); diff --git a/module/applications/settings/homebrewSettings.mjs b/module/applications/settings/homebrewSettings.mjs index e67afb1b..f54f127f 100644 --- a/module/applications/settings/homebrewSettings.mjs +++ b/module/applications/settings/homebrewSettings.mjs @@ -7,7 +7,9 @@ export default class DhHomebrewSettings extends HandlebarsApplicationMixin(Appli constructor() { super({}); - this.settings = new DhHomebrew(game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Homebrew).toObject()); + this.settings = new DhHomebrew( + game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).toObject() + ); } get title() { @@ -113,7 +115,7 @@ export default class DhHomebrewSettings extends HandlebarsApplicationMixin(Appli if (!confirmed) return; - const fields = game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Homebrew).schema.fields; + const fields = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).schema.fields; const removeUpdate = Object.keys(this.settings.restMoves[target.dataset.type].moves).reduce((acc, key) => { acc[`-=${key}`] = null; @@ -153,7 +155,7 @@ export default class DhHomebrewSettings extends HandlebarsApplicationMixin(Appli } static async save() { - await game.settings.set(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Homebrew, this.settings.toObject()); + await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew, this.settings.toObject()); this.close(); } diff --git a/module/applications/settings/rangeMeasurementSettings.mjs b/module/applications/settings/rangeMeasurementSettings.mjs index 8e90b462..e655d963 100644 --- a/module/applications/settings/rangeMeasurementSettings.mjs +++ b/module/applications/settings/rangeMeasurementSettings.mjs @@ -7,7 +7,7 @@ export default class DhRangeMeasurementSettings extends HandlebarsApplicationMix super({}); this.settings = new DhRangeMeasurement( - game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.RangeMeasurement).toObject() + game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.RangeMeasurement).toObject() ); } @@ -53,7 +53,11 @@ export default class DhRangeMeasurementSettings extends HandlebarsApplicationMix } static async save() { - await game.settings.set(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.RangeMeasurement, this.settings.toObject()); + await game.settings.set( + CONFIG.DH.id, + CONFIG.DH.SETTINGS.gameSettings.RangeMeasurement, + this.settings.toObject() + ); this.close(); } } diff --git a/module/applications/settings/variantRuleSettings.mjs b/module/applications/settings/variantRuleSettings.mjs index 101d3e42..26a73761 100644 --- a/module/applications/settings/variantRuleSettings.mjs +++ b/module/applications/settings/variantRuleSettings.mjs @@ -7,7 +7,7 @@ export default class DHVariantRuleSettings extends HandlebarsApplicationMixin(Ap super({}); this.settings = new DhVariantRules( - game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.variantRules).toObject() + game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.variantRules).toObject() ); } @@ -53,7 +53,7 @@ export default class DHVariantRuleSettings extends HandlebarsApplicationMixin(Ap } static async save() { - await game.settings.set(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.variantRules, this.settings.toObject()); + await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.variantRules, this.settings.toObject()); this.close(); } } diff --git a/module/applications/sheets/actors/adversary.mjs b/module/applications/sheets/actors/adversary.mjs index e2f5c978..9ea04f9f 100644 --- a/module/applications/sheets/actors/adversary.mjs +++ b/module/applications/sheets/actors/adversary.mjs @@ -92,7 +92,7 @@ export default class AdversarySheet extends DaggerheartSheet(ActorSheetV2) { }, chatMessage: { type: 'adversaryRoll', - template: 'systems/daggerheart/templates/chat/adversary-roll.hbs', + template: 'systems/daggerheart/templates/ui/chat/adversary-roll.hbs', mute: true } }; @@ -127,7 +127,7 @@ export default class AdversarySheet extends DaggerheartSheet(ActorSheetV2) { user: game.user.id, system: systemData, content: await foundry.applications.handlebars.renderTemplate( - 'systems/daggerheart/templates/chat/ability-use.hbs', + 'systems/daggerheart/templates/ui/chat/ability-use.hbs', systemData ) }); diff --git a/module/applications/sheets/actors/character.mjs b/module/applications/sheets/actors/character.mjs index 10791435..d1766844 100644 --- a/module/applications/sheets/actors/character.mjs +++ b/module/applications/sheets/actors/character.mjs @@ -1,13 +1,11 @@ import { capitalize } from '../../../helpers/utils.mjs'; -import DhpDeathMove from '../../deathMove.mjs'; -import DhpDowntime from '../../downtime.mjs'; -import AncestrySelectionDialog from '../../ancestrySelectionDialog.mjs'; +import DhpDeathMove from '../../dialogs/deathMove.mjs'; +import DhpDowntime from '../../dialogs/downtime.mjs'; import DaggerheartSheet from '.././daggerheart-sheet.mjs'; -import { abilities } from '../../../config/actorConfig.mjs'; +import { abilities } from '../../../applications/config/actorConfig.mjs'; import DhCharacterlevelUp from '../../levelup/characterLevelup.mjs'; -import DhCharacterCreation from '../../characterCreation.mjs'; +import DhCharacterCreation from '../../characterCreation/characterCreation.mjs'; import FilterMenu from '../../ux/filter-menu.mjs'; -import { DhBeastformAction } from '../../../data/action/action.mjs'; import DHActionConfig from '../../config/Action.mjs'; const { ActorSheetV2 } = foundry.applications.sheets; @@ -33,7 +31,6 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) { useDomainCard: this.useDomainCard, selectClass: this.selectClass, selectSubclass: this.selectSubclass, - selectAncestry: this.selectAncestry, selectCommunity: this.selectCommunity, viewObject: this.viewObject, useItem: this.useItem, @@ -338,13 +335,13 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) { const context = await super._prepareContext(_options); context.document = this.document; context.tabs = super._getTabs(this.constructor.TABS); - context.config = SYSTEM; + context.config = CONFIG.DH; context.attributes = Object.keys(this.document.system.traits).reduce((acc, key) => { acc[key] = { ...this.document.system.traits[key], - name: game.i18n.localize(SYSTEM.ACTOR.abilities[key].name), - verbs: SYSTEM.ACTOR.abilities[key].verbs.map(x => game.i18n.localize(x)) + name: game.i18n.localize(CONFIG.DH.ACTOR.abilities[key].name), + verbs: CONFIG.DH.ACTOR.abilities[key].verbs.map(x => game.i18n.localize(x)) }; return acc; @@ -360,7 +357,7 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) { } }; - const homebrewCurrency = game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Homebrew).currency; + const homebrewCurrency = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).currency; if (homebrewCurrency.enabled) { context.inventory.currency = homebrewCurrency; } @@ -631,13 +628,13 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) { static async toggleLoadoutView(_, button) { const newAbilityView = !(button.dataset.value === 'true'); - await game.user.setFlag(SYSTEM.id, SYSTEM.FLAGS.displayDomainCardsAsList, newAbilityView); + await game.user.setFlag(CONFIG.DH.id, CONFIG.DH.FLAGS.displayDomainCardsAsList, newAbilityView); this.render(); } static async toggleLoadoutView(_, button) { const newAbilityView = !(button.dataset.value === 'true'); - await game.user.setFlag(SYSTEM.id, SYSTEM.FLAGS.displayDomainCardsAsList, newAbilityView); + await game.user.setFlag(CONFIG.DH.id, CONFIG.DH.FLAGS.displayDomainCardsAsList, newAbilityView); this.render(); } @@ -647,7 +644,7 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) { const wasUsed = await weapon.use(event); if (wasUsed) { - Hooks.callAll(SYSTEM.HOOKS.characterAttack, {}); + Hooks.callAll(CONFIG.DH.HOOKS.characterAttack, {}); } } @@ -689,7 +686,7 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) { type: 'abilityUse', user: game.user.id, content: await foundry.applications.handlebars.renderTemplate( - 'systems/daggerheart/templates/chat/ability-use.hbs', + 'systems/daggerheart/templates/ui/chat/ability-use.hbs', systemData ), system: systemData @@ -706,28 +703,6 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) { (await game.packs.get('daggerheart.subclasses'))?.render(true); } - static async selectAncestry() { - const dialogClosed = new Promise((resolve, _) => { - new AncestrySelectionDialog(resolve).render(true); - }); - const result = await dialogClosed; - - for (var ancestry of this.document.items.filter(x => x => x.type === 'ancestry')) { - await ancestry.delete(); - } - - const createdItems = []; - for (var feature of this.document.items.filter( - x => x.type === 'feature' && x.system.type === SYSTEM.ITEM.featureTypes.ancestry.id - )) { - await feature.delete(); - } - - createdItems.push(result.data); - - await this.document.createEmbeddedDocuments('Item', createdItems); - } - static async selectCommunity() { (await game.packs.get('daggerheart.communities'))?.render(true); } @@ -744,7 +719,7 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) { } else { const wasUsed = await item.use(event); if (wasUsed && item.type === 'weapon') { - Hooks.callAll(SYSTEM.HOOKS.characterAttack, {}); + Hooks.callAll(CONFIG.DH.HOOKS.characterAttack, {}); } } } @@ -840,7 +815,7 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) { type: 'abilityUse', user: game.user.id, content: await foundry.applications.handlebars.renderTemplate( - 'systems/daggerheart/templates/chat/ability-use.hbs', + 'systems/daggerheart/templates/ui/chat/ability-use.hbs', systemData ), system: systemData @@ -862,7 +837,7 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) { user: game.user.id, system: systemData, content: await foundry.applications.handlebars.renderTemplate( - 'systems/daggerheart/templates/chat/ability-use.hbs', + 'systems/daggerheart/templates/ui/chat/ability-use.hbs', systemData ) }); @@ -898,7 +873,7 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) { user: game.user.id, system: systemData, content: await foundry.applications.handlebars.renderTemplate( - 'systems/daggerheart/templates/chat/ability-use.hbs', + 'systems/daggerheart/templates/ui/chat/ability-use.hbs', systemData ) }); @@ -921,7 +896,7 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) { user: game.user.id, system: systemData, content: await foundry.applications.handlebars.renderTemplate( - 'systems/daggerheart/templates/chat/ability-use.hbs', + 'systems/daggerheart/templates/ui/chat/ability-use.hbs', systemData ) }); diff --git a/module/applications/sheets/actors/companion.mjs b/module/applications/sheets/actors/companion.mjs index 89939e9a..23ff42b3 100644 --- a/module/applications/sheets/actors/companion.mjs +++ b/module/applications/sheets/actors/companion.mjs @@ -90,7 +90,7 @@ export default class DhCompanionSheet extends DaggerheartSheet(ActorSheetV2) { user: game.user.id, system: systemData, content: await foundry.applications.handlebars.renderTemplate( - 'systems/daggerheart/templates/chat/ability-use.hbs', + 'systems/daggerheart/templates/ui/chat/ability-use.hbs', systemData ) }); diff --git a/module/applications/sheets/api/application-mixin.mjs b/module/applications/sheets/api/application-mixin.mjs index 2dcfff6e..6f04acb4 100644 --- a/module/applications/sheets/api/application-mixin.mjs +++ b/module/applications/sheets/api/application-mixin.mjs @@ -139,7 +139,7 @@ export default function DHApplicationMixin(Base) { * @param {DragEvent} event * @protected */ - _onDrop(event) { } + _onDrop(event) {} /* -------------------------------------------- */ /* Prepare Context */ @@ -154,7 +154,7 @@ export default function DHApplicationMixin(Base) { */ async _prepareContext(options, objectPath = 'document') { const context = await super._prepareContext(options); - context.config = CONFIG.daggerheart; + context.config = CONFIG.DH; context.source = this[objectPath]; context.fields = this[objectPath].schema.fields; context.systemFields = this[objectPath].system ? this[objectPath].system.schema.fields : {}; diff --git a/module/applications/sheets/api/base-item.mjs b/module/applications/sheets/api/base-item.mjs index 1299b208..18edaf79 100644 --- a/module/applications/sheets/api/base-item.mjs +++ b/module/applications/sheets/api/base-item.mjs @@ -69,8 +69,8 @@ export default class DHBaseItemSheet extends DHApplicationMixin(ItemSheetV2) { */ static async selectActionType() { const content = await foundry.applications.handlebars.renderTemplate( - 'systems/daggerheart/templates/views/actionType.hbs', - { types: SYSTEM.ACTIONS.actionTypes } + 'systems/daggerheart/templates/actionTypes/actionType.hbs', + { types: CONFIG.DH.ACTIONS.actionTypes } ), title = 'Select Action Type'; @@ -98,7 +98,7 @@ export default class DHBaseItemSheet extends DHApplicationMixin(ItemSheetV2) { { _id: foundry.utils.randomID(), type: actionType, - name: game.i18n.localize(SYSTEM.ACTIONS.actionTypes[actionType].name), + name: game.i18n.localize(CONFIG.DH.ACTIONS.actionTypes[actionType].name), ...cls.getSourceConfig(this.document) }, { diff --git a/module/applications/sheets/applications/adversary-settings.mjs b/module/applications/sheets/applications/adversary-settings.mjs index 2ecdcb60..755fb5d3 100644 --- a/module/applications/sheets/applications/adversary-settings.mjs +++ b/module/applications/sheets/applications/adversary-settings.mjs @@ -40,24 +40,24 @@ export default class DHAdversarySettings extends HandlebarsApplicationMixin(Appl static PARTS = { header: { id: 'header', - template: 'systems/daggerheart/templates/sheets/applications/adversary-settings/header.hbs' + template: 'systems/daggerheart/templates/sheets-settings/adversary-settings/header.hbs' }, tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' }, details: { id: 'details', - template: 'systems/daggerheart/templates/sheets/applications/adversary-settings/details.hbs' + template: 'systems/daggerheart/templates/sheets-settings/adversary-settings/details.hbs' }, attack: { id: 'attack', - template: 'systems/daggerheart/templates/sheets/applications/adversary-settings/attack.hbs' + template: 'systems/daggerheart/templates/sheets-settings/adversary-settings/attack.hbs' }, experiences: { id: 'experiences', - template: 'systems/daggerheart/templates/sheets/applications/adversary-settings/experiences.hbs' + template: 'systems/daggerheart/templates/sheets-settings/adversary-settings/experiences.hbs' }, actions: { id: 'actions', - template: 'systems/daggerheart/templates/sheets/applications/adversary-settings/actions.hbs' + template: 'systems/daggerheart/templates/sheets-settings/adversary-settings/actions.hbs' } }; @@ -139,7 +139,7 @@ export default class DHAdversarySettings extends HandlebarsApplicationMixin(Appl { _id: foundry.utils.randomID(), type: actionType, - name: game.i18n.localize(SYSTEM.ACTIONS.actionTypes[actionType].name), + name: game.i18n.localize(CONFIG.DH.ACTIONS.actionTypes[actionType].name), ...cls.getSourceConfig(this.actor) }, { diff --git a/module/applications/sheets/applications/companion-settings.mjs b/module/applications/sheets/applications/companion-settings.mjs index 89d20a07..ed096781 100644 --- a/module/applications/sheets/applications/companion-settings.mjs +++ b/module/applications/sheets/applications/companion-settings.mjs @@ -1,4 +1,4 @@ -import { GMUpdateEvent, socketEvent } from '../../../helpers/socket.mjs'; +import { GMUpdateEvent, socketEvent } from '../../../systemRegistration/socket.mjs'; import DhCompanionlevelUp from '../../levelup/companionLevelup.mjs'; const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api; @@ -35,20 +35,20 @@ export default class DHCompanionSettings extends HandlebarsApplicationMixin(Appl static PARTS = { header: { id: 'header', - template: 'systems/daggerheart/templates/sheets/applications/companion-settings/header.hbs' + template: 'systems/daggerheart/templates/sheets-settings/companion-settings/header.hbs' }, tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' }, details: { id: 'details', - template: 'systems/daggerheart/templates/sheets/applications/companion-settings/details.hbs' + template: 'systems/daggerheart/templates/sheets-settings/companion-settings/details.hbs' }, experiences: { id: 'experiences', - template: 'systems/daggerheart/templates/sheets/applications/companion-settings/experiences.hbs' + template: 'systems/daggerheart/templates/sheets-settings/companion-settings/experiences.hbs' }, attack: { id: 'attack', - template: 'systems/daggerheart/templates/sheets/applications/companion-settings/attack.hbs' + template: 'systems/daggerheart/templates/sheets-settings/companion-settings/attack.hbs' } }; @@ -120,7 +120,7 @@ export default class DHCompanionSettings extends HandlebarsApplicationMixin(Appl const partnerUpdate = { 'system.companion': event.target.value ? this.actor.uuid : null }; if (!partnerDocument.testUserPermission(game.user, CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER)) { - await game.socket.emit(`system.${SYSTEM.id}`, { + await game.socket.emit(`system.${CONFIG.DH.id}`, { action: socketEvent.GMUpdate, data: { action: GMUpdateEvent.UpdateDocument, diff --git a/module/applications/sheets/applications/environment-settings.mjs b/module/applications/sheets/applications/environment-settings.mjs index fa58893b..24098ba9 100644 --- a/module/applications/sheets/applications/environment-settings.mjs +++ b/module/applications/sheets/applications/environment-settings.mjs @@ -44,20 +44,20 @@ export default class DHEnvironmentSettings extends HandlebarsApplicationMixin(Ap static PARTS = { header: { id: 'header', - template: 'systems/daggerheart/templates/sheets/applications/environment-settings/header.hbs' + template: 'systems/daggerheart/templates/sheets-settings/environment-settings/header.hbs' }, tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' }, details: { id: 'details', - template: 'systems/daggerheart/templates/sheets/applications/environment-settings/details.hbs' + template: 'systems/daggerheart/templates/sheets-settings/environment-settings/details.hbs' }, actions: { id: 'actions', - template: 'systems/daggerheart/templates/sheets/applications/environment-settings/actions.hbs' + template: 'systems/daggerheart/templates/sheets-settings/environment-settings/actions.hbs' }, adversaries: { id: 'adversaries', - template: 'systems/daggerheart/templates/sheets/applications/environment-settings/adversaries.hbs' + template: 'systems/daggerheart/templates/sheets-settings/environment-settings/adversaries.hbs' } }; @@ -131,7 +131,7 @@ export default class DHEnvironmentSettings extends HandlebarsApplicationMixin(Ap { _id: foundry.utils.randomID(), type: actionType, - name: game.i18n.localize(SYSTEM.ACTIONS.actionTypes[actionType].name), + name: game.i18n.localize(CONFIG.DH.ACTIONS.actionTypes[actionType].name), ...cls.getSourceConfig(this.actor) }, { @@ -200,7 +200,7 @@ export default class DHEnvironmentSettings extends HandlebarsApplicationMixin(Ap } async _onDrop(event) { - const data = TextEditor.getDragEventData(event); + const data = foundry.applications.ux.TextEditor.implementation.getDragEventData(event); const item = await fromUuid(data.uuid); if (item.type === 'adversary') { const target = event.target.closest('.category-container'); diff --git a/module/applications/sheets/items/armor.mjs b/module/applications/sheets/items/armor.mjs index 4e53d8fa..bb98c8c3 100644 --- a/module/applications/sheets/items/armor.mjs +++ b/module/applications/sheets/items/armor.mjs @@ -8,7 +8,7 @@ export default class ArmorSheet extends DHBaseItemSheet { tagifyConfigs: [ { selector: '.features-input', - options: () => CONFIG.daggerheart.ITEM.armorFeatures, + options: () => CONFIG.DH.ITEM.armorFeatures, callback: ArmorSheet.#onFeatureSelect } ] diff --git a/module/applications/sheets/items/beastform.mjs b/module/applications/sheets/items/beastform.mjs index b04671ec..9ce9b739 100644 --- a/module/applications/sheets/items/beastform.mjs +++ b/module/applications/sheets/items/beastform.mjs @@ -55,7 +55,7 @@ export default class BeastformSheet extends DHBaseItemSheet { } async _onDrop(event) { - const data = TextEditor.getDragEventData(event); + const data = foundry.applications.ux.TextEditor.implementation.getDragEventData(event); const item = await fromUuid(data.uuid); if (item.type === 'feature') { const current = this.document.system.features.map(x => x.uuid); diff --git a/module/applications/sheets/items/class.mjs b/module/applications/sheets/items/class.mjs index efe556fa..a9308718 100644 --- a/module/applications/sheets/items/class.mjs +++ b/module/applications/sheets/items/class.mjs @@ -20,7 +20,7 @@ export default class ClassSheet extends DHBaseItemSheet { tagifyConfigs: [ { selector: '.domain-input', - options: () => CONFIG.daggerheart.DOMAIN.domains, + options: () => CONFIG.DH.DOMAIN.domains, callback: ClassSheet.#onDomainSelect } ], @@ -172,8 +172,8 @@ export default class ClassSheet extends DHBaseItemSheet { //TODO: redo this async selectActionType() { const content = await foundry.applications.handlebars.renderTemplate( - 'systems/daggerheart/templates/views/actionType.hbs', - { types: SYSTEM.ACTIONS.actionTypes } + 'systems/daggerheart/templates/actionTypes/actionType.hbs', + { types: CONFIG.DH.ACTIONS.actionTypes } ), title = 'Select Action Type', type = 'form', @@ -209,7 +209,7 @@ export default class ClassSheet extends DHBaseItemSheet { _id: foundry.utils.randomID(), systemPath: actionPath, type: actionType.type, - name: game.i18n.localize(SYSTEM.ACTIONS.actionTypes[actionType.type].name), + name: game.i18n.localize(CONFIG.DH.ACTIONS.actionTypes[actionType.type].name), ...cls.getSourceConfig(this.document) }, { diff --git a/module/applications/sheets/items/subclass.mjs b/module/applications/sheets/items/subclass.mjs index 841c3eb2..6e330767 100644 --- a/module/applications/sheets/items/subclass.mjs +++ b/module/applications/sheets/items/subclass.mjs @@ -58,8 +58,8 @@ export default class SubclassSheet extends DHBaseItemSheet { async #selectActionType() { const content = await foundry.applications.handlebars.renderTemplate( - 'systems/daggerheart/templates/views/actionType.hbs', - { types: SYSTEM.ACTIONS.actionTypes } + 'systems/daggerheart/templates/actionTypes/actionType.hbs', + { types: CONFIG.DH.ACTIONS.actionTypes } ), title = 'Select Action Type', type = 'form', @@ -87,7 +87,7 @@ export default class SubclassSheet extends DHBaseItemSheet { _id: foundry.utils.randomID(), systemPath: `${level}.actions`, type: actionType.type, - name: game.i18n.localize(SYSTEM.ACTIONS.actionTypes[actionType.type].name), + name: game.i18n.localize(CONFIG.DH.ACTIONS.actionTypes[actionType.type].name), ...cls.getSourceConfig(this.document) }, { diff --git a/module/applications/sheets/items/weapon.mjs b/module/applications/sheets/items/weapon.mjs index 5f2a12d7..fdce55fc 100644 --- a/module/applications/sheets/items/weapon.mjs +++ b/module/applications/sheets/items/weapon.mjs @@ -7,7 +7,7 @@ export default class WeaponSheet extends DHBaseItemSheet { tagifyConfigs: [ { selector: '.features-input', - options: () => CONFIG.daggerheart.ITEM.weaponFeatures, + options: () => CONFIG.DH.ITEM.weaponFeatures, callback: WeaponSheet.#onFeatureSelect } ] diff --git a/module/applications/ui/_module.mjs b/module/applications/ui/_module.mjs new file mode 100644 index 00000000..ef55360e --- /dev/null +++ b/module/applications/ui/_module.mjs @@ -0,0 +1,6 @@ +import { default as DhChatLog } from './chatLog.mjs'; +import { default as DhCombatTracker } from './combatTracker.mjs'; +import * as DhCountdowns from './countdowns.mjs'; +import { default as DhFearTracker } from './fearTracker.mjs'; + +export { DhChatLog, DhCombatTracker, DhCountdowns, DhFearTracker }; diff --git a/module/ui/chatLog.mjs b/module/applications/ui/chatLog.mjs similarity index 98% rename from module/ui/chatLog.mjs rename to module/applications/ui/chatLog.mjs index 14d99734..4ec54946 100644 --- a/module/ui/chatLog.mjs +++ b/module/applications/ui/chatLog.mjs @@ -1,4 +1,4 @@ -import { actionsTypes } from '../data/_module.mjs'; +import { actionsTypes } from '../../data/_module.mjs'; export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLog { constructor() { @@ -213,7 +213,7 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo for (let target of targets) { let damage = message.system.roll.total; if (message.system.onSave && message.system.targets.find(t => t.id === target.id)?.saved?.success === true) - damage = Math.ceil(damage * (SYSTEM.ACTIONS.damageOnSave[message.system.onSave]?.mod ?? 1)); + damage = Math.ceil(damage * (CONFIG.DH.ACTIONS.damageOnSave[message.system.onSave]?.mod ?? 1)); await target.actor.takeDamage(damage, message.system.roll.type); } diff --git a/module/ui/combatTracker.mjs b/module/applications/ui/combatTracker.mjs similarity index 83% rename from module/ui/combatTracker.mjs rename to module/applications/ui/combatTracker.mjs index d6d64f98..e5414d47 100644 --- a/module/ui/combatTracker.mjs +++ b/module/applications/ui/combatTracker.mjs @@ -1,4 +1,4 @@ -import { EncounterCountdowns } from '../applications/countdowns.mjs'; +import { EncounterCountdowns } from '../ui/countdowns.mjs'; export default class DhCombatTracker extends foundry.applications.sidebar.tabs.CombatTracker { static DEFAULT_OPTIONS = { @@ -12,13 +12,13 @@ export default class DhCombatTracker extends foundry.applications.sidebar.tabs.C static PARTS = { header: { - template: 'systems/daggerheart/templates/ui/combat/combatTrackerHeader.hbs' + template: 'systems/daggerheart/templates/ui/combatTracker/combatTrackerHeader.hbs' }, tracker: { - template: 'systems/daggerheart/templates/ui/combat/combatTracker.hbs' + template: 'systems/daggerheart/templates/ui/combatTracker/combatTracker.hbs' }, footer: { - template: 'systems/daggerheart/templates/ui/combat/combatTrackerFooter.hbs' + template: 'systems/daggerheart/templates/ui/combatTracker/combatTrackerFooter.hbs' } }; @@ -26,7 +26,7 @@ export default class DhCombatTracker extends foundry.applications.sidebar.tabs.C await super._prepareCombatContext(context, options); Object.assign(context, { - fear: game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Resources.Fear) + fear: game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Resources.Fear) }); } @@ -37,7 +37,7 @@ export default class DhCombatTracker extends foundry.applications.sidebar.tabs.C const characters = context.turns?.filter(x => !x.isNPC) ?? []; Object.assign(context, { - actionTokens: game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.variantRules).actionTokens, + actionTokens: game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.variantRules).actionTokens, adversaries, characters }); @@ -86,7 +86,7 @@ export default class DhCombatTracker extends foundry.applications.sidebar.tabs.C .map(x => x.id) .indexOf(combatantId); - if (this.viewed.turn !== toggleTurn) Hooks.callAll(SYSTEM.HOOKS.spotlight, {}); + if (this.viewed.turn !== toggleTurn) Hooks.callAll(CONFIG.DH.HOOKS.spotlight, {}); await this.viewed.update({ turn: this.viewed.turn === toggleTurn ? null : toggleTurn }); await combatant.update({ 'system.spotlight.requesting': false }); diff --git a/module/applications/countdowns.mjs b/module/applications/ui/countdowns.mjs similarity index 75% rename from module/applications/countdowns.mjs rename to module/applications/ui/countdowns.mjs index 54c999a9..4011889d 100644 --- a/module/applications/countdowns.mjs +++ b/module/applications/ui/countdowns.mjs @@ -1,7 +1,7 @@ import { countdownTypes } from '../config/generalConfig.mjs'; -import { GMUpdateEvent, RefreshType, socketEvent } from '../helpers/socket.mjs'; -import constructHTMLButton from '../helpers/utils.mjs'; -import OwnershipSelection from './ownershipSelection.mjs'; +import { GMUpdateEvent, RefreshType, socketEvent } from '../../systemRegistration/socket.mjs'; +import constructHTMLButton from '../../helpers/utils.mjs'; +import OwnershipSelection from '../dialogs/ownershipSelection.mjs'; const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api; @@ -41,7 +41,7 @@ class Countdowns extends HandlebarsApplicationMixin(ApplicationV2) { static PARTS = { countdowns: { - template: 'systems/daggerheart/templates/views/countdowns.hbs', + template: 'systems/daggerheart/templates/ui/countdowns.hbs', scrollable: ['.expanded-view'] } }; @@ -57,18 +57,18 @@ class Countdowns extends HandlebarsApplicationMixin(ApplicationV2) { async _preFirstRender(context, options) { options.position = - game.user.getFlag(SYSTEM.id, SYSTEM.FLAGS[`${this.basePath}Countdown`].position) ?? + game.user.getFlag(CONFIG.DH.id, CONFIG.DH.FLAGS[`${this.basePath}Countdown`].position) ?? Countdowns.DEFAULT_OPTIONS.position; const viewSetting = - game.user.getFlag(SYSTEM.id, SYSTEM.FLAGS[`${this.basePath}Countdown`].simple) ?? !game.user.isGM; + game.user.getFlag(CONFIG.DH.id, CONFIG.DH.FLAGS[`${this.basePath}Countdown`].simple) ?? !game.user.isGM; this.simpleView = game.user.isGM || !this.testUserPermission(CONST.DOCUMENT_OWNERSHIP_LEVELS.OBSERVER) ? viewSetting : true; context.simple = this.simpleView; } _onPosition(position) { - game.user.setFlag(SYSTEM.id, SYSTEM.FLAGS[`${this.basePath}Countdown`].position, position); + game.user.setFlag(CONFIG.DH.id, CONFIG.DH.FLAGS[`${this.basePath}Countdown`].position, position); } async _renderFrame(options) { @@ -90,7 +90,7 @@ class Countdowns extends HandlebarsApplicationMixin(ApplicationV2) { if (game.user.isGM) return true; const settings = - altSettings ?? game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Countdowns)[this.basePath]; + altSettings ?? game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Countdowns)[this.basePath]; const defaultAllowed = exact ? settings.ownership.default === level : settings.ownership.default >= level; const userAllowed = exact ? settings.playerOwnership[game.user.id]?.value === level @@ -100,7 +100,9 @@ class Countdowns extends HandlebarsApplicationMixin(ApplicationV2) { async _prepareContext(_options) { const context = await super._prepareContext(_options); - const countdownData = game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Countdowns)[this.basePath]; + const countdownData = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Countdowns)[ + this.basePath + ]; context.isGM = game.user.isGM; context.base = this.basePath; @@ -131,19 +133,19 @@ class Countdowns extends HandlebarsApplicationMixin(ApplicationV2) { static async updateData(event, _, formData) { const data = foundry.utils.expandObject(formData.object); const newSetting = foundry.utils.mergeObject( - game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Countdowns).toObject(), + game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Countdowns).toObject(), data ); if (game.user.isGM) { - await game.settings.set(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Countdowns, newSetting); + await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Countdowns, newSetting); this.render(); } else { - await game.socket.emit(`system.${SYSTEM.id}`, { + await game.socket.emit(`system.${CONFIG.DH.id}`, { action: socketEvent.GMUpdate, data: { action: GMUpdateEvent.UpdateSetting, - uuid: SYSTEM.SETTINGS.gameSettings.Countdowns, + uuid: CONFIG.DH.SETTINGS.gameSettings.Countdowns, update: newSetting } }); @@ -152,8 +154,8 @@ class Countdowns extends HandlebarsApplicationMixin(ApplicationV2) { async updateSetting(update) { if (game.user.isGM) { - await game.settings.set(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Countdowns, update); - await game.socket.emit(`system.${SYSTEM.id}`, { + await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Countdowns, update); + await game.socket.emit(`system.${CONFIG.DH.id}`, { action: socketEvent.Refresh, data: { refreshType: RefreshType.Countdown, @@ -163,11 +165,11 @@ class Countdowns extends HandlebarsApplicationMixin(ApplicationV2) { this.render(); } else { - await game.socket.emit(`system.${SYSTEM.id}`, { + await game.socket.emit(`system.${CONFIG.DH.id}`, { action: socketEvent.GMUpdate, data: { action: GMUpdateEvent.UpdateSetting, - uuid: SYSTEM.SETTINGS.gameSettings.Countdowns, + uuid: CONFIG.DH.SETTINGS.gameSettings.Countdowns, update: update, refresh: { refreshType: RefreshType.Countdown, application: `${this.basePath}-countdowns` } } @@ -176,7 +178,7 @@ class Countdowns extends HandlebarsApplicationMixin(ApplicationV2) { } static onEditImage(_, target) { - const setting = game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Countdowns)[this.basePath]; + const setting = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Countdowns)[this.basePath]; const current = setting.countdowns[target.dataset.countdown].img; const fp = new foundry.applications.apps.FilePicker.implementation({ current, @@ -189,7 +191,7 @@ class Countdowns extends HandlebarsApplicationMixin(ApplicationV2) { } async updateImage(path, countdown) { - const setting = game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Countdowns); + const setting = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Countdowns); await setting.updateSource({ [`${this.basePath}.countdowns.${countdown}.img`]: path }); @@ -199,16 +201,16 @@ class Countdowns extends HandlebarsApplicationMixin(ApplicationV2) { static openOwnership(_, target) { new Promise((resolve, reject) => { - const setting = game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Countdowns)[this.basePath]; + const setting = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Countdowns)[this.basePath]; const ownership = { default: setting.ownership.default, players: setting.playerOwnership }; new OwnershipSelection(resolve, reject, this.title, ownership).render(true); }).then(async ownership => { - const setting = game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Countdowns); + const setting = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Countdowns); await setting.updateSource({ [`${this.basePath}.ownership`]: ownership }); - await game.settings.set(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Countdowns, setting.toObject()); + await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Countdowns, setting.toObject()); this.render(); }); } @@ -216,29 +218,29 @@ class Countdowns extends HandlebarsApplicationMixin(ApplicationV2) { static openCountdownOwnership(_, target) { const countdownId = target.dataset.countdown; new Promise((resolve, reject) => { - const countdown = game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Countdowns)[this.basePath] + const countdown = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Countdowns)[this.basePath] .countdowns[countdownId]; const ownership = { default: countdown.ownership.default, players: countdown.playerOwnership }; new OwnershipSelection(resolve, reject, countdown.name, ownership).render(true); }).then(async ownership => { - const setting = game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Countdowns); + const setting = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Countdowns); await setting.updateSource({ [`${this.basePath}.countdowns.${countdownId}.ownership`]: ownership }); - await game.settings.set(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Countdowns, setting); + await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Countdowns, setting); this.render(); }); } static async toggleSimpleView() { this.simpleView = !this.simpleView; - await game.user.setFlag(SYSTEM.id, SYSTEM.FLAGS[`${this.basePath}Countdown`].simple, this.simpleView); + await game.user.setFlag(CONFIG.DH.id, CONFIG.DH.FLAGS[`${this.basePath}Countdown`].simple, this.simpleView); this.render(); } async updateCountdownValue(event, increase) { - const countdownSetting = game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Countdowns); + const countdownSetting = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Countdowns); const countdown = countdownSetting[this.basePath].countdowns[event.currentTarget.dataset.countdown]; if (!this.testUserPermission(CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER)) { @@ -260,7 +262,7 @@ class Countdowns extends HandlebarsApplicationMixin(ApplicationV2) { } static async addCountdown() { - const countdownSetting = game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Countdowns); + const countdownSetting = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Countdowns); await countdownSetting.updateSource({ [`${this.basePath}.countdowns.${foundry.utils.randomID()}`]: { name: game.i18n.localize('DAGGERHEART.Countdown.NewCountdown'), @@ -278,7 +280,7 @@ class Countdowns extends HandlebarsApplicationMixin(ApplicationV2) { } static async removeCountdown(_, target) { - const countdownSetting = game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Countdowns); + const countdownSetting = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Countdowns); const countdownName = countdownSetting[this.basePath].countdowns[target.dataset.countdown].name; const confirmed = await foundry.applications.api.DialogV2.confirm({ @@ -297,8 +299,9 @@ class Countdowns extends HandlebarsApplicationMixin(ApplicationV2) { async open() { await this.render(true); if ( - Object.keys(game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Countdowns)[this.basePath].countdowns) - .length > 0 + Object.keys( + game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Countdowns)[this.basePath].countdowns + ).length > 0 ) { this.minimize(); } @@ -327,8 +330,8 @@ export class EncounterCountdowns extends Countdowns { export const registerCountdownApplicationHooks = () => { const updateCountdowns = async shouldProgress => { - if (game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Automation).countdowns) { - const countdownSetting = game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Countdowns); + if (game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation).countdowns) { + const countdownSetting = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Countdowns); for (let countdownCategoryKey in countdownSetting) { const countdownCategory = countdownSetting[countdownCategoryKey]; for (let countdownKey in countdownCategory.countdowns) { @@ -339,7 +342,11 @@ export const registerCountdownApplicationHooks = () => { [`${countdownCategoryKey}.countdowns.${countdownKey}.progress.current`]: countdown.progress.current - 1 }); - await game.settings.set(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Countdowns, countdownSetting); + await game.settings.set( + CONFIG.DH.id, + CONFIG.DH.SETTINGS.gameSettings.Countdowns, + countdownSetting + ); foundry.applications.instances.get(`${countdownCategoryKey}-countdowns`)?.render(); } } @@ -347,7 +354,7 @@ export const registerCountdownApplicationHooks = () => { } }; - Hooks.on(SYSTEM.HOOKS.characterAttack, async () => { + Hooks.on(CONFIG.DH.HOOKS.characterAttack, async () => { updateCountdowns(countdown => { return ( countdown.progress.type.value === countdownTypes.characterAttack.id && countdown.progress.current > 0 @@ -355,7 +362,7 @@ export const registerCountdownApplicationHooks = () => { }); }); - Hooks.on(SYSTEM.HOOKS.spotlight, async () => { + Hooks.on(CONFIG.DH.HOOKS.spotlight, async () => { updateCountdowns(countdown => { return countdown.progress.type.value === countdownTypes.spotlight.id && countdown.progress.current > 0; }); diff --git a/module/applications/resources.mjs b/module/applications/ui/fearTracker.mjs similarity index 71% rename from module/applications/resources.mjs rename to module/applications/ui/fearTracker.mjs index 3b8c6ce6..c2f56c4c 100644 --- a/module/applications/resources.mjs +++ b/module/applications/ui/fearTracker.mjs @@ -8,7 +8,7 @@ const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api; * @mixes HandlebarsApplication */ -export default class Resources extends HandlebarsApplicationMixin(ApplicationV2) { +export default class FearTracker extends HandlebarsApplicationMixin(ApplicationV2) { constructor(options = {}) { super(options); } @@ -26,8 +26,8 @@ export default class Resources extends HandlebarsApplicationMixin(ApplicationV2) minimizable: false }, actions: { - setFear: Resources.setFear, - increaseFear: Resources.increaseFear + setFear: FearTracker.setFear, + increaseFear: FearTracker.increaseFear }, position: { width: 222, @@ -41,16 +41,16 @@ export default class Resources extends HandlebarsApplicationMixin(ApplicationV2) static PARTS = { resources: { root: true, - template: 'systems/daggerheart/templates/views/resources.hbs' + template: 'systems/daggerheart/templates/ui/fearTracker.hbs' } }; get currentFear() { - return game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Resources.Fear); + return game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Resources.Fear); } get maxFear() { - return game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Homebrew).maxFear; + return game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).maxFear; } /* -------------------------------------------- */ @@ -59,7 +59,7 @@ export default class Resources extends HandlebarsApplicationMixin(ApplicationV2) /** @override */ async _prepareContext(_options) { - const display = game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance).displayFear, + const display = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance).displayFear, current = this.currentFear, max = this.maxFear, percent = (current / max) * 100, @@ -70,17 +70,18 @@ export default class Resources extends HandlebarsApplicationMixin(ApplicationV2) /** @override */ async _preFirstRender(context, options) { - options.position = game.user.getFlag(SYSTEM.id, 'app.resources.position') ?? Resources.DEFAULT_OPTIONS.position; + options.position = + game.user.getFlag(CONFIG.DH.id, 'app.resources.position') ?? FearTracker.DEFAULT_OPTIONS.position; } /** @override */ async _preRender(context, options) { if (this.currentFear > this.maxFear) - await game.settings.set(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Resources.Fear, this.maxFear); + await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Resources.Fear, this.maxFear); } _onPosition(position) { - game.user.setFlag(SYSTEM.id, 'app.resources.position', position); + game.user.setFlag(CONFIG.DH.id, 'app.resources.position', position); } async close(options = {}) { @@ -104,6 +105,6 @@ export default class Resources extends HandlebarsApplicationMixin(ApplicationV2) async updateFear(value) { if (!game.user.isGM) return; value = Math.max(0, Math.min(this.maxFear, value)); - await game.settings.set(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Resources.Fear, value); + await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Resources.Fear, value); } } diff --git a/module/applications/contextMenu.mjs b/module/applications/ux/contextMenu.mjs similarity index 100% rename from module/applications/contextMenu.mjs rename to module/applications/ux/contextMenu.mjs diff --git a/module/applications/ux/filter-menu.mjs b/module/applications/ux/filter-menu.mjs index 0973a358..ff2fb036 100644 --- a/module/applications/ux/filter-menu.mjs +++ b/module/applications/ux/filter-menu.mjs @@ -19,7 +19,8 @@ export default class FilterMenu extends foundry.applications.ux.ContextMenu { const mergedOptions = { eventName: 'click', fixed: true, - ...options + ...options, + jQuery: false }; super(container, selector, menuItems, mergedOptions); @@ -176,7 +177,7 @@ export default class FilterMenu extends foundry.applications.ux.ContextMenu { } })); - const burdenFilter = Object.values(CONFIG.daggerheart.GENERAL.burden).map(({ value, label }) => ({ + const burdenFilter = Object.values(CONFIG.DH.GENERAL.burden).map(({ value, label }) => ({ group: game.i18n.localize('DAGGERHEART.Sheets.Weapon.Burden'), name: game.i18n.localize(label), filter: { @@ -186,7 +187,7 @@ export default class FilterMenu extends foundry.applications.ux.ContextMenu { } })); - const damageTypeFilter = Object.values(CONFIG.daggerheart.GENERAL.damageTypes).map(({ id, abbreviation }) => ({ + const damageTypeFilter = Object.values(CONFIG.DH.GENERAL.damageTypes).map(({ id, abbreviation }) => ({ group: 'Damage Type', //TODO localize name: game.i18n.localize(abbreviation), filter: { @@ -210,7 +211,7 @@ export default class FilterMenu extends foundry.applications.ux.ContextMenu { static get cardsFilters() { const { OPERATORS } = foundry.applications.ux.SearchFilter; - const typesFilters = Object.values(CONFIG.daggerheart.DOMAIN.cardTypes).map(({ id, label }) => ({ + const typesFilters = Object.values(CONFIG.DH.DOMAIN.cardTypes).map(({ id, label }) => ({ group: game.i18n.localize('Type'), name: game.i18n.localize(label), filter: { @@ -220,7 +221,7 @@ export default class FilterMenu extends foundry.applications.ux.ContextMenu { } })); - const domainFilter = Object.values(CONFIG.daggerheart.DOMAIN.domains).map(({ id, label }) => ({ + const domainFilter = Object.values(CONFIG.DH.DOMAIN.domains).map(({ id, label }) => ({ group: game.i18n.localize('DAGGERHEART.Sheets.DomainCard.Domain'), name: game.i18n.localize(label), filter: { diff --git a/module/canvas/_module.mjs b/module/canvas/_module.mjs new file mode 100644 index 00000000..996c28ff --- /dev/null +++ b/module/canvas/_module.mjs @@ -0,0 +1,3 @@ +import * as DhPlaceables from './placeables/_module.mjs'; + +export { DhPlaceables }; diff --git a/module/canvas/placeables/_module.mjs b/module/canvas/placeables/_module.mjs new file mode 100644 index 00000000..a3c5ccde --- /dev/null +++ b/module/canvas/placeables/_module.mjs @@ -0,0 +1,5 @@ +import { default as DhMeasuredTemplate } from './measuredTemplate.mjs'; +import { default as DhRuler } from './ruler.mjs'; +import { default as DhTokenRuler } from './tokenRuler.mjs'; + +export { DhMeasuredTemplate, DhRuler, DhTokenRuler }; diff --git a/module/placeables/measuredTemplate.mjs b/module/canvas/placeables/measuredTemplate.mjs similarity index 88% rename from module/placeables/measuredTemplate.mjs rename to module/canvas/placeables/measuredTemplate.mjs index 385cf81e..6fffa1e5 100644 --- a/module/placeables/measuredTemplate.mjs +++ b/module/canvas/placeables/measuredTemplate.mjs @@ -2,7 +2,10 @@ export default class DhMeasuredTemplate extends foundry.canvas.placeables.Measur _refreshRulerText() { super._refreshRulerText(); - const rangeMeasurementSettings = game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.RangeMeasurement); + const rangeMeasurementSettings = game.settings.get( + CONFIG.DH.id, + CONFIG.DH.SETTINGS.gameSettings.RangeMeasurement + ); if (rangeMeasurementSettings.enabled) { const splitRulerText = this.ruler.text.split(' '); if (splitRulerText.length > 0) { diff --git a/module/ui/ruler.mjs b/module/canvas/placeables/ruler.mjs similarity index 85% rename from module/ui/ruler.mjs rename to module/canvas/placeables/ruler.mjs index 655c9c61..498ee3df 100644 --- a/module/ui/ruler.mjs +++ b/module/canvas/placeables/ruler.mjs @@ -5,7 +5,7 @@ export default class DhpRuler extends foundry.canvas.interaction.Ruler { const context = super._getWaypointLabelContext(waypoint, state); if (!context) return; - const range = game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.RangeMeasurement); + const range = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.RangeMeasurement); if (range.enabled) { const distance = DhMeasuredTemplate.getDistanceLabel(waypoint.measurement.distance.toNearest(0.01), range); diff --git a/module/ui/tokenRuler.mjs b/module/canvas/placeables/tokenRuler.mjs similarity index 85% rename from module/ui/tokenRuler.mjs rename to module/canvas/placeables/tokenRuler.mjs index 5c5a275e..ea30ca95 100644 --- a/module/ui/tokenRuler.mjs +++ b/module/canvas/placeables/tokenRuler.mjs @@ -5,7 +5,7 @@ export default class DhpTokenRuler extends foundry.canvas.placeables.tokens.Toke const context = super._getWaypointLabelContext(waypoint, state); if (!context) return; - const range = game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.RangeMeasurement); + const range = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.RangeMeasurement); if (range.enabled) { const distance = DhMeasuredTemplate.getDistanceLabel(waypoint.measurement.distance.toNearest(0.01), range); diff --git a/module/data/action/action.mjs b/module/data/action/action.mjs index a8ab2bb2..92cfa9b3 100644 --- a/module/data/action/action.mjs +++ b/module/data/action/action.mjs @@ -1,7 +1,7 @@ import { DHActionDiceData, DHActionRollData, DHDamageData, DHDamageField } from './actionDice.mjs'; import DhpActor from '../../documents/actor.mjs'; -import D20RollDialog from '../../dialogs/d20RollDialog.mjs'; -import BeastformDialog from '../../dialogs/beastformDialog.mjs'; +import D20RollDialog from '../../applications/dialogs/d20RollDialog.mjs'; +import BeastformDialog from '../../applications/dialogs/beastformDialog.mjs'; const fields = foundry.data.fields; @@ -33,11 +33,15 @@ export class DHBaseAction extends foundry.abstract.DataModel { description: new fields.HTMLField(), img: new fields.FilePathField({ initial: undefined, categories: ['IMAGE'], base64: false }), chatDisplay: new fields.BooleanField({ initial: true, label: 'Display in chat' }), - actionType: new fields.StringField({ choices: SYSTEM.ITEM.actionTypes, initial: 'action', nullable: true }), + actionType: new fields.StringField({ + choices: CONFIG.DH.ITEM.actionTypes, + initial: 'action', + nullable: true + }), cost: new fields.ArrayField( new fields.SchemaField({ type: new fields.StringField({ - choices: SYSTEM.GENERAL.abilityCosts, + choices: CONFIG.DH.GENERAL.abilityCosts, nullable: false, required: true, initial: 'hope' @@ -51,13 +55,13 @@ export class DHBaseAction extends foundry.abstract.DataModel { value: new fields.NumberField({ nullable: true, initial: null }), max: new fields.NumberField({ nullable: true, initial: null }), recovery: new fields.StringField({ - choices: SYSTEM.GENERAL.refreshTypes, + choices: CONFIG.DH.GENERAL.refreshTypes, initial: null, nullable: true }) }), range: new fields.StringField({ - choices: SYSTEM.GENERAL.range, + choices: CONFIG.DH.GENERAL.range, required: false, blank: true // initial: null @@ -71,17 +75,21 @@ export class DHBaseAction extends foundry.abstract.DataModel { damage: new DHDamageField(), roll: new fields.EmbeddedDataField(DHActionRollData), save: new fields.SchemaField({ - trait: new fields.StringField({ nullable: true, initial: null, choices: SYSTEM.ACTOR.abilities }), + trait: new fields.StringField({ + nullable: true, + initial: null, + choices: CONFIG.DH.ACTOR.abilities + }), difficulty: new fields.NumberField({ nullable: true, initial: 10, integer: true, min: 0 }), damageMod: new fields.StringField({ - initial: SYSTEM.ACTIONS.damageOnSave.none.id, - choices: SYSTEM.ACTIONS.damageOnSave + initial: CONFIG.DH.ACTIONS.damageOnSave.none.id, + choices: CONFIG.DH.ACTIONS.damageOnSave }) }), target: new fields.SchemaField({ type: new fields.StringField({ - choices: SYSTEM.ACTIONS.targetTypes, - initial: SYSTEM.ACTIONS.targetTypes.any.id, + choices: CONFIG.DH.ACTIONS.targetTypes, + initial: CONFIG.DH.ACTIONS.targetTypes.any.id, nullable: true, initial: null }), @@ -95,10 +103,10 @@ export class DHBaseAction extends foundry.abstract.DataModel { ), healing: new fields.SchemaField({ type: new fields.StringField({ - choices: SYSTEM.GENERAL.healingTypes, + choices: CONFIG.DH.GENERAL.healingTypes, required: true, blank: false, - initial: SYSTEM.GENERAL.healingTypes.hitPoints.id, + initial: CONFIG.DH.GENERAL.healingTypes.hitPoints.id, label: 'Healing' }), resultBased: new fields.BooleanField({ @@ -143,7 +151,7 @@ export class DHBaseAction extends foundry.abstract.DataModel { } get chatTemplate() { - return 'systems/daggerheart/templates/chat/duality-roll.hbs'; + return 'systems/daggerheart/templates/ui/chat/duality-roll.hbs'; } static getRollType(parent) { @@ -228,7 +236,7 @@ export class DHBaseAction extends foundry.abstract.DataModel { data: actorData }; - if (Hooks.call(`${SYSTEM.id}.preUseAction`, this, config) === false) return; + if (Hooks.call(`${CONFIG.DH.id}.preUseAction`, this, config) === false) return; // Display configuration window if necessary if (config.dialog?.configure && this.requireConfigurationDialog(config)) { @@ -284,7 +292,7 @@ export class DHBaseAction extends foundry.abstract.DataModel { // Consume resources await this.consume(config); - if (Hooks.call(`${SYSTEM.id}.postUseAction`, this, config) === false) return; + if (Hooks.call(`${CONFIG.DH.id}.postUseAction`, this, config) === false) return; return config; } @@ -324,11 +332,11 @@ export class DHBaseAction extends foundry.abstract.DataModel { prepareTarget() { let targets; - if (this.target?.type === SYSTEM.ACTIONS.targetTypes.self.id) + if (this.target?.type === CONFIG.DH.ACTIONS.targetTypes.self.id) targets = this.constructor.formatTarget(this.actor.token ?? this.actor.prototypeToken); targets = Array.from(game.user.targets); // foundry.CONST.TOKEN_DISPOSITIONS.FRIENDLY - if (this.target?.type && this.target.type !== SYSTEM.ACTIONS.targetTypes.any.id) { + if (this.target?.type && this.target.type !== CONFIG.DH.ACTIONS.targetTypes.any.id) { targets = targets.filter(t => this.isTargetFriendly(t)); if (this.target.amount && targets.length > this.target.amount) targets = []; } @@ -350,7 +358,7 @@ export class DHBaseAction extends foundry.abstract.DataModel { difficulty: this.roll?.difficulty, formula: this.roll.getFormula(), bonus: this.roll.bonus, - advantage: SYSTEM.ACTIONS.advandtageState[this.roll.advState].value + advantage: CONFIG.DH.ACTIONS.advandtageState[this.roll.advState].value }; if (this.roll?.type === 'diceSet') roll.lite = true; @@ -413,7 +421,7 @@ export class DHBaseAction extends foundry.abstract.DataModel { const fearCost = realCosts.splice(hasFearCost, 1); if ( !game.user.isGM || - fearCost[0].total > game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Resources.Fear) + fearCost[0].total > game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Resources.Fear) ) return false; } @@ -446,8 +454,10 @@ export class DHBaseAction extends foundry.abstract.DataModel { : this.actor.prototypeToken.disposition, targetDisposition = target.document.disposition; return ( - (this.target.type === SYSTEM.ACTIONS.targetTypes.friendly.id && actorDisposition === targetDisposition) || - (this.target.type === SYSTEM.ACTIONS.targetTypes.hostile.id && actorDisposition + targetDisposition === 0) + (this.target.type === CONFIG.DH.ACTIONS.targetTypes.friendly.id && + actorDisposition === targetDisposition) || + (this.target.type === CONFIG.DH.ACTIONS.targetTypes.hostile.id && + actorDisposition + targetDisposition === 0) ); } @@ -567,7 +577,7 @@ export class DHBaseAction extends foundry.abstract.DataModel { user: game.user.id, system: systemData, content: await foundry.applications.handlebars.renderTemplate( - 'systems/daggerheart/templates/chat/ability-use.hbs', + 'systems/daggerheart/templates/ui/chat/ability-use.hbs', systemData ) }); @@ -621,7 +631,7 @@ export class DHAttackAction extends DHDamageAction { } get chatTemplate() { - return 'systems/daggerheart/templates/chat/duality-roll.hbs'; + return 'systems/daggerheart/templates/ui/chat/duality-roll.hbs'; } prepareData() { @@ -669,7 +679,7 @@ export class DHHealingAction extends DHBaseAction { const config = { title: game.i18n.format('DAGGERHEART.Chat.HealingRoll.Title', { - healing: game.i18n.localize(SYSTEM.GENERAL.healingTypes[this.healing.type].label) + healing: game.i18n.localize(CONFIG.DH.GENERAL.healingTypes[this.healing.type].label) }), roll: { formula }, targets: (data.system?.targets ?? data.targets).filter(t => t.hit), @@ -682,7 +692,7 @@ export class DHHealingAction extends DHBaseAction { } get chatTemplate() { - return 'systems/daggerheart/templates/chat/healing-roll.hbs'; + return 'systems/daggerheart/templates/ui/chat/healing-roll.hbs'; } } @@ -730,7 +740,7 @@ export class DHEffectAction extends DHBaseAction { user: game.user.id, system: systemData, content: await foundry.applications.handlebars.renderTemplate( - 'systems/daggerheart/templates/chat/apply-effects.hbs', + 'systems/daggerheart/templates/ui/chat/apply-effects.hbs', systemData ) }); @@ -739,7 +749,7 @@ export class DHEffectAction extends DHBaseAction { } get chatTemplate() { - return 'systems/daggerheart/templates/chat/apply-effects.hbs'; + return 'systems/daggerheart/templates/ui/chat/apply-effects.hbs'; } } @@ -781,7 +791,7 @@ export class DhBeastformAction extends DHBaseAction { } prepareBeastformConfig(config) { - const settingsTiers = game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.LevelTiers).tiers; + const settingsTiers = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LevelTiers).tiers; const actorLevel = this.actor.system.levelData.level.current; const actorTier = Object.values(settingsTiers).find( diff --git a/module/data/action/actionDice.mjs b/module/data/action/actionDice.mjs index adf00461..38122c1d 100644 --- a/module/data/action/actionDice.mjs +++ b/module/data/action/actionDice.mjs @@ -8,21 +8,25 @@ export class DHActionRollData extends foundry.abstract.DataModel { /** @override */ static defineSchema() { return { - type: new fields.StringField({ nullable: true, initial: null, choices: SYSTEM.GENERAL.rollTypes }), - trait: new fields.StringField({ nullable: true, initial: null, choices: SYSTEM.ACTOR.abilities }), + type: new fields.StringField({ nullable: true, initial: null, choices: CONFIG.DH.GENERAL.rollTypes }), + trait: new fields.StringField({ nullable: true, initial: null, choices: CONFIG.DH.ACTOR.abilities }), difficulty: new fields.NumberField({ nullable: true, initial: null, integer: true, min: 0 }), bonus: new fields.NumberField({ nullable: true, initial: null, integer: true }), - advState: new fields.StringField({ choices: SYSTEM.ACTIONS.advandtageState, initial: 'neutral' }), + advState: new fields.StringField({ choices: CONFIG.DH.ACTIONS.advandtageState, initial: 'neutral' }), diceRolling: new fields.SchemaField({ multiplier: new fields.StringField({ - choices: SYSTEM.GENERAL.diceSetNumbers, + choices: CONFIG.DH.GENERAL.diceSetNumbers, initial: 'prof', label: 'Dice Number' }), flatMultiplier: new fields.NumberField({ nullable: true, initial: 1, label: 'Flat Multiplier' }), - dice: new fields.StringField({ choices: SYSTEM.GENERAL.diceTypes, initial: 'd6', label: 'Dice Type' }), + dice: new fields.StringField({ + choices: CONFIG.DH.GENERAL.diceTypes, + initial: 'd6', + label: 'Dice Type' + }), compare: new fields.StringField({ - choices: SYSTEM.ACTIONS.diceCompare, + choices: CONFIG.DH.ACTIONS.diceCompare, initial: 'above', label: 'Should be' }), @@ -40,7 +44,7 @@ export class DHActionRollData extends foundry.abstract.DataModel { this.diceRolling.multiplier === 'flat' ? this.diceRolling.flatMultiplier : `@${this.diceRolling.multiplier}`; - formula = `${multiplier}${this.diceRolling.dice}cs${SYSTEM.ACTIONS.diceCompare[this.diceRolling.compare].operator}${this.diceRolling.treshold}`; + formula = `${multiplier}${this.diceRolling.dice}cs${CONFIG.DH.ACTIONS.diceCompare[this.diceRolling.compare].operator}${this.diceRolling.treshold}`; break; default: // formula = `${(!!this.parent?.actor?.system?.attack ? `@attackBonus` : `@traits.${this.trait}.total`)}`; @@ -58,12 +62,12 @@ export class DHActionDiceData extends foundry.abstract.DataModel { static defineSchema() { return { multiplier: new fields.StringField({ - choices: SYSTEM.GENERAL.multiplierTypes, + choices: CONFIG.DH.GENERAL.multiplierTypes, initial: 'prof', label: 'Multiplier' }), flatMultiplier: new fields.NumberField({ nullable: true, initial: 1, label: 'Flat Multiplier' }), - dice: new fields.StringField({ choices: SYSTEM.GENERAL.diceTypes, initial: 'd6', label: 'Dice' }), + dice: new fields.StringField({ choices: CONFIG.DH.GENERAL.diceTypes, initial: 'd6', label: 'Dice' }), bonus: new fields.NumberField({ nullable: true, initial: null, label: 'Bonus' }), custom: new fields.SchemaField({ enabled: new fields.BooleanField({ label: 'Custom Formula' }), @@ -101,7 +105,7 @@ export class DHDamageData extends foundry.abstract.DataModel { // ...super.defineSchema(), base: new fields.BooleanField({ initial: false, readonly: true, label: 'Base' }), type: new fields.StringField({ - choices: SYSTEM.GENERAL.damageTypes, + choices: CONFIG.DH.GENERAL.damageTypes, initial: 'physical', label: 'Type', nullable: false, diff --git a/module/data/actor/adversary.mjs b/module/data/actor/adversary.mjs index 6e94d38e..ec2b96eb 100644 --- a/module/data/actor/adversary.mjs +++ b/module/data/actor/adversary.mjs @@ -22,13 +22,13 @@ export default class DhpAdversary extends BaseDataActor { return { tier: new fields.StringField({ required: true, - choices: SYSTEM.GENERAL.tiers, - initial: SYSTEM.GENERAL.tiers.tier1.id + choices: CONFIG.DH.GENERAL.tiers, + initial: CONFIG.DH.GENERAL.tiers.tier1.id }), type: new fields.StringField({ required: true, - choices: SYSTEM.ACTOR.adversaryTypes, - initial: SYSTEM.ACTOR.adversaryTypes.standard.id + choices: CONFIG.DH.ACTOR.adversaryTypes, + initial: CONFIG.DH.ACTOR.adversaryTypes.standard.id }), description: new fields.StringField(), motivesAndTactics: new fields.StringField(), @@ -47,6 +47,7 @@ export default class DhpAdversary extends BaseDataActor { attack: new ActionField({ initial: { name: 'Attack', + img: 'icons/skills/melee/blood-slash-foam-red.webp', _id: foundry.utils.randomID(), systemPath: 'attack', type: 'attack', diff --git a/module/data/actor/character.mjs b/module/data/actor/character.mjs index 7b1ec939..231a8795 100644 --- a/module/data/actor/character.mjs +++ b/module/data/actor/character.mjs @@ -1,4 +1,4 @@ -import { burden } from '../../config/generalConfig.mjs'; +import { burden } from '../../applications/config/generalConfig.mjs'; import ActionField from '../fields/actionField.mjs'; import ForeignDocumentUUIDField from '../fields/foreignDocumentUUIDField.mjs'; import DhLevelData from '../levelData.mjs'; @@ -144,7 +144,7 @@ export default class DhCharacter extends BaseDataActor { get tier() { return this.levelData.level.current === 1 ? 1 - : Object.values(game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.LevelTiers).tiers).find( + : Object.values(game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LevelTiers).tiers).find( tier => currentLevel >= tier.levels.start && currentLevel <= tier.levels.end ).tier; } @@ -225,7 +225,7 @@ export default class DhCharacter extends BaseDataActor { const primary = this.primaryWeapon, secondary = this.secondaryWeapon; if (itemToEquip.system.secondary) { - if (primary && primary.burden === SYSTEM.GENERAL.burden.twoHanded.value) { + if (primary && primary.burden === CONFIG.DH.GENERAL.burden.twoHanded.value) { await primary.update({ 'system.equipped': false }); } @@ -233,7 +233,7 @@ export default class DhCharacter extends BaseDataActor { await secondary.update({ 'system.equipped': false }); } } else { - if (secondary && itemToEquip.system.burden === SYSTEM.GENERAL.burden.twoHanded.value) { + if (secondary && itemToEquip.system.burden === CONFIG.DH.GENERAL.burden.twoHanded.value) { await secondary.update({ 'system.equipped': false }); } @@ -248,7 +248,7 @@ export default class DhCharacter extends BaseDataActor { const currentTier = currentLevel === 1 ? null - : Object.values(game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.LevelTiers).tiers).find( + : Object.values(game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LevelTiers).tiers).find( tier => currentLevel >= tier.levels.start && currentLevel <= tier.levels.end ).tier; for (let levelKey in this.levelData.levelups) { diff --git a/module/data/actor/environment.mjs b/module/data/actor/environment.mjs index 4b7e0716..f7bfbc78 100644 --- a/module/data/actor/environment.mjs +++ b/module/data/actor/environment.mjs @@ -1,6 +1,5 @@ -import { environmentTypes } from '../../config/actorConfig.mjs'; +import { environmentTypes } from '../../applications/config/actorConfig.mjs'; import BaseDataActor from './base.mjs'; -import ForeignDocumentUUIDField from '../fields/foreignDocumentUUIDField.mjs'; import ActionField from '../fields/actionField.mjs'; import ForeignDocumentUUIDArrayField from '../fields/foreignDocumentUUIDArrayField.mjs'; @@ -19,8 +18,8 @@ export default class DhEnvironment extends BaseDataActor { return { tier: new fields.StringField({ required: true, - choices: SYSTEM.GENERAL.tiers, - initial: SYSTEM.GENERAL.tiers.tier1.id + choices: CONFIG.DH.GENERAL.tiers, + initial: CONFIG.DH.GENERAL.tiers.tier1.id }), type: new fields.StringField({ choices: environmentTypes }), description: new fields.StringField(), diff --git a/module/data/chat-message/adversaryRoll.mjs b/module/data/chat-message/adversaryRoll.mjs index 8a54af48..ea0f4678 100644 --- a/module/data/chat-message/adversaryRoll.mjs +++ b/module/data/chat-message/adversaryRoll.mjs @@ -37,7 +37,7 @@ export default class DHAdversaryRoll extends foundry.abstract.TypeDataModel { } get messageTemplate() { - return 'systems/daggerheart/templates/chat/adversary-roll.hbs'; + return 'systems/daggerheart/templates/ui/chat/adversary-roll.hbs'; } prepareDerivedData() { diff --git a/module/data/chat-message/damageRoll.mjs b/module/data/chat-message/damageRoll.mjs index 5e692d97..6d54b3f7 100644 --- a/module/data/chat-message/damageRoll.mjs +++ b/module/data/chat-message/damageRoll.mjs @@ -33,7 +33,7 @@ export default class DHDamageRoll extends foundry.abstract.TypeDataModel { } get messageTemplate() { - return `systems/daggerheart/templates/chat/${this.messageType}-roll.hbs`; + return `systems/daggerheart/templates/ui/chat/${this.messageType}-roll.hbs`; } prepareDerivedData() { diff --git a/module/data/chat-message/dualityRoll.mjs b/module/data/chat-message/dualityRoll.mjs index a6ffd85b..63fa9fa3 100644 --- a/module/data/chat-message/dualityRoll.mjs +++ b/module/data/chat-message/dualityRoll.mjs @@ -2,6 +2,6 @@ import DHAdversaryRoll from './adversaryRoll.mjs'; export default class DHDualityRoll extends DHAdversaryRoll { get messageTemplate() { - return 'systems/daggerheart/templates/chat/duality-roll.hbs'; + return 'systems/daggerheart/templates/ui/chat/duality-roll.hbs'; } } diff --git a/module/data/chat-message/hitRoll.mjs b/module/data/chat-message/hitRoll.mjs deleted file mode 100644 index e69de29b..00000000 diff --git a/module/data/countdowns.mjs b/module/data/countdowns.mjs index a61a1aab..620904e0 100644 --- a/module/data/countdowns.mjs +++ b/module/data/countdowns.mjs @@ -1,5 +1,5 @@ -import { countdownTypes } from '../config/generalConfig.mjs'; -import { RefreshType, socketEvent } from '../helpers/socket.mjs'; +import { countdownTypes } from '../applications/config/generalConfig.mjs'; +import { RefreshType, socketEvent } from '../systemRegistration/socket.mjs'; export default class DhCountdowns extends foundry.abstract.DataModel { static defineSchema() { diff --git a/module/data/item/armor.mjs b/module/data/item/armor.mjs index 9c19fb80..b6c814de 100644 --- a/module/data/item/armor.mjs +++ b/module/data/item/armor.mjs @@ -1,6 +1,6 @@ import BaseDataItem from './base.mjs'; import ActionField from '../fields/actionField.mjs'; -import { armorFeatures } from '../../config/itemConfig.mjs'; +import { armorFeatures } from '../../applications/config/itemConfig.mjs'; export default class DHArmor extends BaseDataItem { /** @inheritDoc */ @@ -24,7 +24,11 @@ export default class DHArmor extends BaseDataItem { baseScore: new fields.NumberField({ integer: true, initial: 0 }), features: new fields.ArrayField( new fields.SchemaField({ - value: new fields.StringField({ required: true, choices: SYSTEM.ITEM.armorFeatures, blank: true }), + value: new fields.StringField({ + required: true, + choices: CONFIG.DH.ITEM.armorFeatures, + blank: true + }), effectIds: new fields.ArrayField(new fields.StringField({ required: true })), actionIds: new fields.ArrayField(new fields.StringField({ required: true })) }) @@ -41,7 +45,7 @@ export default class DHArmor extends BaseDataItem { } get featureInfo() { - return this.feature ? CONFIG.daggerheart.ITEM.armorFeatures[this.feature] : null; + return this.feature ? CONFIG.DH.ITEM.armorFeatures[this.feature] : null; } async _preUpdate(changes, options, user) { diff --git a/module/data/item/base.mjs b/module/data/item/base.mjs index 4d41d731..c90202fb 100644 --- a/module/data/item/base.mjs +++ b/module/data/item/base.mjs @@ -66,7 +66,7 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel { { _id: foundry.utils.randomID(), type: actionType, - name: game.i18n.localize(SYSTEM.ACTIONS.actionTypes[actionType].name), + name: game.i18n.localize(CONFIG.DH.ACTIONS.actionTypes[actionType].name), ...cls.getSourceConfig(this.parent) }, { diff --git a/module/data/item/beastform.mjs b/module/data/item/beastform.mjs index e90af930..b069f910 100644 --- a/module/data/item/beastform.mjs +++ b/module/data/item/beastform.mjs @@ -21,8 +21,8 @@ export default class DHBeastform extends BaseDataItem { ...super.defineSchema(), tier: new fields.StringField({ required: true, - choices: SYSTEM.GENERAL.tiers, - initial: SYSTEM.GENERAL.tiers.tier1.id + choices: CONFIG.DH.GENERAL.tiers, + initial: CONFIG.DH.GENERAL.tiers.tier1.id }), tokenImg: new fields.FilePathField({ initial: 'icons/svg/mystery-man.svg', diff --git a/module/data/item/domainCard.mjs b/module/data/item/domainCard.mjs index f9ecca8a..3f64d74f 100644 --- a/module/data/item/domainCard.mjs +++ b/module/data/item/domainCard.mjs @@ -17,16 +17,16 @@ export default class DHDomainCard extends BaseDataItem { return { ...super.defineSchema(), domain: new fields.StringField({ - choices: SYSTEM.DOMAIN.domains, + choices: CONFIG.DH.DOMAIN.domains, required: true, - initial: SYSTEM.DOMAIN.domains.arcana.id + initial: CONFIG.DH.DOMAIN.domains.arcana.id }), level: new fields.NumberField({ initial: 1, integer: true }), recallCost: new fields.NumberField({ initial: 0, integer: true }), type: new fields.StringField({ - choices: SYSTEM.DOMAIN.cardTypes, + choices: CONFIG.DH.DOMAIN.cardTypes, required: true, - initial: SYSTEM.DOMAIN.cardTypes.ability.id + initial: CONFIG.DH.DOMAIN.cardTypes.ability.id }), foundation: new fields.BooleanField({ initial: false }), inVault: new fields.BooleanField({ initial: false }), diff --git a/module/data/item/subclass.mjs b/module/data/item/subclass.mjs index 3c996584..8590468e 100644 --- a/module/data/item/subclass.mjs +++ b/module/data/item/subclass.mjs @@ -26,7 +26,7 @@ export default class DHSubclass extends BaseDataItem { return { ...super.defineSchema(), spellcastingTrait: new fields.StringField({ - choices: SYSTEM.ACTOR.abilities, + choices: CONFIG.DH.ACTOR.abilities, integer: false, nullable: true, initial: null diff --git a/module/data/item/weapon.mjs b/module/data/item/weapon.mjs index ee59a7f7..adf89155 100644 --- a/module/data/item/weapon.mjs +++ b/module/data/item/weapon.mjs @@ -1,7 +1,6 @@ import BaseDataItem from './base.mjs'; -import FormulaField from '../fields/formulaField.mjs'; import ActionField from '../fields/actionField.mjs'; -import { weaponFeatures } from '../../config/itemConfig.mjs'; +import { weaponFeatures } from '../../applications/config/itemConfig.mjs'; import { actionsTypes } from '../action/_module.mjs'; export default class DHWeapon extends BaseDataItem { @@ -27,22 +26,26 @@ export default class DHWeapon extends BaseDataItem { //SETTINGS secondary: new fields.BooleanField({ initial: false }), - trait: new fields.StringField({ required: true, choices: SYSTEM.ACTOR.abilities, initial: 'agility' }), - range: new fields.StringField({ required: true, choices: SYSTEM.GENERAL.range, initial: 'melee' }), - burden: new fields.StringField({ required: true, choices: SYSTEM.GENERAL.burden, initial: 'oneHanded' }), + trait: new fields.StringField({ required: true, choices: CONFIG.DH.ACTOR.abilities, initial: 'agility' }), + range: new fields.StringField({ required: true, choices: CONFIG.DH.GENERAL.range, initial: 'melee' }), + burden: new fields.StringField({ required: true, choices: CONFIG.DH.GENERAL.burden, initial: 'oneHanded' }), //DAMAGE damage: new fields.SchemaField({ - dice: new fields.StringField({ choices: SYSTEM.GENERAL.diceTypes, initial: 'd6' }), + dice: new fields.StringField({ choices: CONFIG.DH.GENERAL.diceTypes, initial: 'd6' }), bonus: new fields.NumberField({ nullable: true, initial: null }), type: new fields.StringField({ required: true, - choices: SYSTEM.GENERAL.damageTypes, + choices: CONFIG.DH.GENERAL.damageTypes, initial: 'physical' }) }), features: new fields.ArrayField( new fields.SchemaField({ - value: new fields.StringField({ required: true, choices: SYSTEM.ITEM.weaponFeatures, blank: true }), + value: new fields.StringField({ + required: true, + choices: CONFIG.DH.ITEM.weaponFeatures, + blank: true + }), effectIds: new fields.ArrayField(new fields.StringField({ required: true })), actionIds: new fields.ArrayField(new fields.StringField({ required: true })) }) diff --git a/module/data/levelup.mjs b/module/data/levelup.mjs index 0f248f45..a5b5455f 100644 --- a/module/data/levelup.mjs +++ b/module/data/levelup.mjs @@ -1,4 +1,4 @@ -import { abilities } from '../config/actorConfig.mjs'; +import { abilities } from '../applications/config/actorConfig.mjs'; import { chunkify } from '../helpers/utils.mjs'; import { LevelOptionType } from './levelTier.mjs'; diff --git a/module/data/settings/Appearance.mjs b/module/data/settings/Appearance.mjs index 6382b613..eede8b91 100644 --- a/module/data/settings/Appearance.mjs +++ b/module/data/settings/Appearance.mjs @@ -1,4 +1,4 @@ -import { fearDisplay } from '../../config/generalConfig.mjs'; +import { fearDisplay } from '../../applications/config/generalConfig.mjs'; export default class DhAppearance extends foundry.abstract.DataModel { static defineSchema() { diff --git a/module/data/settings/Homebrew.mjs b/module/data/settings/Homebrew.mjs index d26de253..b7320070 100644 --- a/module/data/settings/Homebrew.mjs +++ b/module/data/settings/Homebrew.mjs @@ -1,4 +1,4 @@ -import { defaultRestOptions } from '../../config/generalConfig.mjs'; +import { defaultRestOptions } from '../../applications/config/generalConfig.mjs'; export default class DhHomebrew extends foundry.abstract.DataModel { static LOCALIZATION_PREFIXES = ['DAGGERHEART.Settings.Homebrew']; // Doesn't work for some reason diff --git a/module/documents/_module.mjs b/module/documents/_module.mjs index e6099009..990616c5 100644 --- a/module/documents/_module.mjs +++ b/module/documents/_module.mjs @@ -2,3 +2,6 @@ export { default as DhpActor } from './actor.mjs'; export { default as DHItem } from './item.mjs'; export { default as DhpCombat } from './combat.mjs'; export { default as DhActiveEffect } from './activeEffect.mjs'; +export { default as DhChatMessage } from './chatMessage.mjs'; +export * as DhRoll from './roll.mjs'; +export { default as DhTooltipManager } from './tooltipManager.mjs'; diff --git a/module/documents/activeEffect.mjs b/module/documents/activeEffect.mjs index 2a2aa33e..c27baccb 100644 --- a/module/documents/activeEffect.mjs +++ b/module/documents/activeEffect.mjs @@ -44,7 +44,7 @@ export default class DhActiveEffect extends ActiveEffect { user: game.user.id, system: systemData, content: await foundry.applications.handlebars.renderTemplate( - 'systems/daggerheart/templates/chat/ability-use.hbs', + 'systems/daggerheart/templates/ui/chat/ability-use.hbs', systemData ) }); diff --git a/module/documents/actor.mjs b/module/documents/actor.mjs index 2bb4084f..a12d4e6a 100644 --- a/module/documents/actor.mjs +++ b/module/documents/actor.mjs @@ -1,6 +1,6 @@ -import DamageSelectionDialog from '../applications/damageSelectionDialog.mjs'; -import { GMUpdateEvent, socketEvent } from '../helpers/socket.mjs'; -import DamageReductionDialog from '../applications/damageReductionDialog.mjs'; +import DamageSelectionDialog from '../applications/dialogs/damageSelectionDialog.mjs'; +import { GMUpdateEvent, socketEvent } from '../systemRegistration/socket.mjs'; +import DamageReductionDialog from '../applications/dialogs/damageReductionDialog.mjs'; import { LevelOptionType } from '../data/levelTier.mjs'; import DHFeature from '../data/item/feature.mjs'; @@ -24,7 +24,7 @@ export default class DhpActor extends Actor { if (newLevel > this.system.levelData.level.current) { const maxLevel = Object.values( - game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.LevelTiers).tiers + game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LevelTiers).tiers ).reduce((acc, tier) => Math.max(acc, tier.levels.end), 0); if (newLevel > maxLevel) { ui.notifications.warn(game.i18n.localize('DAGGERHEART.Sheets.PC.Errors.tooHighLevel')); @@ -375,7 +375,7 @@ export default class DhpActor extends Actor { bonusDamage = result.bonusDamage; rollString = result.rollString; - const automateHope = await game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Automation.Hope); + const automateHope = await game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation.Hope); if (automateHope && result.hopeUsed) { await this.update({ 'system.resources.hope.value': this.system.resources.hope.value - result.hopeUsed @@ -421,7 +421,7 @@ export default class DhpActor extends Actor { sound: CONFIG.sounds.dice, system: systemData, content: await foundry.applications.handlebars.renderTemplate( - 'systems/daggerheart/templates/chat/damage-roll.hbs', + 'systems/daggerheart/templates/ui/chat/damage-roll.hbs', systemData ), rolls: [roll] @@ -488,7 +488,7 @@ export default class DhpActor extends Actor { switch (r.type) { case 'fear': ui.resources.updateFear( - game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Resources.Fear) + r.value + game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Resources.Fear) + r.value ); break; case 'armorStack': @@ -513,7 +513,7 @@ export default class DhpActor extends Actor { if (game.user.isGM) { await u.target.update(u.resources); } else { - await game.socket.emit(`system.${SYSTEM.id}`, { + await game.socket.emit(`system.${CONFIG.DH.id}`, { action: socketEvent.GMUpdate, data: { action: GMUpdateEvent.UpdateDocument, diff --git a/module/applications/chatMessage.mjs b/module/documents/chatMessage.mjs similarity index 100% rename from module/applications/chatMessage.mjs rename to module/documents/chatMessage.mjs diff --git a/module/documents/item.mjs b/module/documents/item.mjs index 79e065fd..a2a8955f 100644 --- a/module/documents/item.mjs +++ b/module/documents/item.mjs @@ -79,7 +79,7 @@ export default class DHItem extends foundry.documents.Item { async selectActionDialog() { const content = await foundry.applications.handlebars.renderTemplate( - 'systems/daggerheart/templates/views/actionSelect.hbs', + 'systems/daggerheart/templates/dialogs/actionSelect.hbs', { actions: this.system.actions } ), title = 'Select Action'; @@ -131,7 +131,7 @@ export default class DHItem extends foundry.documents.Item { user: game.user.id, system: systemData, content: await foundry.applications.handlebars.renderTemplate( - 'systems/daggerheart/templates/chat/ability-use.hbs', + 'systems/daggerheart/templates/ui/chat/ability-use.hbs', systemData ) }); diff --git a/module/applications/roll.mjs b/module/documents/roll.mjs similarity index 96% rename from module/applications/roll.mjs rename to module/documents/roll.mjs index fa374262..460a4af7 100644 --- a/module/applications/roll.mjs +++ b/module/documents/roll.mjs @@ -1,5 +1,5 @@ -import D20RollDialog from '../dialogs/d20RollDialog.mjs'; -import DamageDialog from '../dialogs/damageDialog.mjs'; +import D20RollDialog from '../applications/dialogs/d20RollDialog.mjs'; +import DamageDialog from '../applications/dialogs/damageDialog.mjs'; import { setDiceSoNiceForDualityRoll } from '../helpers/utils.mjs'; /* @@ -29,7 +29,7 @@ export class DHRoll extends Roll { config.hooks = [...(config.hooks ?? []), '']; config.dialog ??= {}; for (const hook of config.hooks) { - if (Hooks.call(`${SYSTEM.id}.preRoll${hook.capitalize()}`, config, message) === false) return null; + if (Hooks.call(`${CONFIG.DH.id}.preRoll${hook.capitalize()}`, config, message) === false) return null; } this.applyKeybindings(config); @@ -43,7 +43,9 @@ export class DHRoll extends Roll { } for (const hook of config.hooks) { - if (Hooks.call(`${SYSTEM.id}.post${hook.capitalize()}RollConfiguration`, roll, config, message) === false) + if ( + Hooks.call(`${CONFIG.DH.id}.post${hook.capitalize()}RollConfiguration`, roll, config, message) === false + ) return []; } return roll; @@ -56,7 +58,7 @@ export class DHRoll extends Roll { static async buildPost(roll, config, message) { for (const hook of config.hooks) { - if (Hooks.call(`${SYSTEM.id}.postRoll${hook.capitalize()}`, config, message) === false) return null; + if (Hooks.call(`${CONFIG.DH.id}.postRoll${hook.capitalize()}`, config, message) === false) return null; } // Create Chat Message @@ -478,11 +480,11 @@ export class DamageRoll extends DHRoll { chatMessage.update({ 'system.damage': config }); } } - + constructFormula(config) { super.constructFormula(config); - if(config.isCritical) { - const tmpRoll = new Roll(this._formula)._evaluateSync({maximize: true}), + if (config.isCritical) { + const tmpRoll = new Roll(this._formula)._evaluateSync({ maximize: true }), criticalBonus = tmpRoll.total - this.constructor.calculateTotalModifiers(tmpRoll); this.terms.push(...this.formatModifier(criticalBonus)); } diff --git a/module/applications/tooltipManager.mjs b/module/documents/tooltipManager.mjs similarity index 71% rename from module/applications/tooltipManager.mjs rename to module/documents/tooltipManager.mjs index d7d3117c..53668813 100644 --- a/module/applications/tooltipManager.mjs +++ b/module/documents/tooltipManager.mjs @@ -1,11 +1,11 @@ -export default class DhTooltipManager extends TooltipManager { +export default class DhTooltipManager extends foundry.helpers.interaction.TooltipManager.implementation { async activate(element, options = {}) { let html = options.html; if (element.dataset.tooltip.startsWith('#item#')) { const item = await foundry.utils.fromUuid(element.dataset.tooltip.slice(6)); if (item) { html = await foundry.applications.handlebars.renderTemplate( - `systems/daggerheart/templates/tooltip/${item.type}.hbs`, + `systems/daggerheart/templates/ui/tooltip/${item.type}.hbs`, item ); } diff --git a/module/enrichers/DualityRollEnricher.mjs b/module/enrichers/DualityRollEnricher.mjs index 61884acc..a1a1bb4c 100644 --- a/module/enrichers/DualityRollEnricher.mjs +++ b/module/enrichers/DualityRollEnricher.mjs @@ -1,4 +1,4 @@ -import { abilities } from '../config/actorConfig.mjs'; +import { abilities } from '../applications/config/actorConfig.mjs'; import { getCommandTarget, rollCommandToJSON } from '../helpers/utils.mjs'; export default function DhDualityRollEnricher(match, _options) { @@ -55,7 +55,7 @@ export const renderDualityButton = async event => { type: button.dataset.actionType ?? null // Need check }, chatMessage: { - template: 'systems/daggerheart/templates/chat/duality-roll.hbs' + template: 'systems/daggerheart/templates/ui/chat/duality-roll.hbs' } }; await target.diceRoll(config); diff --git a/module/enrichers/TemplateEnricher.mjs b/module/enrichers/TemplateEnricher.mjs index 50b27068..790e295d 100644 --- a/module/enrichers/TemplateEnricher.mjs +++ b/module/enrichers/TemplateEnricher.mjs @@ -1,4 +1,4 @@ -import { range as configRange } from '../config/generalConfig.mjs'; +import { range as configRange } from '../applications/config/generalConfig.mjs'; export default function DhTemplateEnricher(match, _options) { const parts = match[1].split('|').map(x => x.trim()); @@ -45,7 +45,7 @@ export const renderMeasuredTemplate = async event => { if (!type || !range || !game.canvas.scene) return; - const distance = game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.RangeMeasurement)[range]; + const distance = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.RangeMeasurement)[range]; const { width, height } = game.canvas.scene.dimensions; canvas.scene.createEmbeddedDocuments('MeasuredTemplate', [ { diff --git a/module/helpers/utils.mjs b/module/helpers/utils.mjs index 3dd4abc2..9c19f229 100644 --- a/module/helpers/utils.mjs +++ b/module/helpers/utils.mjs @@ -1,4 +1,4 @@ -import { diceTypes, getDiceSoNicePresets, range } from '../config/generalConfig.mjs'; +import { diceTypes, getDiceSoNicePresets, range } from '../applications/config/generalConfig.mjs'; import Tagify from '@yaireo/tagify'; export const loadCompendiumOptions = async compendiums => { @@ -226,7 +226,7 @@ export const getDeleteKeys = (property, innerProperty, innerPropertyDefaultValue // Fix on Foundry native formula replacement for DH const nativeReplaceFormulaData = Roll.replaceFormulaData; Roll.replaceFormulaData = function (formula, data = {}, { missing, warn = false } = {}) { - const terms = Object.keys(SYSTEM.GENERAL.multiplierTypes).map(type => { + const terms = Object.keys(CONFIG.DH.GENERAL.multiplierTypes).map(type => { return { term: type, default: 1 }; }); formula = terms.reduce((a, c) => a.replaceAll(`@${c.term}`, data[c.term] ?? c.default), formula); diff --git a/module/placeables/_module.mjs b/module/placeables/_module.mjs deleted file mode 100644 index 52e3dffe..00000000 --- a/module/placeables/_module.mjs +++ /dev/null @@ -1,3 +0,0 @@ -import DhMeasuredTemplate from './measuredTemplate.mjs'; - -export { DhMeasuredTemplate }; diff --git a/module/systemRegistration/_module.mjs b/module/systemRegistration/_module.mjs new file mode 100644 index 00000000..555bd03f --- /dev/null +++ b/module/systemRegistration/_module.mjs @@ -0,0 +1,5 @@ +import { preloadHandlebarsTemplates as handlebarsRegistration } from './handlebars.mjs'; +import * as settingsRegistration from './settings.mjs'; +import * as socketRegistration from './socket.mjs'; + +export { handlebarsRegistration, settingsRegistration, socketRegistration }; diff --git a/module/systemRegistration/handlebars.mjs b/module/systemRegistration/handlebars.mjs new file mode 100644 index 00000000..4c2f7f1d --- /dev/null +++ b/module/systemRegistration/handlebars.mjs @@ -0,0 +1,29 @@ +export const preloadHandlebarsTemplates = async function () { + return foundry.applications.handlebars.loadTemplates([ + 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs', + 'systems/daggerheart/templates/sheets/global/partials/inventory-item.hbs', + 'systems/daggerheart/templates/sheets/global/partials/action-item.hbs', + 'systems/daggerheart/templates/sheets/global/partials/domain-card-item.hbs', + 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs', + 'systems/daggerheart/templates/sheets/items/subclass/parts/subclass-features.hbs', + 'systems/daggerheart/templates/sheets/items/subclass/parts/subclass-feature.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/healing.hbs', + 'systems/daggerheart/templates/actionTypes/resource.hbs', + 'systems/daggerheart/templates/actionTypes/uuid.hbs', + 'systems/daggerheart/templates/actionTypes/uses.hbs', + 'systems/daggerheart/templates/actionTypes/roll.hbs', + 'systems/daggerheart/templates/actionTypes/save.hbs', + 'systems/daggerheart/templates/actionTypes/cost.hbs', + 'systems/daggerheart/templates/actionTypes/range-target.hbs', + 'systems/daggerheart/templates/actionTypes/effect.hbs', + 'systems/daggerheart/templates/actionTypes/beastform.hbs', + 'systems/daggerheart/templates/settings/components/settings-item-line.hbs', + 'systems/daggerheart/templates/ui/chat/parts/damage-chat.hbs', + 'systems/daggerheart/templates/ui/chat/parts/target-chat.hbs' + ]); +}; diff --git a/module/applications/settings.mjs b/module/systemRegistration/settings.mjs similarity index 72% rename from module/applications/settings.mjs rename to module/systemRegistration/settings.mjs index 8cfc5161..6da1cce0 100644 --- a/module/applications/settings.mjs +++ b/module/systemRegistration/settings.mjs @@ -13,7 +13,7 @@ import { DhHomebrewSettings, DhRangeMeasurementSettings, DhVariantRuleSettings -} from './settings/_module.mjs'; +} from '../applications/settings/_module.mjs'; export const registerDHSettings = () => { registerMenuSettings(); @@ -22,19 +22,19 @@ export const registerDHSettings = () => { }; const registerMenuSettings = () => { - game.settings.register(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.variantRules, { + game.settings.register(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.variantRules, { scope: 'world', config: false, type: DhVariantRules }); - game.settings.register(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Automation, { + game.settings.register(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation, { scope: 'world', config: false, type: DhAutomation }); - game.settings.register(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Homebrew, { + game.settings.register(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew, { scope: 'world', config: false, type: DhHomebrew, @@ -45,7 +45,7 @@ const registerMenuSettings = () => { } }); - game.settings.register(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance, { + game.settings.register(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance, { scope: 'client', config: false, type: DhAppearance, @@ -59,7 +59,7 @@ const registerMenuSettings = () => { } }); - game.settings.register(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.RangeMeasurement, { + game.settings.register(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.RangeMeasurement, { scope: 'client', config: false, type: DhRangeMeasurement @@ -67,32 +67,32 @@ const registerMenuSettings = () => { }; const registerMenus = () => { - game.settings.registerMenu(SYSTEM.id, SYSTEM.SETTINGS.menu.Automation.Name, { + game.settings.registerMenu(CONFIG.DH.id, CONFIG.DH.SETTINGS.menu.Automation.Name, { name: game.i18n.localize('DAGGERHEART.Settings.Menu.Automation.Name'), label: game.i18n.localize('DAGGERHEART.Settings.Menu.Automation.Label'), hint: game.i18n.localize('DAGGERHEART.Settings.Menu.Automation.Hint'), - icon: SYSTEM.SETTINGS.menu.Automation.Icon, + icon: CONFIG.DH.SETTINGS.menu.Automation.Icon, type: DhAutomationSettings, restricted: true }); - game.settings.registerMenu(SYSTEM.id, SYSTEM.SETTINGS.menu.Homebrew.Name, { + 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'), hint: game.i18n.localize('DAGGERHEART.Settings.Menu.Homebrew.Hint'), - icon: SYSTEM.SETTINGS.menu.Homebrew.Icon, + icon: CONFIG.DH.SETTINGS.menu.Homebrew.Icon, type: DhHomebrewSettings, restricted: true }); - game.settings.registerMenu(SYSTEM.id, SYSTEM.SETTINGS.menu.Range.Name, { + game.settings.registerMenu(CONFIG.DH.id, CONFIG.DH.SETTINGS.menu.Range.Name, { name: game.i18n.localize('DAGGERHEART.Settings.Menu.Range.Name'), label: game.i18n.localize('DAGGERHEART.Settings.Menu.Range.Label'), hint: game.i18n.localize('DAGGERHEART.Settings.Menu.Range.Hint'), - icon: SYSTEM.SETTINGS.menu.Range.Icon, + icon: CONFIG.DH.SETTINGS.menu.Range.Icon, type: DhRangeMeasurementSettings, restricted: true }); - game.settings.registerMenu(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance, { + game.settings.registerMenu(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance, { name: game.i18n.localize('DAGGERHEART.Settings.Menu.Appearance.title'), label: game.i18n.localize('DAGGERHEART.Settings.Menu.Appearance.label'), hint: game.i18n.localize('DAGGERHEART.Settings.Menu.Appearance.hint'), @@ -101,25 +101,25 @@ const registerMenus = () => { restricted: false }); - game.settings.registerMenu(SYSTEM.id, SYSTEM.SETTINGS.menu.VariantRules.Name, { + game.settings.registerMenu(CONFIG.DH.id, CONFIG.DH.SETTINGS.menu.VariantRules.Name, { name: game.i18n.localize('DAGGERHEART.Settings.Menu.VariantRules.title'), label: game.i18n.localize('DAGGERHEART.Settings.Menu.VariantRules.label'), hint: game.i18n.localize('DAGGERHEART.Settings.Menu.VariantRules.hint'), - icon: SYSTEM.SETTINGS.menu.VariantRules.Icon, + icon: CONFIG.DH.SETTINGS.menu.VariantRules.Icon, type: DhVariantRuleSettings, restricted: false }); }; const registerNonConfigSettings = () => { - game.settings.register(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.LevelTiers, { + game.settings.register(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LevelTiers, { scope: 'world', config: false, type: DhLevelTiers, default: defaultLevelTiers }); - game.settings.register(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Resources.Fear, { + game.settings.register(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Resources.Fear, { name: game.i18n.localize('DAGGERHEART.Settings.Resources.Fear.Name'), hint: game.i18n.localize('DAGGERHEART.Settings.Resources.Fear.Hint'), scope: 'world', @@ -132,7 +132,7 @@ const registerNonConfigSettings = () => { } }); - game.settings.register(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Countdowns, { + game.settings.register(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Countdowns, { scope: 'world', config: false, type: DhCountdowns diff --git a/module/helpers/socket.mjs b/module/systemRegistration/socket.mjs similarity index 83% rename from module/helpers/socket.mjs rename to module/systemRegistration/socket.mjs index 6cd041aa..0be0a633 100644 --- a/module/helpers/socket.mjs +++ b/module/systemRegistration/socket.mjs @@ -40,24 +40,24 @@ export const registerSocketHooks = () => { break; case GMUpdateEvent.UpdateSetting: if (game.user.isGM) { - await game.settings.set(SYSTEM.id, data.uuid, data.update); + await game.settings.set(CONFIG.DH.id, data.uuid, data.update); } break; case GMUpdateEvent.UpdateFear: if (game.user.isGM) { await game.settings.set( - SYSTEM.id, - SYSTEM.SETTINGS.gameSettings.Resources.Fear, + CONFIG.DH.id, + CONFIG.DH.SETTINGS.gameSettings.Resources.Fear, Math.max(Math.min(data.update, 6), 0) ); Hooks.callAll(socketEvent.DhpFearUpdate); - await game.socket.emit(`system.${SYSTEM.id}`, { action: socketEvent.DhpFearUpdate }); + await game.socket.emit(`system.${CONFIG.DH.id}`, { action: socketEvent.DhpFearUpdate }); } break; } if (data.refresh) { - await game.socket.emit(`system.${SYSTEM.id}`, { + await game.socket.emit(`system.${CONFIG.DH.id}`, { action: socketEvent.Refresh, data: data.refresh }); diff --git a/templates/views/actionType.hbs b/templates/actionTypes/actionType.hbs similarity index 100% rename from templates/views/actionType.hbs rename to templates/actionTypes/actionType.hbs diff --git a/templates/views/actionTypes/beastform.hbs b/templates/actionTypes/beastform.hbs similarity index 100% rename from templates/views/actionTypes/beastform.hbs rename to templates/actionTypes/beastform.hbs diff --git a/templates/views/actionTypes/cost.hbs b/templates/actionTypes/cost.hbs similarity index 100% rename from templates/views/actionTypes/cost.hbs rename to templates/actionTypes/cost.hbs diff --git a/templates/views/actionTypes/damage.hbs b/templates/actionTypes/damage.hbs similarity index 100% rename from templates/views/actionTypes/damage.hbs rename to templates/actionTypes/damage.hbs diff --git a/templates/views/actionTypes/effect.hbs b/templates/actionTypes/effect.hbs similarity index 100% rename from templates/views/actionTypes/effect.hbs rename to templates/actionTypes/effect.hbs diff --git a/templates/views/actionTypes/healing.hbs b/templates/actionTypes/healing.hbs similarity index 100% rename from templates/views/actionTypes/healing.hbs rename to templates/actionTypes/healing.hbs diff --git a/templates/views/actionTypes/range-target.hbs b/templates/actionTypes/range-target.hbs similarity index 100% rename from templates/views/actionTypes/range-target.hbs rename to templates/actionTypes/range-target.hbs diff --git a/templates/views/actionTypes/resource.hbs b/templates/actionTypes/resource.hbs similarity index 100% rename from templates/views/actionTypes/resource.hbs rename to templates/actionTypes/resource.hbs diff --git a/templates/views/actionTypes/roll.hbs b/templates/actionTypes/roll.hbs similarity index 100% rename from templates/views/actionTypes/roll.hbs rename to templates/actionTypes/roll.hbs diff --git a/templates/views/actionTypes/save.hbs b/templates/actionTypes/save.hbs similarity index 100% rename from templates/views/actionTypes/save.hbs rename to templates/actionTypes/save.hbs diff --git a/templates/views/actionTypes/target.hbs b/templates/actionTypes/target.hbs similarity index 100% rename from templates/views/actionTypes/target.hbs rename to templates/actionTypes/target.hbs diff --git a/templates/views/actionTypes/uses.hbs b/templates/actionTypes/uses.hbs similarity index 100% rename from templates/views/actionTypes/uses.hbs rename to templates/actionTypes/uses.hbs diff --git a/templates/views/actionTypes/uuid.hbs b/templates/actionTypes/uuid.hbs similarity index 100% rename from templates/views/actionTypes/uuid.hbs rename to templates/actionTypes/uuid.hbs diff --git a/templates/views/characterCreation/footer.hbs b/templates/characterCreation/footer.hbs similarity index 100% rename from templates/views/characterCreation/footer.hbs rename to templates/characterCreation/footer.hbs diff --git a/templates/views/characterCreation/tabs.hbs b/templates/characterCreation/tabs.hbs similarity index 100% rename from templates/views/characterCreation/tabs.hbs rename to templates/characterCreation/tabs.hbs diff --git a/templates/views/characterCreation/tabs/equipment.hbs b/templates/characterCreation/tabs/equipment.hbs similarity index 100% rename from templates/views/characterCreation/tabs/equipment.hbs rename to templates/characterCreation/tabs/equipment.hbs diff --git a/templates/views/characterCreation/tabs/setup.hbs b/templates/characterCreation/tabs/setup.hbs similarity index 100% rename from templates/views/characterCreation/tabs/setup.hbs rename to templates/characterCreation/tabs/setup.hbs diff --git a/templates/views/characterCreation/tabs/story.hbs b/templates/characterCreation/tabs/story.hbs similarity index 100% rename from templates/views/characterCreation/tabs/story.hbs rename to templates/characterCreation/tabs/story.hbs diff --git a/templates/views/action.hbs b/templates/config/action.hbs similarity index 65% rename from templates/views/action.hbs rename to templates/config/action.hbs index 711094a5..bc259acd 100644 --- a/templates/views/action.hbs +++ b/templates/config/action.hbs @@ -1,6 +1,5 @@
- {{!-- {{formField fields.name value=source.name label="Name" name="name" rootId=partId}} --}}
- {{> 'systems/daggerheart/templates/views/actionTypes/uses.hbs' fields=fields.uses.fields source=source.uses}} - {{> 'systems/daggerheart/templates/views/actionTypes/cost.hbs' fields=fields.cost.element.fields source=source.cost}} - {{#if fields.target}}{{> 'systems/daggerheart/templates/views/actionTypes/range-target.hbs' fields=(object range=fields.range target=fields.target.fields) source=(object target=source.target range=source.range)}}{{/if}} + {{> 'systems/daggerheart/templates/actionTypes/uses.hbs' fields=fields.uses.fields source=source.uses}} + {{> 'systems/daggerheart/templates/actionTypes/cost.hbs' fields=fields.cost.element.fields source=source.cost}} + {{#if fields.target}}{{> 'systems/daggerheart/templates/actionTypes/range-target.hbs' fields=(object range=fields.range target=fields.target.fields) source=(object target=source.target range=source.range)}}{{/if}}
- {{#if fields.roll}}{{> 'systems/daggerheart/templates/views/actionTypes/roll.hbs' fields=fields.roll.fields source=source.roll}}{{/if}} - {{#if fields.save}}{{> 'systems/daggerheart/templates/views/actionTypes/save.hbs' fields=fields.save.fields source=source.save}}{{/if}} - {{#if fields.damage}}{{> 'systems/daggerheart/templates/views/actionTypes/damage.hbs' fields=fields.damage.fields.parts.element.fields source=source.damage}}{{/if}} - {{#if fields.healing}}{{> 'systems/daggerheart/templates/views/actionTypes/healing.hbs' fields=fields.healing.fields source=source.healing}}{{/if}} - {{#if fields.resource}}{{> 'systems/daggerheart/templates/views/actionTypes/resource.hbs' fields=fields.resource.fields source=source.resource}}{{/if}} - {{#if fields.documentUUID}}{{> 'systems/daggerheart/templates/views/actionTypes/uuid.hbs' fields=fields.documentUUID source=source.documentUUID}}{{/if}} - {{#if fields.effects}}{{> 'systems/daggerheart/templates/views/actionTypes/effect.hbs' fields=fields.effects.element.fields source=source.effects}}{{/if}} - {{#if fields.beastform}}{{> 'systems/daggerheart/templates/views/actionTypes/beastform.hbs' fields=fields.effects.element.fields source=source.beastform}}{{/if}} + {{#if fields.roll}}{{> 'systems/daggerheart/templates/actionTypes/roll.hbs' fields=fields.roll.fields source=source.roll}}{{/if}} + {{#if fields.save}}{{> 'systems/daggerheart/templates/actionTypes/save.hbs' fields=fields.save.fields source=source.save}}{{/if}} + {{#if fields.damage}}{{> 'systems/daggerheart/templates/actionTypes/damage.hbs' fields=fields.damage.fields.parts.element.fields source=source.damage}}{{/if}} + {{#if fields.healing}}{{> 'systems/daggerheart/templates/actionTypes/healing.hbs' fields=fields.healing.fields source=source.healing}}{{/if}} + {{#if fields.resource}}{{> 'systems/daggerheart/templates/actionTypes/resource.hbs' fields=fields.resource.fields source=source.resource}}{{/if}} + {{#if fields.documentUUID}}{{> 'systems/daggerheart/templates/actionTypes/uuid.hbs' fields=fields.documentUUID source=source.documentUUID}}{{/if}} + {{#if fields.effects}}{{> 'systems/daggerheart/templates/actionTypes/effect.hbs' fields=fields.effects.element.fields source=source.effects}}{{/if}} + {{#if fields.beastform}}{{> 'systems/daggerheart/templates/actionTypes/beastform.hbs' fields=fields.effects.element.fields source=source.beastform}}{{/if}}
\ No newline at end of file diff --git a/templates/dialog/item-select.hbs b/templates/dialog/item-select.hbs deleted file mode 100644 index 5941224e..00000000 --- a/templates/dialog/item-select.hbs +++ /dev/null @@ -1,5 +0,0 @@ -
- {{#each this.items as |item index|}} - - {{/each}} -
\ No newline at end of file diff --git a/templates/views/actionSelect.hbs b/templates/dialogs/actionSelect.hbs similarity index 100% rename from templates/views/actionSelect.hbs rename to templates/dialogs/actionSelect.hbs diff --git a/templates/views/beastformDialog.hbs b/templates/dialogs/beastformDialog.hbs similarity index 100% rename from templates/views/beastformDialog.hbs rename to templates/dialogs/beastformDialog.hbs diff --git a/templates/views/costSelection.hbs b/templates/dialogs/costSelection.hbs similarity index 100% rename from templates/views/costSelection.hbs rename to templates/dialogs/costSelection.hbs diff --git a/templates/views/damageReduction.hbs b/templates/dialogs/damageReduction.hbs similarity index 100% rename from templates/views/damageReduction.hbs rename to templates/dialogs/damageReduction.hbs diff --git a/templates/views/damageSelection.hbs b/templates/dialogs/damageSelection.hbs similarity index 100% rename from templates/views/damageSelection.hbs rename to templates/dialogs/damageSelection.hbs diff --git a/templates/views/deathMove.hbs b/templates/dialogs/deathMove.hbs similarity index 100% rename from templates/views/deathMove.hbs rename to templates/dialogs/deathMove.hbs diff --git a/templates/views/downtime.hbs b/templates/dialogs/downtime.hbs similarity index 100% rename from templates/views/downtime.hbs rename to templates/dialogs/downtime.hbs diff --git a/templates/views/npcRollSelection.hbs b/templates/dialogs/npcRollSelection.hbs similarity index 100% rename from templates/views/npcRollSelection.hbs rename to templates/dialogs/npcRollSelection.hbs diff --git a/templates/views/ownershipSelection.hbs b/templates/dialogs/ownershipSelection.hbs similarity index 100% rename from templates/views/ownershipSelection.hbs rename to templates/dialogs/ownershipSelection.hbs diff --git a/templates/views/rollSelection.hbs b/templates/dialogs/rollSelection.hbs similarity index 100% rename from templates/views/rollSelection.hbs rename to templates/dialogs/rollSelection.hbs diff --git a/templates/views/levelup/parts/selectable-card-preview.hbs b/templates/levelup/parts/selectable-card-preview.hbs similarity index 100% rename from templates/views/levelup/parts/selectable-card-preview.hbs rename to templates/levelup/parts/selectable-card-preview.hbs diff --git a/templates/views/levelup/tabs/advancements.hbs b/templates/levelup/tabs/advancements.hbs similarity index 100% rename from templates/views/levelup/tabs/advancements.hbs rename to templates/levelup/tabs/advancements.hbs diff --git a/templates/views/levelup/tabs/selections.hbs b/templates/levelup/tabs/selections.hbs similarity index 95% rename from templates/views/levelup/tabs/selections.hbs rename to templates/levelup/tabs/selections.hbs index 58f1825b..d397fa80 100644 --- a/templates/views/levelup/tabs/selections.hbs +++ b/templates/levelup/tabs/selections.hbs @@ -67,7 +67,7 @@
{{#each this.subclassCards}} - {{> "systems/daggerheart/templates/views/levelup/parts/selectable-card-preview.hbs" img=this.img header=this.featureLabel name=this.name path=this.path selected=this.selected uuid=this.uuid isMulticlass=this.isMulticlass featureState=this.featureState disabled=this.disabled }} + {{> "systems/daggerheart/templates/levelup/parts/selectable-card-preview.hbs" img=this.img header=this.featureLabel name=this.name path=this.path selected=this.selected uuid=this.uuid isMulticlass=this.isMulticlass featureState=this.featureState disabled=this.disabled }} {{/each}}
diff --git a/templates/views/levelup/tabs/summary.hbs b/templates/levelup/tabs/summary.hbs similarity index 100% rename from templates/views/levelup/tabs/summary.hbs rename to templates/levelup/tabs/summary.hbs diff --git a/templates/views/levelup/tabs/tab-navigation.hbs b/templates/levelup/tabs/tab-navigation.hbs similarity index 100% rename from templates/views/levelup/tabs/tab-navigation.hbs rename to templates/levelup/tabs/tab-navigation.hbs diff --git a/templates/sheets/applications/adversary-settings/actions.hbs b/templates/sheets-settings/adversary-settings/actions.hbs similarity index 97% rename from templates/sheets/applications/adversary-settings/actions.hbs rename to templates/sheets-settings/adversary-settings/actions.hbs index 73594da2..f766c24a 100644 --- a/templates/sheets/applications/adversary-settings/actions.hbs +++ b/templates/sheets-settings/adversary-settings/actions.hbs @@ -1,34 +1,34 @@ -
- -
- {{localize tabs.actions.label}} - -
+
+ +
+ {{localize tabs.actions.label}} +
    + {{#each document.system.actions as |action index|}} +
  • + +
    + {{action.name}} +
    +
    + {{localize (concat 'DAGGERHEART.Actions.Types.' action.type '.name')}} +
    +
    + {{localize (concat 'DAGGERHEART.ActionType.' action.actionType)}} +
    +
    +
    +
    + + +
    +
  • + {{/each}} +
+
\ No newline at end of file diff --git a/templates/sheets/applications/adversary-settings/attack.hbs b/templates/sheets-settings/adversary-settings/attack.hbs similarity index 87% rename from templates/sheets/applications/adversary-settings/attack.hbs rename to templates/sheets-settings/adversary-settings/attack.hbs index d731e5f6..a40aeae1 100644 --- a/templates/sheets/applications/adversary-settings/attack.hbs +++ b/templates/sheets-settings/adversary-settings/attack.hbs @@ -1,23 +1,23 @@ -
-
- {{localize "DAGGERHEART.General.basics"}} - {{formGroup systemFields.attack.fields.img value=document.system.attack.img label="Image Path" name="system.attack.img"}} - {{formGroup systemFields.attack.fields.name value=document.system.attack.name label="Attack Name" name="system.attack.name"}} -
-
- {{localize "DAGGERHEART.Sheets.Adversary.Attack"}} - {{formField systemFields.attack.fields.roll.fields.bonus value=document.system.attack.roll.bonus label="Attack Bonus" name="system.attack.roll.bonus"}} - {{formField systemFields.attack.fields.range value=document.system.attack.range label="Range" name="system.attack.range" localize=true}} - {{#if systemFields.attack.fields.target.fields}} - {{ formField systemFields.attack.fields.target.fields.type value=document.system.attack.target.type label="Target" name="system.attack.target.type" localize=true }} - {{#if (and document.system.attack.target.type (not (eq document.system.attack.target.type 'self')))}} - {{ formField systemFields.attack.fields.target.fields.amount value=document.system.attack.target.amount label="Amount" name="system.attack.target.amount" }} - {{/if}} - {{/if}} -
- {{> 'systems/daggerheart/templates/views/actionTypes/damage.hbs' fields=systemFields.attack.fields.damage.fields.parts.element.fields source=document.system.attack.damage path="system.attack."}} +
+
+ {{localize "DAGGERHEART.General.basics"}} + {{formGroup systemFields.attack.fields.img value=document.system.attack.img label="Image Path" name="system.attack.img"}} + {{formGroup systemFields.attack.fields.name value=document.system.attack.name label="Attack Name" name="system.attack.name"}} +
+
+ {{localize "DAGGERHEART.Sheets.Adversary.Attack"}} + {{formField systemFields.attack.fields.roll.fields.bonus value=document.system.attack.roll.bonus label="Attack Bonus" name="system.attack.roll.bonus"}} + {{formField systemFields.attack.fields.range value=document.system.attack.range label="Range" name="system.attack.range" localize=true}} + {{#if systemFields.attack.fields.target.fields}} + {{ formField systemFields.attack.fields.target.fields.type value=document.system.attack.target.type label="Target" name="system.attack.target.type" localize=true }} + {{#if (and document.system.attack.target.type (not (eq document.system.attack.target.type 'self')))}} + {{ formField systemFields.attack.fields.target.fields.amount value=document.system.attack.target.amount label="Amount" name="system.attack.target.amount" }} + {{/if}} + {{/if}} +
+ {{> 'systems/daggerheart/templates/actionTypes/damage.hbs' fields=systemFields.attack.fields.damage.fields.parts.element.fields source=document.system.attack.damage path="system.attack."}}
\ No newline at end of file diff --git a/templates/sheets/applications/adversary-settings/details.hbs b/templates/sheets-settings/adversary-settings/details.hbs similarity index 98% rename from templates/sheets/applications/adversary-settings/details.hbs rename to templates/sheets-settings/adversary-settings/details.hbs index 9c9b9cc4..885e2f5f 100644 --- a/templates/sheets/applications/adversary-settings/details.hbs +++ b/templates/sheets-settings/adversary-settings/details.hbs @@ -1,38 +1,38 @@ -
-
- {{localize 'DAGGERHEART.General.basics'}} -
- {{formGroup systemFields.tier value=document.system.tier localize=true}} - {{formGroup systemFields.type value=document.system.type localize=true}} - {{#if (eq document.system.type 'horde')}} - {{formGroup systemFields.hordeHp value=document.system.hordeHp label=(localize "DAGGERHEART.Sheets.Adversary.horderHp")}} - {{/if}} - {{formGroup systemFields.difficulty value=document.system.difficulty localize=true}} -
- {{formField systemFields.description value=document.system.description label=(localize "DAGGERHEART.Sheets.Adversary.FIELDS.description.label")}} - {{formField systemFields.motivesAndTactics value=document.system.motivesAndTactics label=(localize "DAGGERHEART.Sheets.Adversary.FIELDS.motivesAndTactics.label")}} -
- -
-
- {{localize "DAGGERHEART.Sheets.Adversary.HitPoints"}} - {{formGroup systemFields.resources.fields.hitPoints.fields.value value=document.system.resources.hitPoints.value}} - {{formGroup systemFields.resources.fields.hitPoints.fields.max value=document.system.resources.hitPoints.max}} -
-
- {{localize "DAGGERHEART.Sheets.Adversary.Stress"}} - {{formGroup systemFields.resources.fields.stress.fields.value value=document.system.resources.stress.value}} - {{formGroup systemFields.resources.fields.stress.fields.max value=document.system.resources.stress.max}} -
-
- -
- {{localize "DAGGERHEART.Sheets.Adversary.DamageThresholds"}} - {{formGroup systemFields.damageThresholds.fields.major value=document.system.damageThresholds.major}} - {{formGroup systemFields.damageThresholds.fields.severe value=document.system.damageThresholds.severe}} -
+
+
+ {{localize 'DAGGERHEART.General.basics'}} +
+ {{formGroup systemFields.tier value=document.system.tier localize=true}} + {{formGroup systemFields.type value=document.system.type localize=true}} + {{#if (eq document.system.type 'horde')}} + {{formGroup systemFields.hordeHp value=document.system.hordeHp label=(localize "DAGGERHEART.Sheets.Adversary.horderHp")}} + {{/if}} + {{formGroup systemFields.difficulty value=document.system.difficulty localize=true}} +
+ {{formField systemFields.description value=document.system.description label=(localize "DAGGERHEART.Sheets.Adversary.FIELDS.description.label")}} + {{formField systemFields.motivesAndTactics value=document.system.motivesAndTactics label=(localize "DAGGERHEART.Sheets.Adversary.FIELDS.motivesAndTactics.label")}} +
+ +
+
+ {{localize "DAGGERHEART.Sheets.Adversary.HitPoints"}} + {{formGroup systemFields.resources.fields.hitPoints.fields.value value=document.system.resources.hitPoints.value}} + {{formGroup systemFields.resources.fields.hitPoints.fields.max value=document.system.resources.hitPoints.max}} +
+
+ {{localize "DAGGERHEART.Sheets.Adversary.Stress"}} + {{formGroup systemFields.resources.fields.stress.fields.value value=document.system.resources.stress.value}} + {{formGroup systemFields.resources.fields.stress.fields.max value=document.system.resources.stress.max}} +
+
+ +
+ {{localize "DAGGERHEART.Sheets.Adversary.DamageThresholds"}} + {{formGroup systemFields.damageThresholds.fields.major value=document.system.damageThresholds.major}} + {{formGroup systemFields.damageThresholds.fields.severe value=document.system.damageThresholds.severe}} +
\ No newline at end of file diff --git a/templates/sheets/applications/adversary-settings/experiences.hbs b/templates/sheets-settings/adversary-settings/experiences.hbs similarity index 97% rename from templates/sheets/applications/adversary-settings/experiences.hbs rename to templates/sheets-settings/adversary-settings/experiences.hbs index 5e4a483c..92e1f69a 100644 --- a/templates/sheets/applications/adversary-settings/experiences.hbs +++ b/templates/sheets-settings/adversary-settings/experiences.hbs @@ -1,23 +1,23 @@ -
- - -
- {{localize tabs.experiences.label}} -
    - {{#each document.system.experiences as |experience key|}} -
  • - - - -
  • - {{/each}} -
-
- +
+ + +
+ {{localize tabs.experiences.label}} +
    + {{#each document.system.experiences as |experience key|}} +
  • + + + +
  • + {{/each}} +
+
+
\ No newline at end of file diff --git a/templates/sheets/applications/adversary-settings/header.hbs b/templates/sheets-settings/adversary-settings/header.hbs similarity index 97% rename from templates/sheets/applications/adversary-settings/header.hbs rename to templates/sheets-settings/adversary-settings/header.hbs index 0978f2c3..c9cb60fe 100644 --- a/templates/sheets/applications/adversary-settings/header.hbs +++ b/templates/sheets-settings/adversary-settings/header.hbs @@ -1,3 +1,3 @@ -
-

{{document.name}}

+
+

{{document.name}}

\ No newline at end of file diff --git a/templates/sheets/applications/companion-settings/attack.hbs b/templates/sheets-settings/companion-settings/attack.hbs similarity index 98% rename from templates/sheets/applications/companion-settings/attack.hbs rename to templates/sheets-settings/companion-settings/attack.hbs index f0a26769..ad68b34e 100644 --- a/templates/sheets/applications/companion-settings/attack.hbs +++ b/templates/sheets-settings/companion-settings/attack.hbs @@ -1,21 +1,21 @@ -
-
- {{localize "DAGGERHEART.General.basics"}} - {{formGroup systemFields.attack.fields.img value=document.system.attack.img label="Image Path" name="system.attack.img"}} - {{formGroup systemFields.attack.fields.name value=document.system.attack.name label="Attack Name" name="system.attack.name"}} -
-
- {{localize "DAGGERHEART.Sheets.Adversary.Attack"}} - {{formField systemFields.attack.fields.range value=document.system.attack.range label="Range" name="system.attack.range" localize=true}} - {{#if systemFields.attack.fields.target.fields}} - {{ formField systemFields.attack.fields.target.fields.type value=document.system.attack.target.type label="Target" name="system.attack.target.type" localize=true }} - {{#if (and document.system.attack.target.type (not (eq document.system.attack.target.type 'self')))}} - {{ formField systemFields.attack.fields.target.fields.amount value=document.system.attack.target.amount label="Amount" name="system.attack.target.amount" }} - {{/if}} - {{/if}} -
+
+
+ {{localize "DAGGERHEART.General.basics"}} + {{formGroup systemFields.attack.fields.img value=document.system.attack.img label="Image Path" name="system.attack.img"}} + {{formGroup systemFields.attack.fields.name value=document.system.attack.name label="Attack Name" name="system.attack.name"}} +
+
+ {{localize "DAGGERHEART.Sheets.Adversary.Attack"}} + {{formField systemFields.attack.fields.range value=document.system.attack.range label="Range" name="system.attack.range" localize=true}} + {{#if systemFields.attack.fields.target.fields}} + {{ formField systemFields.attack.fields.target.fields.type value=document.system.attack.target.type label="Target" name="system.attack.target.type" localize=true }} + {{#if (and document.system.attack.target.type (not (eq document.system.attack.target.type 'self')))}} + {{ formField systemFields.attack.fields.target.fields.amount value=document.system.attack.target.amount label="Amount" name="system.attack.target.amount" }} + {{/if}} + {{/if}} +
\ No newline at end of file diff --git a/templates/sheets/applications/companion-settings/details.hbs b/templates/sheets-settings/companion-settings/details.hbs similarity index 98% rename from templates/sheets/applications/companion-settings/details.hbs rename to templates/sheets-settings/companion-settings/details.hbs index d047752c..9aea2d05 100644 --- a/templates/sheets/applications/companion-settings/details.hbs +++ b/templates/sheets-settings/companion-settings/details.hbs @@ -1,23 +1,23 @@ -
-
- {{localize 'DAGGERHEART.General.basics'}} -
- {{formGroup systemFields.evasion.fields.value value=document.system.evasion.value localize=true}} - {{formGroup systemFields.resources.fields.stress.fields.value value=document.system.resources.stress.value label='Current Stress'}} - {{formGroup systemFields.resources.fields.stress.fields.max value=document.system.resources.stress.max label='Max Stress'}} -
-
-
- - -
-
-
- +
+
+ {{localize 'DAGGERHEART.General.basics'}} +
+ {{formGroup systemFields.evasion.fields.value value=document.system.evasion.value localize=true}} + {{formGroup systemFields.resources.fields.stress.fields.value value=document.system.resources.stress.value label='Current Stress'}} + {{formGroup systemFields.resources.fields.stress.fields.max value=document.system.resources.stress.max label='Max Stress'}} +
+
+
+ + +
+
+
+
\ No newline at end of file diff --git a/templates/sheets/applications/companion-settings/experiences.hbs b/templates/sheets-settings/companion-settings/experiences.hbs similarity index 97% rename from templates/sheets/applications/companion-settings/experiences.hbs rename to templates/sheets-settings/companion-settings/experiences.hbs index 124a1a86..a484c25b 100644 --- a/templates/sheets/applications/companion-settings/experiences.hbs +++ b/templates/sheets-settings/companion-settings/experiences.hbs @@ -1,18 +1,18 @@ -
-
- {{localize tabs.experiences.label}} -
    - {{#each document.system.experiences as |experience key|}} -
  • - - -
  • - {{/each}} -
-
- +
+
+ {{localize tabs.experiences.label}} +
    + {{#each document.system.experiences as |experience key|}} +
  • + + +
  • + {{/each}} +
+
+
\ No newline at end of file diff --git a/templates/sheets/applications/companion-settings/header.hbs b/templates/sheets-settings/companion-settings/header.hbs similarity index 97% rename from templates/sheets/applications/companion-settings/header.hbs rename to templates/sheets-settings/companion-settings/header.hbs index 0978f2c3..c9cb60fe 100644 --- a/templates/sheets/applications/companion-settings/header.hbs +++ b/templates/sheets-settings/companion-settings/header.hbs @@ -1,3 +1,3 @@ -
-

{{document.name}}

+
+

{{document.name}}

\ No newline at end of file diff --git a/templates/sheets/applications/environment-settings/actions.hbs b/templates/sheets-settings/environment-settings/actions.hbs similarity index 97% rename from templates/sheets/applications/environment-settings/actions.hbs rename to templates/sheets-settings/environment-settings/actions.hbs index 73594da2..f766c24a 100644 --- a/templates/sheets/applications/environment-settings/actions.hbs +++ b/templates/sheets-settings/environment-settings/actions.hbs @@ -1,34 +1,34 @@ -
- -
- {{localize tabs.actions.label}} -
    - {{#each document.system.actions as |action index|}} -
  • - -
    - {{action.name}} -
    -
    - {{localize (concat 'DAGGERHEART.Actions.Types.' action.type '.name')}} -
    -
    - {{localize (concat 'DAGGERHEART.ActionType.' action.actionType)}} -
    -
    -
    -
    - - -
    -
  • - {{/each}} -
-
+
+ +
+ {{localize tabs.actions.label}} +
    + {{#each document.system.actions as |action index|}} +
  • + +
    + {{action.name}} +
    +
    + {{localize (concat 'DAGGERHEART.Actions.Types.' action.type '.name')}} +
    +
    + {{localize (concat 'DAGGERHEART.ActionType.' action.actionType)}} +
    +
    +
    +
    + + +
    +
  • + {{/each}} +
+
\ No newline at end of file diff --git a/templates/sheets/applications/environment-settings/adversaries.hbs b/templates/sheets-settings/environment-settings/adversaries.hbs similarity index 98% rename from templates/sheets/applications/environment-settings/adversaries.hbs rename to templates/sheets-settings/environment-settings/adversaries.hbs index 0abe45d1..2d994be3 100644 --- a/templates/sheets/applications/environment-settings/adversaries.hbs +++ b/templates/sheets-settings/environment-settings/adversaries.hbs @@ -1,28 +1,28 @@ -
- - {{#each document.system.potentialAdversaries}} -
- {{this.label}} -
- - -
-
- {{#each this.adversaries as |adversary|}} -
- {{> 'systems/daggerheart/templates/sheets/global/partials/inventory-item.hbs' item=adversary type='adversary' isActor=true categoryAdversary=@../key}} -
- {{/each}} -
-
- Drop Actors here -
-
- {{/each}} +
+ + {{#each document.system.potentialAdversaries}} +
+ {{this.label}} +
+ + +
+
+ {{#each this.adversaries as |adversary|}} +
+ {{> 'systems/daggerheart/templates/sheets/global/partials/inventory-item.hbs' item=adversary type='adversary' isActor=true categoryAdversary=@../key}} +
+ {{/each}} +
+
+ Drop Actors here +
+
+ {{/each}}
\ No newline at end of file diff --git a/templates/sheets/applications/environment-settings/details.hbs b/templates/sheets-settings/environment-settings/details.hbs similarity index 98% rename from templates/sheets/applications/environment-settings/details.hbs rename to templates/sheets-settings/environment-settings/details.hbs index f6a9518b..2c0e06c4 100644 --- a/templates/sheets/applications/environment-settings/details.hbs +++ b/templates/sheets-settings/environment-settings/details.hbs @@ -1,16 +1,16 @@ -
-
- {{localize 'DAGGERHEART.General.basics'}} -
- {{formGroup systemFields.tier value=document.system.tier localize=true}} - {{formGroup systemFields.type value=document.system.type localize=true}} - {{formGroup systemFields.difficulty value=document.system.difficulty localize=true}} -
- {{formField systemFields.description value=document.system.description label=(localize "DAGGERHEART.Sheets.Environment.FIELDS.description.label")}} - {{formField systemFields.impulses value=document.system.impulses label=(localize "DAGGERHEART.Sheets.Environment.FIELDS.impulses.label")}} -
+
+
+ {{localize 'DAGGERHEART.General.basics'}} +
+ {{formGroup systemFields.tier value=document.system.tier localize=true}} + {{formGroup systemFields.type value=document.system.type localize=true}} + {{formGroup systemFields.difficulty value=document.system.difficulty localize=true}} +
+ {{formField systemFields.description value=document.system.description label=(localize "DAGGERHEART.Sheets.Environment.FIELDS.description.label")}} + {{formField systemFields.impulses value=document.system.impulses label=(localize "DAGGERHEART.Sheets.Environment.FIELDS.impulses.label")}} +
\ No newline at end of file diff --git a/templates/sheets/applications/environment-settings/header.hbs b/templates/sheets-settings/environment-settings/header.hbs similarity index 97% rename from templates/sheets/applications/environment-settings/header.hbs rename to templates/sheets-settings/environment-settings/header.hbs index 0978f2c3..c9cb60fe 100644 --- a/templates/sheets/applications/environment-settings/header.hbs +++ b/templates/sheets-settings/environment-settings/header.hbs @@ -1,3 +1,3 @@ -
-

{{document.name}}

+
+

{{document.name}}

\ No newline at end of file diff --git a/templates/sheets/global/partials/inventory-item.hbs b/templates/sheets/global/partials/inventory-item.hbs index a774b332..2e0ea2e6 100644 --- a/templates/sheets/global/partials/inventory-item.hbs +++ b/templates/sheets/global/partials/inventory-item.hbs @@ -1,5 +1,5 @@ -
  • - +
  • +
    {{#if isCompanion}} {{item.name}} diff --git a/templates/sheets/parts/armor.hbs b/templates/sheets/parts/armor.hbs deleted file mode 100644 index 28d23944..00000000 --- a/templates/sheets/parts/armor.hbs +++ /dev/null @@ -1,13 +0,0 @@ -
    - - {{localize "DAGGERHEART.Sheets.PC.Armor.Title"}} - - -
    -
    - - -
    - -
    -
    \ No newline at end of file diff --git a/templates/sheets/parts/attributes.hbs b/templates/sheets/parts/attributes.hbs deleted file mode 100644 index 08e414cd..00000000 --- a/templates/sheets/parts/attributes.hbs +++ /dev/null @@ -1,36 +0,0 @@ -
    - - {{localize "Attributes"}} - - - - {{#each this.attributes as |attribute key|}} -
    -
    - -
    {{key}}
    -
    -
    - {{#if ../editAttributes}} - - {{else}} -
    {{attribute.total}}
    - {{/if}} - -
    - {{#each this.descriptors}} -
    {{this}}
    - {{/each}} -
    -
    - {{#each attribute.verbs}} -
    {{this}}
    - {{/each}} -
    - {{/each}} -
    \ No newline at end of file diff --git a/templates/sheets/parts/defense.hbs b/templates/sheets/parts/defense.hbs deleted file mode 100644 index 7553373c..00000000 --- a/templates/sheets/parts/defense.hbs +++ /dev/null @@ -1,33 +0,0 @@ -
    - {{localize "Defense"}} - -
    -
    -
    -
    {{document.system.evasion.total}}
    - -
    {{localize "DAGGERHEART.Sheets.PC.Defense.Evasion"}}
    -
    -
    -
    -
    -
    -
    {{#if document.system.armor.system.baseScore}}{{document.system.armor.system.baseScore}}{{else}}0{{/if}}
    - -
    {{localize "DAGGERHEART.Sheets.PC.Defense.Armor"}}
    -
    - {{#if document.system.armor.system.marks}} -
    - {{#times (subtract 12 document.system.armor.system.marks.max)}} - - {{/times}} - {{#times document.system.armor.system.marks.max}} - {{#with (add this 1)}} - - {{/with}} - {{/times}} -
    - {{/if}} -
    -
    -
    \ No newline at end of file diff --git a/templates/sheets/parts/domainCard.hbs b/templates/sheets/parts/domainCard.hbs deleted file mode 100644 index 7d092855..00000000 --- a/templates/sheets/parts/domainCard.hbs +++ /dev/null @@ -1,27 +0,0 @@ -
    -
    - -
    {{card.system.level}}
    - {{#if inVault}} -
    - {{card.system.recallCost}} -
    - {{else}} -
    - {{card.system.recallCost}} -
    - {{/if}} -
    -
    {{card.system.type}}
    -
    -
    -
    -
    -
    {{card.name}}
    - {{#if inVault}} -
    {{{card.system.effect}}}
    - {{else}} -
    {{{card.system.effect}}}
    - {{/if}} -
    -
    \ No newline at end of file diff --git a/templates/sheets/parts/effects.hbs b/templates/sheets/parts/effects.hbs deleted file mode 100644 index 13c50355..00000000 --- a/templates/sheets/parts/effects.hbs +++ /dev/null @@ -1,69 +0,0 @@ -
    -

    - {{localize "Effects"}} - - -

    - - {{#each this.effects as |effect key|}} -
    - - {{effect.type}} - - - {{#if effect.applyLocationChoices}} -
    - - -
    - {{/if}} - {{#if (eq effect.valueType ../config.valueTypes.numberString.id)}} - {{#if (eq effect.type ../config.effectTypes.damage.id) }} -
    - {{!-- --}} -
    - - - - -
    -
    - {{!--
    - - -
    --}} -
    - -
    - -
    -
    - {{else}} -
    - {{!-- --}} -
    - - -
    -
    - {{/if}} - {{/if}} - {{#if (eq effect.valueType ../config.valueTypes.select.id)}} -
    - -
    -
    - -
    - {{/if}} -
    - {{/each}} -
    \ No newline at end of file diff --git a/templates/sheets/parts/experience.hbs b/templates/sheets/parts/experience.hbs deleted file mode 100644 index 5bc7e1c2..00000000 --- a/templates/sheets/parts/experience.hbs +++ /dev/null @@ -1,15 +0,0 @@ -
    - {{localize "DAGGERHEART.Sheets.PC.Experience.Title"}} - {{#each document.system.experiences as |experience id|}} -
    - -
    {{experience.total}}
    -
    - {{/each}} - {{#times (subtract 5 (length document.system.experiences))}} -
    - -
    -
    - {{/times}} -
    \ No newline at end of file diff --git a/templates/sheets/parts/features.hbs b/templates/sheets/parts/features.hbs deleted file mode 100644 index 4fb37890..00000000 --- a/templates/sheets/parts/features.hbs +++ /dev/null @@ -1,48 +0,0 @@ -
    - - {{#if this.document.system.class.value}} - {{#if this.document.system.multiclass.value}} - {{this.document.system.class.name}} {{localize "DAGGERHEART.General.Features"}} - /  - {{this.document.system.multiclass.name}} {{localize "DAGGERHEART.General.Features"}} - {{else}} - {{this.document.system.class.value.name}} {{localize "DAGGERHEART.General.Features"}} - {{/if}} - {{else}} - {{localize "DAGGERHEART.Sheets.PC.Features.Title"}} - {{/if}} - - -
    - {{#each this.features as |feature index|}} -
    - -
    {{feature.name}}
    - -
    -
    -
    {{{feature.system.description}}}
    {{!-- Maybe maybe --}} - {{#if (eq feature.system.featureType.type 'input')}} - - {{/if}} - {{#if (eq feature.system.featureType.type 'dice')}} -
    - {{#times feature.system.featureType.data.max}} - {{#if (gt ../this.system.featureType.data.property this)}} -
    - {{#if (lookup (lookup ../this.system.featureType.data.numbers this) 'value')}} -
    {{lookup (lookup ../this.system.featureType.data.numbers this) 'value'}}
    - {{else}} - - {{/if}} -
    - {{else}} -
    - {{/if}} - {{/times}} -
    - {{/if}} -
    - {{/each}} -
    -
    \ No newline at end of file diff --git a/templates/sheets/parts/gold.hbs b/templates/sheets/parts/gold.hbs deleted file mode 100644 index d25894b5..00000000 --- a/templates/sheets/parts/gold.hbs +++ /dev/null @@ -1,88 +0,0 @@ -
    - {{localize this.inventory.currency.title}} - -
    -
    - - {{localize this.inventory.currency.coins}} - -
    -
    - {{#times 5}} - {{#with (add this 1)}} - - {{!-- --}} - {{/with}} - {{/times}} -
    -
    - {{#times 4}} - {{#with (add this 6)}} - - {{!-- --}} - {{/with}} - {{/times}} -
    -
    -
    -
    - - {{localize this.inventory.currency.handfulls}} - -
    -
    - {{#times 5}} - {{#with (add this 1)}} - {{!-- --}} - - {{/with}} - {{/times}} -
    -
    - {{#times 4}} - {{#with (add this 6)}} - {{!-- --}} - - {{/with}} - {{/times}} -
    -
    -
    -
    - - {{localize this.inventory.currency.bags}} - -
    -
    - {{#times 5}} - {{#with (add this 1)}} - {{!-- --}} - - {{/with}} - {{/times}} -
    -
    - {{#times 4}} - {{#with (add this 6)}} - {{!-- --}} - - {{/with}} - {{/times}} -
    - - {{!-- --}} - -
    -
    -
    - - {{localize this.inventory.currency.chests}} - - -
    - - {{!-- --}} -
    -
    -
    -
    \ No newline at end of file diff --git a/templates/sheets/parts/health.hbs b/templates/sheets/parts/health.hbs deleted file mode 100644 index 991f68e7..00000000 --- a/templates/sheets/parts/health.hbs +++ /dev/null @@ -1,54 +0,0 @@ -
    - {{localize "DAGGERHEART.Sheets.PC.Health.Title"}} - -
    -
    -
    {{localize "DAGGERHEART.Sheets.PC.Health.Minor"}}
    -
    - -
    - {{document.system.damageThresholds.major}} -
    -
    - -
    {{localize "DAGGERHEART.Sheets.PC.Health.Major"}}
    -
    - -
    - {{document.system.damageThresholds.severe}} -
    -
    - -
    {{localize "DAGGERHEART.Sheets.PC.Health.Severe"}}
    -
    - -
    -
    -
    -
    {{localize "DAGGERHEART.Sheets.PC.Health.HealthTitle"}}
    -
    {{localize "DAGGERHEART.Sheets.PC.Health.StressTitle"}}
    -
    -
    -
    - {{#times document.system.resources.hitPoints.maxTotal}} - {{#with (add this 1)}} - - {{/with}} - {{/times}} - {{#times (subtract 12 document.system.resources.hitPoints.maxTotal)}} - - {{/times}} -
    -
    - {{#times document.system.resources.stress.maxTotal}} - {{#with (add this 1)}} - - {{/with}} - {{/times}} - {{#times (subtract 12 document.system.resources.stress.maxTotal)}} - - {{/times}} -
    -
    -
    -
    \ No newline at end of file diff --git a/templates/sheets/parts/heritage.hbs b/templates/sheets/parts/heritage.hbs deleted file mode 100644 index 6fce3638..00000000 --- a/templates/sheets/parts/heritage.hbs +++ /dev/null @@ -1,20 +0,0 @@ -
    - {{formInput systemFields.description value=source.system.description enriched=source.system.description localize=true toggled=true}} -
    -

    {{localize "DAGGERHEART.Sheets.Heritage.Title"}}

    -
    -
    - {{#each source.system.abilities as |ability key|}} -
    -
    - -
    {{ability.name}}
    -
    -
    - - -
    -
    - {{/each}} -
    -
    \ No newline at end of file diff --git a/templates/sheets/parts/hope.hbs b/templates/sheets/parts/hope.hbs deleted file mode 100644 index cfd58d48..00000000 --- a/templates/sheets/parts/hope.hbs +++ /dev/null @@ -1,15 +0,0 @@ -
    - {{localize "DAGGERHEART.Sheets.PC.Hope.Title"}} - -
    - {{localize "DAGGERHEART.Sheets.PC.Hope.Description"}} -
    - {{#times 6}} - - - {{#if (gte this ../document.system.resources.hope.max)}}{{/if}} - - {{/times}} -
    -
    -
    \ No newline at end of file diff --git a/templates/sheets/parts/subclassFeature.hbs b/templates/sheets/parts/subclassFeature.hbs deleted file mode 100644 index d4f97a9a..00000000 --- a/templates/sheets/parts/subclassFeature.hbs +++ /dev/null @@ -1,25 +0,0 @@ -
    - {{#with (concat "system." featureType "Feature" ".")}} -
    - - {{formInput ../field.description value=../feature.description enriched=../feature.description localize=true toggled=true}} - {{!-- {{editor ../feature.description target=(concat this "description") button=true}} --}} -
    -
    -

    {{localize "DAGGERHEART.Sheets.Subclass.SubclassFeature.Abilities"}}

    -
    - - {{#each ../feature/abilities as |ability key|}} -
    -
    - -
    {{ability.name}}
    -
    -
    - - -
    -
    - {{/each}} - {{/with}} -
    \ No newline at end of file diff --git a/templates/sheets/parts/weapons.hbs b/templates/sheets/parts/weapons.hbs deleted file mode 100644 index a020d55f..00000000 --- a/templates/sheets/parts/weapons.hbs +++ /dev/null @@ -1,49 +0,0 @@ -
    - -
    - {{localize "DAGGERHEART.Sheets.PC.Weapons.Title"}} -
    - {{localize "DAGGERHEART.Sheets.PC.Weapons.ProficiencyTitle"}} - {{#times 6}} - - {{/times}} -
    -
    -
    -
    - - -
    -
    - -
    -

    - {{localize "DAGGERHEART.Sheets.PC.Weapons.PrimaryTitle"}} - {{#if primaryWeapon}} - - {{/if}} -

    -
    - - - - -
    - -
    -
    -

    - {{localize "DAGGERHEART.Sheets.PC.Weapons.SecondaryTitle"}} - {{#if secondaryWeapon}} - - {{/if}} -

    -
    - - - - -
    - -
    -
    \ No newline at end of file diff --git a/templates/chat/ability-use.hbs b/templates/ui/chat/ability-use.hbs similarity index 100% rename from templates/chat/ability-use.hbs rename to templates/ui/chat/ability-use.hbs diff --git a/templates/chat/adversary-attack-roll.hbs b/templates/ui/chat/adversary-attack-roll.hbs similarity index 100% rename from templates/chat/adversary-attack-roll.hbs rename to templates/ui/chat/adversary-attack-roll.hbs diff --git a/templates/chat/adversary-roll.hbs b/templates/ui/chat/adversary-roll.hbs similarity index 94% rename from templates/chat/adversary-roll.hbs rename to templates/ui/chat/adversary-roll.hbs index 0004e586..1b58ea9b 100644 --- a/templates/chat/adversary-roll.hbs +++ b/templates/ui/chat/adversary-roll.hbs @@ -38,12 +38,12 @@
    - {{> 'systems/daggerheart/templates/chat/parts/damage-chat.hbs' damage=damage noTitle=true}} + {{> 'systems/daggerheart/templates/ui/chat/parts/damage-chat.hbs' damage=damage noTitle=true}}
    -{{> 'systems/daggerheart/templates/chat/parts/target-chat.hbs'}} +{{> 'systems/daggerheart/templates/ui/chat/parts/target-chat.hbs'}} {{#if hasDamage}}
    diff --git a/templates/chat/apply-effects.hbs b/templates/ui/chat/apply-effects.hbs similarity index 100% rename from templates/chat/apply-effects.hbs rename to templates/ui/chat/apply-effects.hbs diff --git a/templates/chat/damage-roll.hbs b/templates/ui/chat/damage-roll.hbs similarity index 74% rename from templates/chat/damage-roll.hbs rename to templates/ui/chat/damage-roll.hbs index 2b6452b7..2d008e06 100644 --- a/templates/chat/damage-roll.hbs +++ b/templates/ui/chat/damage-roll.hbs @@ -1,5 +1,5 @@ -{{> 'systems/daggerheart/templates/chat/parts/damage-chat.hbs' damage=this}} -{{> 'systems/daggerheart/templates/chat/parts/target-chat.hbs'}} +{{> 'systems/daggerheart/templates/ui/chat/parts/damage-chat.hbs' damage=this}} +{{> 'systems/daggerheart/templates/ui/chat/parts/target-chat.hbs'}}
    diff --git a/templates/chat/deathMove.hbs b/templates/ui/chat/deathMove.hbs similarity index 100% rename from templates/chat/deathMove.hbs rename to templates/ui/chat/deathMove.hbs diff --git a/templates/chat/downtime.hbs b/templates/ui/chat/downtime.hbs similarity index 100% rename from templates/chat/downtime.hbs rename to templates/ui/chat/downtime.hbs diff --git a/templates/chat/duality-roll.hbs b/templates/ui/chat/duality-roll.hbs similarity index 97% rename from templates/chat/duality-roll.hbs rename to templates/ui/chat/duality-roll.hbs index 9a530649..d9c56988 100644 --- a/templates/chat/duality-roll.hbs +++ b/templates/ui/chat/duality-roll.hbs @@ -123,12 +123,12 @@
    - {{> 'systems/daggerheart/templates/chat/parts/damage-chat.hbs' damage=damage noTitle=true}} + {{> 'systems/daggerheart/templates/ui/chat/parts/damage-chat.hbs' damage=damage noTitle=true}}
    -{{> 'systems/daggerheart/templates/chat/parts/target-chat.hbs'}} +{{> 'systems/daggerheart/templates/ui/chat/parts/target-chat.hbs'}}
    diff --git a/templates/chat/healing-roll.hbs b/templates/ui/chat/healing-roll.hbs similarity index 100% rename from templates/chat/healing-roll.hbs rename to templates/ui/chat/healing-roll.hbs diff --git a/templates/chat/parts/damage-chat.hbs b/templates/ui/chat/parts/damage-chat.hbs similarity index 100% rename from templates/chat/parts/damage-chat.hbs rename to templates/ui/chat/parts/damage-chat.hbs diff --git a/templates/chat/parts/target-chat.hbs b/templates/ui/chat/parts/target-chat.hbs similarity index 100% rename from templates/chat/parts/target-chat.hbs rename to templates/ui/chat/parts/target-chat.hbs diff --git a/templates/ui/combat/combatTracker.hbs b/templates/ui/combatTracker/combatTracker.hbs similarity index 100% rename from templates/ui/combat/combatTracker.hbs rename to templates/ui/combatTracker/combatTracker.hbs diff --git a/templates/ui/combat/combatTrackerFooter.hbs b/templates/ui/combatTracker/combatTrackerFooter.hbs similarity index 100% rename from templates/ui/combat/combatTrackerFooter.hbs rename to templates/ui/combatTracker/combatTrackerFooter.hbs diff --git a/templates/ui/combat/combatTrackerHeader.hbs b/templates/ui/combatTracker/combatTrackerHeader.hbs similarity index 100% rename from templates/ui/combat/combatTrackerHeader.hbs rename to templates/ui/combatTracker/combatTrackerHeader.hbs diff --git a/templates/ui/combat/combatTrackerSection.hbs b/templates/ui/combatTracker/combatTrackerSection.hbs similarity index 100% rename from templates/ui/combat/combatTrackerSection.hbs rename to templates/ui/combatTracker/combatTrackerSection.hbs diff --git a/templates/views/countdowns.hbs b/templates/ui/countdowns.hbs similarity index 100% rename from templates/views/countdowns.hbs rename to templates/ui/countdowns.hbs diff --git a/templates/views/resources.hbs b/templates/ui/fearTracker.hbs similarity index 100% rename from templates/views/resources.hbs rename to templates/ui/fearTracker.hbs diff --git a/templates/tooltip/armor.hbs b/templates/ui/tooltip/armor.hbs similarity index 100% rename from templates/tooltip/armor.hbs rename to templates/ui/tooltip/armor.hbs diff --git a/templates/tooltip/beastform.hbs b/templates/ui/tooltip/beastform.hbs similarity index 100% rename from templates/tooltip/beastform.hbs rename to templates/ui/tooltip/beastform.hbs diff --git a/templates/tooltip/domainCard.hbs b/templates/ui/tooltip/domainCard.hbs similarity index 100% rename from templates/tooltip/domainCard.hbs rename to templates/ui/tooltip/domainCard.hbs diff --git a/templates/tooltip/weapon.hbs b/templates/ui/tooltip/weapon.hbs similarity index 100% rename from templates/tooltip/weapon.hbs rename to templates/ui/tooltip/weapon.hbs diff --git a/templates/views/ancestrySelection.hbs b/templates/views/ancestrySelection.hbs deleted file mode 100644 index c6df3a5d..00000000 --- a/templates/views/ancestrySelection.hbs +++ /dev/null @@ -1,72 +0,0 @@ -
    -
    -

    {{localize "Daggerheart Ancestries"}}

    -
    - {{#each systemAncestries}} -
    -
    - -
    -
    -
    {{this.name}}
    -
    -
    - {{/each}} -
    -
    -
    -

    {{localize "Custom Ancestries"}}

    -
    - {{#each customAncestries}} -
    -
    - -
    -
    -
    {{this.name}}
    -
    -
    - {{/each}} - {{#if (eq customAncestries.length 0)}}No Custom Ancestries created in this world{{/if}} -
    -
    -
    -

    {{localize "Ancestry Features"}}

    -
    - {{#each ancestryFeatures}} -
    -
    - -
    -
    -
    {{this.name}}
    -
    -
    - {{/each}} -
    -
    - {{#if (eq this.selectedAncestries.length 2)}} -
    -

    {{localize "Mixed Ancestry"}}

    -
    -
    -
    {{localize "Ancestry Name"}}
    - -
    -
    - {{#each selectedAncestries}} - - {{/each}} -
    - - -
    -
    -
    - -
    - {{/if}} -
    - -
    -
    \ No newline at end of file diff --git a/templates/views/multiclass.hbs b/templates/views/multiclass.hbs deleted file mode 100644 index 843ec808..00000000 --- a/templates/views/multiclass.hbs +++ /dev/null @@ -1,37 +0,0 @@ -
    -
    -

    {{localize "DAGGERHEART.Application.Multiclass.ClassSection.Title"}}

    -
    - {{#each classChoices}} -
    - -
    {{this.name}}
    -
    - {{/each}} -
    -

    {{localize "DAGGERHEART.Application.Multiclass.SubclassSection.Title"}}

    -
    - {{#each subclassChoices}} -
    - -
    {{this.name}}
    -
    - {{/each}} -
    -

    {{localize "DAGGERHEART.Application.Multiclass.DomainSection.Title"}}

    -
    - {{#each domainChoices}} -
    - -
    {{this.name}}
    -
    - {{/each}} -
    -
    - -
    \ No newline at end of file