Merge branch 'development' into feature/1031-Action-Names-In-Chat

This commit is contained in:
WBHarry 2025-08-25 17:44:47 +02:00
commit 907ae5cf34
133 changed files with 1713 additions and 1177 deletions

View file

@ -1,6 +1,6 @@
--- ---
name: Feature report name: Feature request
about: Create a feature report for suggestions on improving the system about: Create a feature request for suggestions on improving the system
title: "[Feature] <Insert Title here> " title: "[Feature] <Insert Title here> "
labels: enhancement, discussion, maybe labels: enhancement, discussion, maybe
type: feature type: feature

View file

@ -13,6 +13,7 @@ import { enrichedDualityRoll } from './module/enrichers/DualityRollEnricher.mjs'
import { registerCountdownHooks } from './module/data/countdowns.mjs'; import { registerCountdownHooks } from './module/data/countdowns.mjs';
import { import {
handlebarsRegistration, handlebarsRegistration,
runMigrations,
settingsRegistration, settingsRegistration,
socketRegistration socketRegistration
} from './module/systemRegistration/_module.mjs'; } from './module/systemRegistration/_module.mjs';
@ -173,6 +174,8 @@ Hooks.on('ready', async () => {
game.user.setFlag(CONFIG.DH.id, CONFIG.DH.FLAGS.userFlags.welcomeMessage, true); game.user.setFlag(CONFIG.DH.id, CONFIG.DH.FLAGS.userFlags.welcomeMessage, true);
} }
} }
runMigrations();
}); });
Hooks.once('dicesoniceready', () => {}); Hooks.once('dicesoniceready', () => {});

View file

@ -72,6 +72,14 @@
"exactHint": "The Character's Tier is used if empty", "exactHint": "The Character's Tier is used if empty",
"label": "Beastform" "label": "Beastform"
}, },
"damage": {
"multiplier": "Multiplier",
"flatMultiplier": "Flat Multiplier"
},
"general": {
"customFormula": "Custom Formula",
"formula": "Formula"
},
"displayInChat": "Display in chat" "displayInChat": "Display in chat"
}, },
"RollField": { "RollField": {
@ -202,7 +210,9 @@
"confirmTitle": "Companion Levelup", "confirmTitle": "Companion Levelup",
"confirmText": "Would you like to level up your companion {name} by {levelChange} levels at this time? (You can do it manually later)" "confirmText": "Would you like to level up your companion {name} by {levelChange} levels at this time? (You can do it manually later)"
}, },
"viewLevelups": "View Levelups" "viewLevelups": "View Levelups",
"InvalidOldCharacterImportTitle": "Old Character Import",
"InvalidOldCharacterImportText": "Character data exported prior to system version 1.1 will not generate a complete character. Do you wish to continue?"
}, },
"Companion": { "Companion": {
"FIELDS": { "FIELDS": {
@ -1898,7 +1908,8 @@
"tier4": "tier 4", "tier4": "tier 4",
"domains": "Domains", "domains": "Domains",
"downtime": "Downtime", "downtime": "Downtime",
"rules": "Rules" "rules": "Rules",
"types": "Types"
}, },
"Tiers": { "Tiers": {
"singular": "Tier", "singular": "Tier",
@ -1915,6 +1926,7 @@
"amount": "Amount", "amount": "Amount",
"any": "Any", "any": "Any",
"armor": "Armor", "armor": "Armor",
"armors": "Armors",
"armorScore": "Armor Score", "armorScore": "Armor Score",
"activeEffects": "Active Effects", "activeEffects": "Active Effects",
"armorSlots": "Armor Slots", "armorSlots": "Armor Slots",
@ -1926,6 +1938,7 @@
"continue": "Continue", "continue": "Continue",
"criticalSuccess": "Critical Success", "criticalSuccess": "Critical Success",
"criticalShort": "Critical", "criticalShort": "Critical",
"custom": "Custom",
"d20Roll": "D20 Roll", "d20Roll": "D20 Roll",
"damage": "Damage", "damage": "Damage",
"damageRoll": "Damage Roll", "damageRoll": "Damage Roll",
@ -1966,6 +1979,7 @@
"inactiveEffects": "Inactive Effects", "inactiveEffects": "Inactive Effects",
"inventory": "Inventory", "inventory": "Inventory",
"itemResource": "Item Resource", "itemResource": "Item Resource",
"items": "Items",
"label": "Label", "label": "Label",
"level": "Level", "level": "Level",
"levelShort": "Lv", "levelShort": "Lv",
@ -1977,6 +1991,7 @@
"plural": "Miss" "plural": "Miss"
}, },
"maxWithThing": "Max {thing}", "maxWithThing": "Max {thing}",
"missingDragDropThing": "Drop {thing} here",
"multiclass": "Multiclass", "multiclass": "Multiclass",
"newCategory": "New Category", "newCategory": "New Category",
"none": "None", "none": "None",
@ -1998,6 +2013,7 @@
"scalable": "Scalable", "scalable": "Scalable",
"situationalBonus": "Situational Bonus", "situationalBonus": "Situational Bonus",
"stress": "Stress", "stress": "Stress",
"subclasses": "Subclasses",
"success": "Success", "success": "Success",
"take": "Take", "take": "Take",
"Target": { "Target": {
@ -2015,6 +2031,7 @@
"used": "Used", "used": "Used",
"uses": "Uses", "uses": "Uses",
"value": "Value", "value": "Value",
"weapons": "Weapons",
"withThing": "With {thing}" "withThing": "With {thing}"
}, },
"ITEMS": { "ITEMS": {
@ -2228,6 +2245,10 @@
"deleteDomain": "Delete Domain", "deleteDomain": "Delete Domain",
"deleteDomainText": "Are you sure you want to delete the {name} domain? It will be immediately removed from all Actors in this world where it's currently used. Compendiums are not cleared.", "deleteDomainText": "Are you sure you want to delete the {name} domain? It will be immediately removed from all Actors in this world where it's currently used. Compendiums are not cleared.",
"duplicateDomain": "There is already a domain with this identification." "duplicateDomain": "There is already a domain with this identification."
},
"adversaryType": {
"title": "Custom Adversary Types",
"newType": "Adversary Type"
} }
}, },
"Menu": { "Menu": {
@ -2345,6 +2366,42 @@
"playerMessage": "{user} rerolled their {name}" "playerMessage": "{user} rerolled their {name}"
} }
}, },
"ItemBrowser": {
"title": "Daggerheart Compendium Browser",
"hint": "Select a Folder in sidebar to start browsing through the compendium",
"searchPlaceholder": "Search...",
"columnName": "Name",
"tooltipFilters": "Filters",
"tooltipErase": "Erase",
"difficultyMin": "Difficulty (Min)",
"difficultyMax": "Difficulty (Max)",
"hitPointsMin": "Hit Points (Min)",
"hitPointsMax": "Hit Points (Max)",
"stressMin": "Stress (Min)",
"stressMax": "Stress (Max)",
"armorScoreMin": "Armor Score (Min)",
"armorScoreMax": "Armor Score (Max)",
"levelMin": "Level (Min)",
"levelMax": "Level (Max)",
"recallCostMin": "Recall Cost (Min)",
"recallCostMax": "Recall Cost (Max)",
"evasionMin": "Evasion (Min)",
"evasionMax": "Evasion (Max)",
"subtype": "Subtype",
"folders": {
"adversaries": "Adversaries",
"ancestries": "Ancestries",
"equipment": "Equipment",
"classes": "Classes",
"subclasses": "Subclasses",
"domainCards": "Domain Cards",
"communities": "Communities",
"environments": "Environments",
"beastforms": "Beastforms",
"features": "Features",
"items": "Items"
}
},
"Notifications": { "Notifications": {
"adversaryMissing": "The linked adversary doesn't exist in the world.", "adversaryMissing": "The linked adversary doesn't exist in the world.",
"beastformInapplicable": "A beastform can only be applied to a Character.", "beastformInapplicable": "A beastform can only be applied to a Character.",
@ -2404,10 +2461,12 @@
"beastformEquipWeapon": "You cannot use weapons while in a Beastform.", "beastformEquipWeapon": "You cannot use weapons while in a Beastform.",
"loadoutMaxReached": "You've reached maximum loadout. Move atleast one domain card to the vault, or increase the limit in homebrew settings if desired.", "loadoutMaxReached": "You've reached maximum loadout. Move atleast one domain card to the vault, or increase the limit in homebrew settings if desired.",
"domainMaxReached": "You've reached the maximum domains for the class. Increase the limit in homebrew settings if desired.", "domainMaxReached": "You've reached the maximum domains for the class. Increase the limit in homebrew settings if desired.",
"insufficientResources": "You have insufficient resources", "insufficientResources": "You don't have enough resources to use that action.",
"actionNoUsesRemaining": "That action doesn't have remaining uses.",
"multiclassAlreadyPresent": "You already have a class and multiclass", "multiclassAlreadyPresent": "You already have a class and multiclass",
"subclassesAlreadyPresent": "You already have a class and multiclass subclass", "subclassesAlreadyPresent": "You already have a class and multiclass subclass",
"noDiceSystem": "Your selected dice {system} does not have a {faces} dice" "noDiceSystem": "Your selected dice {system} does not have a {faces} dice",
"subclassAlreadyLinked": "{name} is already a subclass in the class {class}. Remove it from there if you want it to be a subclass to this class."
}, },
"Tooltip": { "Tooltip": {
"disableEffect": "Disable Effect", "disableEffect": "Disable Effect",

View file

@ -432,12 +432,17 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl
} }
}; };
if (type == 'domains') if (type === 'domains')
presets.filter = { presets.filter = {
'level.max': { key: 'level.max', value: 1 }, 'level.max': { key: 'level.max', value: 1 },
'system.domain': { key: 'system.domain', value: this.setup.class?.system.domains ?? null } 'system.domain': { key: 'system.domain', value: this.setup.class?.system.domains ?? null }
}; };
if (type === 'subclasses')
presets.filter = {
'system.linkedClass.uuid': { key: 'system.linkedClass.uuid', value: this.setup.class?.uuid }
};
if (equipment.includes(type)) if (equipment.includes(type))
presets.filter = { presets.filter = {
'system.tier': { key: 'system.tier', value: 1 }, 'system.tier': { key: 'system.tier', value: 1 },

View file

@ -1,6 +1,9 @@
export default class DHTokenHUD extends foundry.applications.hud.TokenHUD { export default class DHTokenHUD extends foundry.applications.hud.TokenHUD {
static DEFAULT_OPTIONS = { static DEFAULT_OPTIONS = {
classes: ['daggerheart'] classes: ['daggerheart'],
actions: {
combat: DHTokenHUD.#onToggleCombat
}
}; };
/** @override */ /** @override */
@ -11,8 +14,14 @@ export default class DHTokenHUD extends foundry.applications.hud.TokenHUD {
} }
}; };
static #nonCombatTypes = ['environment', 'companion'];
async _prepareContext(options) { async _prepareContext(options) {
const context = await super._prepareContext(options); const context = await super._prepareContext(options);
context.canToggleCombat = DHTokenHUD.#nonCombatTypes.includes(this.actor.type)
? false
: context.canToggleCombat;
context.systemStatusEffects = Object.keys(context.statusEffects).reduce((acc, key) => { context.systemStatusEffects = Object.keys(context.statusEffects).reduce((acc, key) => {
const effect = context.statusEffects[key]; const effect = context.statusEffects[key];
if (effect.systemEffect) acc[key] = effect; if (effect.systemEffect) acc[key] = effect;
@ -36,6 +45,20 @@ export default class DHTokenHUD extends foundry.applications.hud.TokenHUD {
return context; return context;
} }
static async #onToggleCombat() {
const tokens = canvas.tokens.controlled
.filter(t => !t.actor || !DHTokenHUD.#nonCombatTypes.includes(t.actor.type))
.map(t => t.document);
if (!this.object.controlled) tokens.push(this.document);
try {
if (this.document.inCombat) await TokenDocument.implementation.deleteCombatants(tokens);
else await TokenDocument.implementation.createCombatants(tokens);
} catch (err) {
ui.notifications.warn(err.message);
}
}
_getStatusEffectChoices() { _getStatusEffectChoices() {
// Include all HUD-enabled status effects // Include all HUD-enabled status effects
const choices = {}; const choices = {};

View file

@ -1,5 +1,6 @@
import { DhHomebrew } from '../../data/settings/_module.mjs'; import { DhHomebrew } from '../../data/settings/_module.mjs';
import { slugify } from '../../helpers/utils.mjs'; import { slugify } from '../../helpers/utils.mjs';
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api; const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
export default class DhHomebrewSettings extends HandlebarsApplicationMixin(ApplicationV2) { export default class DhHomebrewSettings extends HandlebarsApplicationMixin(ApplicationV2) {
@ -10,11 +11,14 @@ export default class DhHomebrewSettings extends HandlebarsApplicationMixin(Appli
game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).toObject() game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).toObject()
); );
this.selected = { this.selected = this.#getDefaultAdversaryType();
domain: null
};
} }
#getDefaultAdversaryType = () => ({
domain: null,
adversaryType: null
});
get title() { get title() {
return game.i18n.localize('DAGGERHEART.SETTINGS.Menu.title'); return game.i18n.localize('DAGGERHEART.SETTINGS.Menu.title');
} }
@ -35,6 +39,9 @@ export default class DhHomebrewSettings extends HandlebarsApplicationMixin(Appli
addDomain: this.addDomain, addDomain: this.addDomain,
toggleSelectedDomain: this.toggleSelectedDomain, toggleSelectedDomain: this.toggleSelectedDomain,
deleteDomain: this.deleteDomain, deleteDomain: this.deleteDomain,
addAdversaryType: this.addAdversaryType,
deleteAdversaryType: this.deleteAdversaryType,
selectAdversaryType: this.selectAdversaryType,
save: this.save, save: this.save,
reset: this.reset reset: this.reset
}, },
@ -45,6 +52,7 @@ export default class DhHomebrewSettings extends HandlebarsApplicationMixin(Appli
tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' }, tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' },
settings: { template: 'systems/daggerheart/templates/settings/homebrew-settings/settings.hbs' }, settings: { template: 'systems/daggerheart/templates/settings/homebrew-settings/settings.hbs' },
domains: { template: 'systems/daggerheart/templates/settings/homebrew-settings/domains.hbs' }, domains: { template: 'systems/daggerheart/templates/settings/homebrew-settings/domains.hbs' },
types: { template: 'systems/daggerheart/templates/settings/homebrew-settings/types.hbs' },
downtime: { template: 'systems/daggerheart/templates/settings/homebrew-settings/downtime.hbs' }, downtime: { template: 'systems/daggerheart/templates/settings/homebrew-settings/downtime.hbs' },
footer: { template: 'systems/daggerheart/templates/settings/homebrew-settings/footer.hbs' } footer: { template: 'systems/daggerheart/templates/settings/homebrew-settings/footer.hbs' }
}; };
@ -52,12 +60,19 @@ export default class DhHomebrewSettings extends HandlebarsApplicationMixin(Appli
/** @inheritdoc */ /** @inheritdoc */
static TABS = { static TABS = {
main: { main: {
tabs: [{ id: 'settings' }, { id: 'domains' }, { id: 'downtime' }], tabs: [{ id: 'settings' }, { id: 'domains' }, { id: 'types' }, { id: 'downtime' }],
initial: 'settings', initial: 'settings',
labelPrefix: 'DAGGERHEART.GENERAL.Tabs' labelPrefix: 'DAGGERHEART.GENERAL.Tabs'
} }
}; };
changeTab(tab, group, options) {
super.changeTab(tab, group, options);
this.selected = this.#getDefaultAdversaryType();
this.render();
}
async _prepareContext(_options) { async _prepareContext(_options) {
const context = await super._prepareContext(_options); const context = await super._prepareContext(_options);
context.settingFields = this.settings; context.settingFields = this.settings;
@ -79,6 +94,11 @@ export default class DhHomebrewSettings extends HandlebarsApplicationMixin(Appli
context.configDomains = CONFIG.DH.DOMAIN.domains; context.configDomains = CONFIG.DH.DOMAIN.domains;
context.homebrewDomains = this.settings.domains; context.homebrewDomains = this.settings.domains;
break; break;
case 'types':
context.selectedAdversaryType = this.selected.adversaryType
? { id: this.selected.adversaryType, ...this.settings.adversaryTypes[this.selected.adversaryType] }
: null;
break;
} }
return context; return context;
@ -301,6 +321,32 @@ export default class DhHomebrewSettings extends HandlebarsApplicationMixin(Appli
this.render(); this.render();
} }
static async addAdversaryType(_, target) {
const newId = foundry.utils.randomID();
await this.settings.updateSource({
[`adversaryTypes.${newId}`]: {
id: newId,
label: game.i18n.localize('DAGGERHEART.SETTINGS.Homebrew.adversaryType.newType')
}
});
this.selected.adversaryType = newId;
this.render();
}
static async deleteAdversaryType(_, target) {
const { key } = target.dataset;
await this.settings.updateSource({ [`adversaryTypes.-=${key}`]: null });
this.selected.adversaryType = this.selected.adversaryType === key ? null : this.selected.adversaryType;
this.render();
}
static async selectAdversaryType(_, target) {
this.selected.adversaryType = this.selected.adversaryType === target.dataset.type ? null : target.dataset.type;
this.render();
}
static async save() { static async save() {
await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew, this.settings.toObject()); await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew, this.settings.toObject());
this.close(); this.close();

View file

@ -56,6 +56,7 @@ export default class AdversarySheet extends DHBaseActorSheet {
async _prepareContext(options) { async _prepareContext(options) {
const context = await super._prepareContext(options); const context = await super._prepareContext(options);
context.systemFields.attack.fields = this.document.system.attack.schema.fields; context.systemFields.attack.fields = this.document.system.attack.schema.fields;
return context; return context;
} }
@ -65,6 +66,9 @@ export default class AdversarySheet extends DHBaseActorSheet {
switch (partId) { switch (partId) {
case 'header': case 'header':
await this._prepareHeaderContext(context, options); await this._prepareHeaderContext(context, options);
const adversaryTypes = CONFIG.DH.ACTOR.allAdversaryTypes();
context.adversaryType = game.i18n.localize(adversaryTypes[this.document.system.type].label);
break; break;
case 'notes': case 'notes':
await this._prepareNotesContext(context, options); await this._prepareNotesContext(context, options);

View file

@ -15,6 +15,8 @@ export default class CharacterSheet extends DHBaseActorSheet {
static DEFAULT_OPTIONS = { static DEFAULT_OPTIONS = {
classes: ['character'], classes: ['character'],
position: { width: 850, height: 800 }, position: { width: 850, height: 800 },
/* Foundry adds disabled to all buttons and inputs if editPermission is missing. This is not desired. */
editPermission: CONST.DOCUMENT_OWNERSHIP_LEVELS.OBSERVER,
actions: { actions: {
toggleVault: CharacterSheet.#toggleVault, toggleVault: CharacterSheet.#toggleVault,
rollAttribute: CharacterSheet.#rollAttribute, rollAttribute: CharacterSheet.#rollAttribute,
@ -148,6 +150,13 @@ export default class CharacterSheet extends DHBaseActorSheet {
.querySelector('.level-value') .querySelector('.level-value')
?.addEventListener('change', event => this.document.updateLevel(Number(event.currentTarget.value))); ?.addEventListener('change', event => this.document.updateLevel(Number(event.currentTarget.value)));
const observer = this.document.testUserPermission(game.user, CONST.DOCUMENT_OWNERSHIP_LEVELS.OBSERVER, {
exact: true
});
if (observer) {
this.element.querySelector('.window-content').classList.add('viewMode');
}
this._createFilterMenus(); this._createFilterMenus();
this._createSearchFilter(); this._createSearchFilter();
} }

View file

@ -8,6 +8,7 @@ export default class DhCompanionSheet extends DHBaseActorSheet {
classes: ['actor', 'companion'], classes: ['actor', 'companion'],
position: { width: 340 }, position: { width: 340 },
actions: { actions: {
actionRoll: DhCompanionSheet.#actionRoll,
levelManagement: DhCompanionSheet.#levelManagement levelManagement: DhCompanionSheet.#levelManagement
} }
}; };
@ -45,6 +46,52 @@ export default class DhCompanionSheet extends DHBaseActorSheet {
/* Application Clicks Actions */ /* Application Clicks Actions */
/* -------------------------------------------- */ /* -------------------------------------------- */
/**
*
*/
static async #actionRoll(event) {
const partner = this.actor.system.partner;
const config = {
event,
title: `${game.i18n.localize('DAGGERHEART.GENERAL.Roll.action')}: ${this.actor.name}`,
headerTitle: `Companion ${game.i18n.localize('DAGGERHEART.GENERAL.Roll.action')}`,
roll: {
trait: partner.system.spellcastModifierTrait?.key
},
hasRoll: true,
data: partner.getRollData()
};
const result = await partner.diceRoll(config);
this.consumeResource(result?.costs);
}
// Remove when Action Refactor part #2 done
async consumeResource(costs) {
if (!costs?.length) return;
const partner = this.actor.system.partner;
const usefulResources = {
...foundry.utils.deepClone(partner.system.resources),
fear: {
value: game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Resources.Fear),
max: game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).maxFear,
reversed: false
}
};
const resources = game.system.api.fields.ActionFields.CostField.getRealCosts(costs).map(c => {
const resource = usefulResources[c.key];
return {
key: c.key,
value: (c.total ?? c.value) * (resource.isReversed ? 1 : -1),
target: resource.target,
keyIsID: resource.keyIsID
};
});
await partner.modifyResource(resources);
}
/** /**
* Opens the companions level management window. * Opens the companions level management window.
* @type {ApplicationClickAction} * @type {ApplicationClickAction}

View file

@ -639,7 +639,6 @@ export default function DHApplicationMixin(Base) {
if (featureOnCharacter) { if (featureOnCharacter) {
systemData = { systemData = {
originItemType: this.document.type, originItemType: this.document.type,
originId: this.document.id,
identifier: this.document.system.isMulticlass ? 'multiclass' : null identifier: this.document.system.isMulticlass ? 'multiclass' : null
}; };
} }

View file

@ -167,12 +167,12 @@ export default class DHBaseItemSheet extends DHApplicationMixin(ItemSheetV2) {
const { type } = target.dataset; const { type } = target.dataset;
const cls = foundry.documents.Item.implementation; const cls = foundry.documents.Item.implementation;
const multiclass = this.document.system.isMulticlass ? 'multiclass' : null;
let systemData = {}; let systemData = {};
if (this.document.parent?.type === 'character') { if (this.document.parent?.type === 'character') {
systemData = { systemData = {
originItemType: this.document.type, originItemType: this.document.type,
originId: this.document.id, identifier: multiclass ?? type
identifier: this.document.system.isMulticlass ? 'multiclass' : null
}; };
} }
@ -293,14 +293,15 @@ export default class DHBaseItemSheet extends DHApplicationMixin(ItemSheetV2) {
if (this.document.parent?.type === 'character') { if (this.document.parent?.type === 'character') {
const itemData = item.toObject(); const itemData = item.toObject();
const multiclass = this.document.system.isMulticlass ? 'multiclass' : null;
item = await cls.create( item = await cls.create(
{ {
...itemData, ...itemData,
_stats: { compendiumSource: this.document.uuid },
system: { system: {
...itemData.system, ...itemData.system,
originItemType: this.document.type, originItemType: this.document.type,
originId: this.document.id, identifier: multiclass ?? target.dataset.type
identifier: this.document.system.isMulticlass ? 'multiclass' : null
} }
}, },
{ parent: this.document.parent } { parent: this.document.parent }

View file

@ -119,6 +119,15 @@ export default class ClassSheet extends DHBaseItemSheet {
const itemType = data.data ? data.type : item.type; const itemType = data.data ? data.type : item.type;
const target = event.target.closest('fieldset.drop-section'); const target = event.target.closest('fieldset.drop-section');
if (itemType === 'subclass') { if (itemType === 'subclass') {
if (item.system.linkedClass) {
return ui.notifications.warn(
game.i18n.format('DAGGERHEART.UI.Notifications.subclassAlreadyLinked', {
name: item.name,
class: this.document.name
})
);
}
await item.update({ 'system.linkedClass': this.document.uuid });
await this.document.update({ await this.document.update({
'system.subclasses': [...this.document.system.subclasses.map(x => x.uuid), item.uuid] 'system.subclasses': [...this.document.system.subclasses.map(x => x.uuid), item.uuid]
}); });
@ -181,6 +190,12 @@ export default class ClassSheet extends DHBaseItemSheet {
static async #removeItemFromCollection(_event, element) { static async #removeItemFromCollection(_event, element) {
const { uuid, target } = element.dataset; const { uuid, target } = element.dataset;
const prop = foundry.utils.getProperty(this.document.system, target); const prop = foundry.utils.getProperty(this.document.system, target);
if (target === 'subclasses') {
const subclass = await foundry.utils.fromUuid(uuid);
await subclass.update({ 'system.linkedClass': null });
}
await this.document.update({ [`system.${target}`]: prop.filter(i => i.uuid !== uuid).map(x => x.uuid) }); await this.document.update({ [`system.${target}`]: prop.filter(i => i.uuid !== uuid).map(x => x.uuid) });
} }

View file

@ -124,11 +124,11 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) {
_attachPartListeners(partId, htmlElement, options) { _attachPartListeners(partId, htmlElement, options) {
super._attachPartListeners(partId, htmlElement, options); super._attachPartListeners(partId, htmlElement, options);
htmlElement htmlElement.querySelectorAll('[data-action="selectFolder"]').forEach(element =>
.querySelectorAll('[data-action="selectFolder"]') element.addEventListener('contextmenu', event => {
.forEach(element => element.addEventListener("contextmenu", (event) => {
event.target.classList.toggle('expanded'); event.target.classList.toggle('expanded');
})) })
);
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -154,7 +154,7 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) {
Object.values(config).forEach(c => { Object.values(config).forEach(c => {
const folder = { const folder = {
id: c.id, id: c.id,
label: c.label, label: game.i18n.localize(c.label),
selected: (!parent || parent.selected) && this.selectedMenu.path[depth] === c.id selected: (!parent || parent.selected) && this.selectedMenu.path[depth] === c.id
}; };
folder.folders = c.folders folder.folders = c.folders
@ -173,11 +173,16 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) {
folderPath = `${compendium}.folders.${folderId}`, folderPath = `${compendium}.folders.${folderId}`,
folderData = foundry.utils.getProperty(config, folderPath); folderData = foundry.utils.getProperty(config, folderPath);
const columns = ItemBrowser.getFolderConfig(folderData).map(col => ({
...col,
label: game.i18n.localize(col.label)
}));
this.selectedMenu = { this.selectedMenu = {
path: folderPath.split('.'), path: folderPath.split('.'),
data: { data: {
...folderData, ...folderData,
columns: ItemBrowser.getFolderConfig(folderData) columns: columns
} }
}; };
@ -190,8 +195,11 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) {
this.items = ItemBrowser.sortBy(items, 'name'); this.items = ItemBrowser.sortBy(items, 'name');
if(target) { if (target) {
target.closest('.compendium-sidebar').querySelectorAll('[data-action="selectFolder"]').forEach(element => element.classList.remove("is-selected")) target
.closest('.compendium-sidebar')
.querySelectorAll('[data-action="selectFolder"]')
.forEach(element => element.classList.remove('is-selected'));
target.classList.add('is-selected'); target.classList.add('is-selected');
} }
@ -199,7 +207,7 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) {
} }
_replaceHTML(result, content, options) { _replaceHTML(result, content, options) {
if(!options.isFirstRender) delete result.sidebar; if (!options.isFirstRender) delete result.sidebar;
super._replaceHTML(result, content, options); super._replaceHTML(result, content, options);
} }
@ -235,8 +243,14 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) {
filters.forEach(f => { filters.forEach(f => {
if (typeof f.field === 'string') f.field = foundry.utils.getProperty(game, f.field); if (typeof f.field === 'string') f.field = foundry.utils.getProperty(game, f.field);
else if (typeof f.choices === 'function') { else if (typeof f.choices === 'function') {
f.choices = f.choices(); f.choices = f.choices(this.items);
} }
// Clear field label so template uses our custom label parameter
if (f.field && f.label) {
f.field.label = undefined;
}
f.name ??= f.key; f.name ??= f.key;
f.value = this.presets?.filter?.[f.name]?.value ?? null; f.value = this.presets?.filter?.[f.name]?.value ?? null;
}); });
@ -248,11 +262,8 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) {
/* -------------------------------------------- */ /* -------------------------------------------- */
/** /**
* Create and initialize search filter instances for the inventory and loadout sections. * Create and initialize search filter instance.
* *
* Sets up two {@link foundry.applications.ux.SearchFilter} instances:
* - One for the inventory, which filters items in the inventory grid.
* - One for the loadout, which filters items in the loadout/card grid.
* @private * @private
*/ */
_createSearchFilter() { _createSearchFilter() {

View file

@ -10,38 +10,38 @@ export default class DhMeasuredTemplate extends foundry.canvas.placeables.Measur
const splitRulerText = this.ruler.text.split(' '); const splitRulerText = this.ruler.text.split(' ');
if (splitRulerText.length > 0) { if (splitRulerText.length > 0) {
const rulerValue = Number(splitRulerText[0]); const rulerValue = Number(splitRulerText[0]);
const result = this.constructor.getRangeLabels(rulerValue, rangeMeasurementSettings); const result = DhMeasuredTemplate.getRangeLabels(rulerValue, rangeMeasurementSettings);
this.ruler.text = result.distance + result.units ? (' ' + result.units) : ''; this.ruler.text = result.distance + (result.units ? ' ' + result.units : '');
} }
} }
} }
static getRangeLabels(distance, settings) { static getRangeLabels(distanceValue, settings) {
let result = { distance: '', units: null } let result = { distance: distanceValue, units: '' };
const rangeMeasurementOverride = canvas.scene.flags.daggerheart?.rangeMeasurementOverride; const rangeMeasurementOverride = canvas.scene.flags.daggerheart?.rangeMeasurementOverride;
if (rangeMeasurementOverride === true) { if (rangeMeasurementOverride === true) {
result.distance = distance; result.distance = distanceValue;
result.units = canvas.scene?.grid?.units; result.units = canvas.scene?.grid?.units;
return result return result;
} }
if (distance <= settings.melee) { if (distanceValue <= settings.melee) {
result.distance = game.i18n.localize('DAGGERHEART.CONFIG.Range.melee.name'); result.distance = game.i18n.localize('DAGGERHEART.CONFIG.Range.melee.name');
return result; return result;
} }
if (distance <= settings.veryClose) { if (distanceValue <= settings.veryClose) {
result.distance = game.i18n.localize('DAGGERHEART.CONFIG.Range.veryClose.name'); result.distance = game.i18n.localize('DAGGERHEART.CONFIG.Range.veryClose.name');
return result; return result;
} }
if (distance <= settings.close) { if (distanceValue <= settings.close) {
result.distance = game.i18n.localize('DAGGERHEART.CONFIG.Range.close.name'); result.distance = game.i18n.localize('DAGGERHEART.CONFIG.Range.close.name');
return result; return result;
} }
if (distance <= settings.far) { if (distanceValue <= settings.far) {
result.distance = game.i18n.localize('DAGGERHEART.CONFIG.Range.far.name'); result.distance = game.i18n.localize('DAGGERHEART.CONFIG.Range.far.name');
return result; return result;
} }
if (distance > settings.far) { if (distanceValue > settings.far) {
result.distance = game.i18n.localize('DAGGERHEART.CONFIG.Range.veryFar.name'); result.distance = game.i18n.localize('DAGGERHEART.CONFIG.Range.veryFar.name');
} }

View file

@ -157,6 +157,11 @@ export const adversaryTypes = {
} }
}; };
export const allAdversaryTypes = () => ({
...adversaryTypes,
...game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).adversaryTypes
});
export const environmentTypes = { export const environmentTypes = {
exploration: { exploration: {
label: 'DAGGERHEART.CONFIG.EnvironmentType.exploration.label', label: 'DAGGERHEART.CONFIG.EnvironmentType.exploration.label',

View file

@ -2,270 +2,278 @@ export const typeConfig = {
adversaries: { adversaries: {
columns: [ columns: [
{ {
key: "system.tier", key: 'system.tier',
label: "Tier" label: 'DAGGERHEART.GENERAL.Tiers.singular'
}, },
{ {
key: "system.type", key: 'system.type',
label: "Type" label: 'DAGGERHEART.GENERAL.type'
} }
], ],
filters: [ filters: [
{ {
key: "system.tier", key: 'system.tier',
label: "Tier", label: 'DAGGERHEART.GENERAL.Tiers.singular',
field: 'system.api.models.actors.DhAdversary.schema.fields.tier' field: 'system.api.models.actors.DhAdversary.schema.fields.tier'
}, },
{ {
key: "system.type", key: 'system.type',
label: "Type", label: 'DAGGERHEART.GENERAL.type',
field: 'system.api.models.actors.DhAdversary.schema.fields.type' field: 'system.api.models.actors.DhAdversary.schema.fields.type'
}, },
{ {
key: "system.difficulty", key: 'system.difficulty',
name: "difficulty.min", name: 'difficulty.min',
label: "Difficulty (Min)", label: 'DAGGERHEART.UI.ItemBrowser.difficultyMin',
field: 'system.api.models.actors.DhAdversary.schema.fields.difficulty', field: 'system.api.models.actors.DhAdversary.schema.fields.difficulty',
operator: "gte" operator: 'gte'
}, },
{ {
key: "system.difficulty", key: 'system.difficulty',
name: "difficulty.max", name: 'difficulty.max',
label: "Difficulty (Max)", label: 'DAGGERHEART.UI.ItemBrowser.difficultyMax',
field: 'system.api.models.actors.DhAdversary.schema.fields.difficulty', field: 'system.api.models.actors.DhAdversary.schema.fields.difficulty',
operator: "lte" operator: 'lte'
}, },
{ {
key: "system.resources.hitPoints.max", key: 'system.resources.hitPoints.max',
name: "hp.min", name: 'hp.min',
label: "Hit Points (Min)", label: 'DAGGERHEART.UI.ItemBrowser.hitPointsMin',
field: 'system.api.models.actors.DhAdversary.schema.fields.resources.fields.hitPoints.fields.max', field: 'system.api.models.actors.DhAdversary.schema.fields.resources.fields.hitPoints.fields.max',
operator: "gte" operator: 'gte'
}, },
{ {
key: "system.resources.hitPoints.max", key: 'system.resources.hitPoints.max',
name: "hp.max", name: 'hp.max',
label: "Hit Points (Max)", label: 'DAGGERHEART.UI.ItemBrowser.hitPointsMax',
field: 'system.api.models.actors.DhAdversary.schema.fields.resources.fields.hitPoints.fields.max', field: 'system.api.models.actors.DhAdversary.schema.fields.resources.fields.hitPoints.fields.max',
operator: "lte" operator: 'lte'
}, },
{ {
key: "system.resources.stress.max", key: 'system.resources.stress.max',
name: "stress.min", name: 'stress.min',
label: "Stress (Min)", label: 'DAGGERHEART.UI.ItemBrowser.stressMin',
field: 'system.api.models.actors.DhAdversary.schema.fields.resources.fields.stress.fields.max', field: 'system.api.models.actors.DhAdversary.schema.fields.resources.fields.stress.fields.max',
operator: "gte" operator: 'gte'
}, },
{ {
key: "system.resources.stress.max", key: 'system.resources.stress.max',
name: "stress.max", name: 'stress.max',
label: "Stress (Max)", label: 'DAGGERHEART.UI.ItemBrowser.stressMax',
field: 'system.api.models.actors.DhAdversary.schema.fields.resources.fields.stress.fields.max', field: 'system.api.models.actors.DhAdversary.schema.fields.resources.fields.stress.fields.max',
operator: "lte" operator: 'lte'
}, }
] ]
}, },
items: { items: {
columns: [ columns: [
{ {
key: "type", key: 'type',
label: "Type" label: 'DAGGERHEART.GENERAL.type'
}, },
{ {
key: "system.secondary", key: 'system.secondary',
label: "Subtype", label: 'DAGGERHEART.UI.ItemBrowser.subtype',
format: (isSecondary) => isSecondary ? "secondary" : (isSecondary === false ? "primary" : '-') format: isSecondary => (isSecondary ? 'secondary' : isSecondary === false ? 'primary' : '-')
}, },
{ {
key: "system.tier", key: 'system.tier',
label: "Tier" label: 'DAGGERHEART.GENERAL.Tiers.singular'
} }
], ],
filters: [ filters: [
{ {
key: "type", key: 'type',
label: "Type", label: 'DAGGERHEART.GENERAL.type',
choices: () => CONFIG.Item.documentClass.TYPES.filter(t => ["armor", "weapon", "consumable", "loot"].includes(t)).map(t => ({ value: t, label: t })) choices: () =>
CONFIG.Item.documentClass.TYPES.filter(t =>
['armor', 'weapon', 'consumable', 'loot'].includes(t)
).map(t => ({ value: t, label: t }))
}, },
{ {
key: "system.secondary", key: 'system.secondary',
label: "Subtype", label: 'DAGGERHEART.UI.ItemBrowser.subtype',
choices: [ choices: [
{ value: false, label: "Primary Weapon"}, { value: false, label: 'DAGGERHEART.ITEMS.Weapon.primaryWeapon' },
{ value: true, label: "Secondary Weapon"} { value: true, label: 'DAGGERHEART.ITEMS.Weapon.secondaryWeapon' }
] ]
}, },
{ {
key: "system.tier", key: 'system.tier',
label: "Tier", label: 'DAGGERHEART.GENERAL.Tiers.singular',
choices: [{ value: "1", label: "1"}, { value: "2", label: "2"}, { value: "3", label: "3"}, { value: "4", label: "4"}] choices: [
{ value: '1', label: '1' },
{ value: '2', label: '2' },
{ value: '3', label: '3' },
{ value: '4', label: '4' }
]
}, },
{ {
key: "system.burden", key: 'system.burden',
label: "Burden", label: 'DAGGERHEART.GENERAL.burden',
field: 'system.api.models.items.DHWeapon.schema.fields.burden' field: 'system.api.models.items.DHWeapon.schema.fields.burden'
}, },
{ {
key: "system.attack.roll.trait", key: 'system.attack.roll.trait',
label: "Trait", label: 'DAGGERHEART.GENERAL.Trait.single',
field: 'system.api.models.actions.actionsTypes.attack.schema.fields.roll.fields.trait' field: 'system.api.models.actions.actionsTypes.attack.schema.fields.roll.fields.trait'
}, },
{ {
key: "system.attack.range", key: 'system.attack.range',
label: "Range", label: 'DAGGERHEART.GENERAL.range',
field: 'system.api.models.actions.actionsTypes.attack.schema.fields.range' field: 'system.api.models.actions.actionsTypes.attack.schema.fields.range'
}, },
{ {
key: "system.baseScore", key: 'system.baseScore',
name: "armor.min", name: 'armor.min',
label: "Armor Score (Min)", label: 'DAGGERHEART.UI.ItemBrowser.armorScoreMin',
field: 'system.api.models.items.DHArmor.schema.fields.baseScore', field: 'system.api.models.items.DHArmor.schema.fields.baseScore',
operator: "gte" operator: 'gte'
}, },
{ {
key: "system.baseScore", key: 'system.baseScore',
name: "armor.max", name: 'armor.max',
label: "Armor Score (Max)", label: 'DAGGERHEART.UI.ItemBrowser.armorScoreMax',
field: 'system.api.models.items.DHArmor.schema.fields.baseScore', field: 'system.api.models.items.DHArmor.schema.fields.baseScore',
operator: "lte" operator: 'lte'
}, },
{ {
key: "system.itemFeatures", key: 'system.itemFeatures',
label: "Features", label: 'DAGGERHEART.GENERAL.features',
choices: () => [...Object.entries(CONFIG.DH.ITEM.weaponFeatures), ...Object.entries(CONFIG.DH.ITEM.armorFeatures)].map(([k,v]) => ({ value: k, label: v.label})), choices: () =>
operator: "contains3" [
...Object.entries(CONFIG.DH.ITEM.weaponFeatures),
...Object.entries(CONFIG.DH.ITEM.armorFeatures)
].map(([k, v]) => ({ value: k, label: v.label })),
operator: 'contains3'
} }
] ]
}, },
features: { features: {
columns: [ columns: [],
filters: []
],
filters: [
]
}, },
cards: { cards: {
columns: [ columns: [
{ {
key: "system.type", key: 'system.type',
label: "Type" label: 'DAGGERHEART.GENERAL.type'
}, },
{ {
key: "system.domain", key: 'system.domain',
label: "Domain" label: 'DAGGERHEART.GENERAL.Domain.single'
}, },
{ {
key: "system.level", key: 'system.level',
label: "Level" label: 'DAGGERHEART.GENERAL.level'
} }
], ],
filters: [ filters: [
{ {
key: "system.type", key: 'system.type',
label: "Type", label: 'DAGGERHEART.GENERAL.type',
field: 'system.api.models.items.DHDomainCard.schema.fields.type' field: 'system.api.models.items.DHDomainCard.schema.fields.type'
}, },
{ {
key: "system.domain", key: 'system.domain',
label: "Domain", label: 'DAGGERHEART.GENERAL.Domain.single',
field: 'system.api.models.items.DHDomainCard.schema.fields.domain', field: 'system.api.models.items.DHDomainCard.schema.fields.domain',
operator: "contains2" operator: 'contains2'
}, },
{ {
key: "system.level", key: 'system.level',
name: "level.min", name: 'level.min',
label: "Level (Min)", label: 'DAGGERHEART.UI.ItemBrowser.levelMin',
field: 'system.api.models.items.DHDomainCard.schema.fields.level', field: 'system.api.models.items.DHDomainCard.schema.fields.level',
operator: "gte" operator: 'gte'
}, },
{ {
key: "system.level", key: 'system.level',
name: "level.max", name: 'level.max',
label: "Level (Max)", label: 'DAGGERHEART.UI.ItemBrowser.levelMax',
field: 'system.api.models.items.DHDomainCard.schema.fields.level', field: 'system.api.models.items.DHDomainCard.schema.fields.level',
operator: "lte" operator: 'lte'
}, },
{ {
key: "system.recallCost", key: 'system.recallCost',
name: "recall.min", name: 'recall.min',
label: "Recall Cost (Min)", label: 'DAGGERHEART.UI.ItemBrowser.recallCostMin',
field: 'system.api.models.items.DHDomainCard.schema.fields.recallCost', field: 'system.api.models.items.DHDomainCard.schema.fields.recallCost',
operator: "gte" operator: 'gte'
}, },
{ {
key: "system.recallCost", key: 'system.recallCost',
name: "recall.max", name: 'recall.max',
label: "Recall Cost (Max)", label: 'DAGGERHEART.UI.ItemBrowser.recallCostMax',
field: 'system.api.models.items.DHDomainCard.schema.fields.recallCost', field: 'system.api.models.items.DHDomainCard.schema.fields.recallCost',
operator: "lte" operator: 'lte'
} }
] ]
}, },
classes: { classes: {
columns: [ columns: [
{ {
key: "system.evasion", key: 'system.evasion',
label: "Evasion" label: 'DAGGERHEART.GENERAL.evasion'
}, },
{ {
key: "system.hitPoints", key: 'system.hitPoints',
label: "Hit Points" label: 'DAGGERHEART.GENERAL.HitPoints.plural'
}, },
{ {
key: "system.domains", key: 'system.domains',
label: "Domains" label: 'DAGGERHEART.GENERAL.Domain.plural'
} }
], ],
filters: [ filters: [
{ {
key: "system.evasion", key: 'system.evasion',
name: "evasion.min", name: 'evasion.min',
label: "Evasion (Min)", label: 'DAGGERHEART.UI.ItemBrowser.evasionMin',
field: 'system.api.models.items.DHClass.schema.fields.evasion', field: 'system.api.models.items.DHClass.schema.fields.evasion',
operator: "gte" operator: 'gte'
}, },
{ {
key: "system.evasion", key: 'system.evasion',
name: "evasion.max", name: 'evasion.max',
label: "Evasion (Max)", label: 'DAGGERHEART.UI.ItemBrowser.evasionMax',
field: 'system.api.models.items.DHClass.schema.fields.evasion', field: 'system.api.models.items.DHClass.schema.fields.evasion',
operator: "lte" operator: 'lte'
}, },
{ {
key: "system.hitPoints", key: 'system.hitPoints',
name: "hp.min", name: 'hp.min',
label: "Hit Points (Min)", label: 'DAGGERHEART.UI.ItemBrowser.hitPointsMin',
field: 'system.api.models.items.DHClass.schema.fields.hitPoints', field: 'system.api.models.items.DHClass.schema.fields.hitPoints',
operator: "gte" operator: 'gte'
}, },
{ {
key: "system.hitPoints", key: 'system.hitPoints',
name: "hp.max", name: 'hp.max',
label: "Hit Points (Max)", label: 'DAGGERHEART.UI.ItemBrowser.hitPointsMax',
field: 'system.api.models.items.DHClass.schema.fields.hitPoints', field: 'system.api.models.items.DHClass.schema.fields.hitPoints',
operator: "lte" operator: 'lte'
}, },
{ {
key: "system.domains", key: 'system.domains',
label: "Domains", label: 'DAGGERHEART.GENERAL.Domain.plural',
choices: () => Object.values(CONFIG.DH.DOMAIN.domains).map(d => ({ value: d.id, label: d.label})), choices: () => Object.values(CONFIG.DH.DOMAIN.domains).map(d => ({ value: d.id, label: d.label })),
operator: "contains2" operator: 'contains2'
} }
] ]
}, },
subclasses: { subclasses: {
columns: [ columns: [
{ {
key: "id", key: 'id',
label: "Class", label: 'TYPES.Item.class',
format: (id) => { format: id => {
return ""; return '';
} }
}, },
{ {
key: "system.spellcastingTrait", key: 'system.spellcastingTrait',
label: "Spellcasting Trait" label: 'DAGGERHEART.ITEMS.Subclass.spellcastingTrait'
} }
], ],
filters: [] filters: []
@ -273,133 +281,133 @@ export const typeConfig = {
beastforms: { beastforms: {
columns: [ columns: [
{ {
key: "system.tier", key: 'system.tier',
label: "Tier" label: 'DAGGERHEART.GENERAL.Tiers.singular'
}, },
{ {
key: "system.mainTrait", key: 'system.mainTrait',
label: "Main Trait" label: 'DAGGERHEART.GENERAL.Trait.single'
} }
], ],
filters: [ filters: [
{ {
key: "system.tier", key: 'system.tier',
label: "Tier", label: 'DAGGERHEART.GENERAL.Tiers.singular',
field: 'system.api.models.items.DHBeastform.schema.fields.tier' field: 'system.api.models.items.DHBeastform.schema.fields.tier'
}, },
{ {
key: "system.mainTrait", key: 'system.mainTrait',
label: "Main Trait", label: 'DAGGERHEART.GENERAL.Trait.single',
field: 'system.api.models.items.DHBeastform.schema.fields.mainTrait' field: 'system.api.models.items.DHBeastform.schema.fields.mainTrait'
} }
] ]
} }
} };
export const compendiumConfig = { export const compendiumConfig = {
"daggerheart": { daggerheart: {
id: "daggerheart", id: 'daggerheart',
label: "DAGGERHEART", label: 'DAGGERHEART',
folders: { folders: {
"adversaries": { adversaries: {
id: "adversaries", id: 'adversaries',
keys: ["adversaries"], keys: ['adversaries'],
label: "Adversaries", label: 'DAGGERHEART.UI.ItemBrowser.folders.adversaries',
type: ["adversary"], type: ['adversary'],
listType: "adversaries" listType: 'adversaries'
}, },
"ancestries": { ancestries: {
id: "ancestries", id: 'ancestries',
keys: ["ancestries"], keys: ['ancestries'],
label: "Ancestries", label: 'DAGGERHEART.UI.ItemBrowser.folders.ancestries',
type: ["ancestry"], type: ['ancestry'],
folders: { folders: {
"features": { features: {
id: "features", id: 'features',
keys: ["ancestries"], keys: ['ancestries'],
label: "Features", label: 'DAGGERHEART.UI.ItemBrowser.folders.features',
type: ["feature"] type: ['feature']
} }
} }
}, },
"equipments": { equipments: {
id: "equipments", id: 'equipments',
keys: ["armors", "weapons", "consumables", "loot"], keys: ['armors', 'weapons', 'consumables', 'loot'],
label: "Equipment", label: 'DAGGERHEART.UI.ItemBrowser.folders.equipment',
type: ["armor", "weapon", "consumable", "loot"], type: ['armor', 'weapon', 'consumable', 'loot'],
listType: "items" listType: 'items'
}, },
"classes": { classes: {
id: "classes", id: 'classes',
keys: ["classes"], keys: ['classes'],
label: "Classes", label: 'DAGGERHEART.UI.ItemBrowser.folders.classes',
type: ["class"], type: ['class'],
folders: { folders: {
"features": { features: {
id: "features", id: 'features',
keys: ["classes"], keys: ['classes'],
label: "Features", label: 'DAGGERHEART.UI.ItemBrowser.folders.features',
type: ["feature"] type: ['feature']
}, },
"items": { items: {
id: "items", id: 'items',
keys: ["classes"], keys: ['classes'],
label: "Items", label: 'DAGGERHEART.UI.ItemBrowser.folders.items',
type: ["armor", "weapon", "consumable", "loot"], type: ['armor', 'weapon', 'consumable', 'loot'],
listType: "items" listType: 'items'
} }
}, },
listType: "classes" listType: 'classes'
}, },
"subclasses": { subclasses: {
id: "subclasses", id: 'subclasses',
keys: ["subclasses"], keys: ['subclasses'],
label: "Subclasses", label: 'DAGGERHEART.UI.ItemBrowser.folders.subclasses',
type: ["subclass"], type: ['subclass'],
listType: "subclasses" listType: 'subclasses'
}, },
"domains": { domains: {
id: "domains", id: 'domains',
keys: ["domains"], keys: ['domains'],
label: "Domain Cards", label: 'DAGGERHEART.UI.ItemBrowser.folders.domainCards',
type: ["domainCard"], type: ['domainCard'],
listType: "cards" listType: 'cards'
}, },
"communities": { communities: {
id: "communities", id: 'communities',
keys: ["communities"], keys: ['communities'],
label: "Communities", label: 'DAGGERHEART.UI.ItemBrowser.folders.communities',
type: ["community"], type: ['community'],
folders: { folders: {
"features": { features: {
id: "features", id: 'features',
keys: ["communities"], keys: ['communities'],
label: "Features", label: 'DAGGERHEART.UI.ItemBrowser.folders.features',
type: ["feature"] type: ['feature']
} }
} }
}, },
"environments": { environments: {
id: "environments", id: 'environments',
keys: ["environments"], keys: ['environments'],
label: "Environments", label: 'DAGGERHEART.UI.ItemBrowser.folders.environments',
type: ["environment"] type: ['environment']
}, },
"beastforms": { beastforms: {
id: "beastforms", id: 'beastforms',
keys: ["beastforms"], keys: ['beastforms'],
label: "Beastforms", label: 'DAGGERHEART.UI.ItemBrowser.folders.beastforms',
type: ["beastform"], type: ['beastform'],
listType: "beastforms", listType: 'beastforms',
folders: { folders: {
"features": { features: {
id: "features", id: 'features',
keys: ["beastforms"], keys: ['beastforms'],
label: "Features", label: 'DAGGERHEART.UI.ItemBrowser.folders.features',
type: ["feature"] type: ['feature']
} }
} }
} }
} }
} }
} };

View file

@ -26,5 +26,6 @@ export const gameSettings = {
Fear: 'ResourcesFear' Fear: 'ResourcesFear'
}, },
LevelTiers: 'LevelTiers', LevelTiers: 'LevelTiers',
Countdowns: 'Countdowns' Countdowns: 'Countdowns',
LastMigrationVersion: 'LastMigrationVersion'
}; };

View file

@ -51,11 +51,13 @@ export default class DHAttackAction extends DHDamageAction {
const labels = []; const labels = [];
const { roll, range, damage } = this; const { roll, range, damage } = this;
if (roll.trait) labels.push(game.i18n.localize(`DAGGERHEART.CONFIG.Traits.${roll.trait}.short`)) if (roll.trait) labels.push(game.i18n.localize(`DAGGERHEART.CONFIG.Traits.${roll.trait}.short`));
if (range) labels.push(game.i18n.localize(`DAGGERHEART.CONFIG.Range.${range}.short`)); if (range) labels.push(game.i18n.localize(`DAGGERHEART.CONFIG.Range.${range}.short`));
for (const { value, type } of damage.parts) { const useAltDamage = this.actor?.effects?.find(x => x.type === 'horde')?.active;
const str = Roll.replaceFormulaData(value.getFormula(), this.actor?.getRollData() ?? {}); for (const { value, valueAlt, type } of damage.parts) {
const usedValue = useAltDamage ? valueAlt : value;
const str = Roll.replaceFormulaData(usedValue.getFormula(), this.actor?.getRollData() ?? {});
const icons = Array.from(type) const icons = Array.from(type)
.map(t => CONFIG.DH.GENERAL.damageTypes[t]?.icon) .map(t => CONFIG.DH.GENERAL.damageTypes[t]?.icon)

View file

@ -172,7 +172,7 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
dialog: { dialog: {
configure: hasRoll configure: hasRoll
}, },
type: this.type, type: this.roll?.type ?? this.type,
hasRoll: hasRoll, hasRoll: hasRoll,
hasDamage: this.damage?.parts?.length && this.type !== 'healing', hasDamage: this.damage?.parts?.length && this.type !== 'healing',
hasHealing: this.damage?.parts?.length && this.type === 'healing', hasHealing: this.damage?.parts?.length && this.type === 'healing',

View file

@ -27,7 +27,7 @@ export default class DhpAdversary extends BaseDataActor {
}), }),
type: new fields.StringField({ type: new fields.StringField({
required: true, required: true,
choices: CONFIG.DH.ACTOR.adversaryTypes, choices: CONFIG.DH.ACTOR.allAdversaryTypes,
initial: CONFIG.DH.ACTOR.adversaryTypes.standard.id initial: CONFIG.DH.ACTOR.adversaryTypes.standard.id
}), }),
motivesAndTactics: new fields.StringField(), motivesAndTactics: new fields.StringField(),
@ -130,7 +130,7 @@ export default class DhpAdversary extends BaseDataActor {
CONFIG.DH.id, CONFIG.DH.id,
CONFIG.DH.SETTINGS.gameSettings.Automation CONFIG.DH.SETTINGS.gameSettings.Automation
).hordeDamage; ).hordeDamage;
if (autoHordeDamage && changes.system?.resources?.hitPoints?.value) { if (autoHordeDamage && changes.system?.resources?.hitPoints?.value !== undefined) {
const hordeActiveEffect = this.parent.effects.find(x => x.type === 'horde'); const hordeActiveEffect = this.parent.effects.find(x => x.type === 'horde');
if (hordeActiveEffect) { if (hordeActiveEffect) {
const halfHP = Math.ceil(this.resources.hitPoints.max / 2); const halfHP = Math.ceil(this.resources.hitPoints.max / 2);

View file

@ -130,11 +130,16 @@ export default class BaseDataActor extends foundry.abstract.TypeDataModel {
const typeForDefeated = ['character', 'adversary', 'companion'].find(x => x === this.parent.type); const typeForDefeated = ['character', 'adversary', 'companion'].find(x => x === this.parent.type);
if (defeatedSettings.enabled && typeForDefeated) { if (defeatedSettings.enabled && typeForDefeated) {
const resource = typeForDefeated === 'companion' ? 'stress' : 'hitPoints'; const resource = typeForDefeated === 'companion' ? 'stress' : 'hitPoints';
if (changes.system.resources[resource]) { const resourceValue = changes.system.resources[resource];
const becameMax = changes.system.resources[resource].value === this.resources[resource].max; if (
resourceValue &&
this.resources[resource].max &&
resourceValue.value !== this.resources[resource].value
) {
const becameMax = resourceValue.value === this.resources[resource].max;
const wasMax = const wasMax =
this.resources[resource].value === this.resources[resource].max && this.resources[resource].value === this.resources[resource].max &&
this.resources[resource].value !== changes.system.resources[resource].value; this.resources[resource].value !== resourceValue.value;
if (becameMax) { if (becameMax) {
this.parent.toggleDefeated(true); this.parent.toggleDefeated(true);
} else if (wasMax) { } else if (wasMax) {

View file

@ -317,7 +317,7 @@ export default class DhCharacter extends BaseDataActor {
} }
get multiclass() { get multiclass() {
const value = this.parent.items.find(x => x.type === 'Class' && x.system.isMulticlass); const value = this.parent.items.find(x => x.type === 'class' && x.system.isMulticlass);
const subclass = this.parent.items.find(x => x.type === 'subclass' && x.system.isMulticlass); const subclass = this.parent.items.find(x => x.type === 'subclass' && x.system.isMulticlass);
return { return {
@ -443,17 +443,15 @@ export default class DhCharacter extends BaseDataActor {
classFeatures.push(item); classFeatures.push(item);
} else if (item.system.originItemType === CONFIG.DH.ITEM.featureTypes.subclass.id) { } else if (item.system.originItemType === CONFIG.DH.ITEM.featureTypes.subclass.id) {
if (this.class.subclass) { if (this.class.subclass) {
const subclassState = this.class.subclass.system.featureState; const prop = item.system.multiclassOrigin ? 'multiclass' : 'class';
const subclass = const subclassState = this[prop].subclass?.system?.featureState;
item.system.identifier === 'multiclass' ? this.multiclass.subclass : this.class.subclass; if (!subclassState) continue;
const featureType = subclass
? (subclass.system.features.find(x => x.item?.uuid === item.uuid)?.type ?? null)
: null;
if ( if (
featureType === CONFIG.DH.ITEM.featureSubTypes.foundation || item.system.identifier === CONFIG.DH.ITEM.featureSubTypes.foundation ||
(featureType === CONFIG.DH.ITEM.featureSubTypes.specialization && subclassState >= 2) || (item.system.identifier === CONFIG.DH.ITEM.featureSubTypes.specialization &&
(featureType === CONFIG.DH.ITEM.featureSubTypes.mastery && subclassState >= 3) subclassState >= 2) ||
(item.system.identifier === CONFIG.DH.ITEM.featureSubTypes.mastery && subclassState >= 3)
) { ) {
subclassFeatures.push(item); subclassFeatures.push(item);
} }

View file

@ -113,7 +113,7 @@ export default class DHActorRoll extends foundry.abstract.TypeDataModel {
this.currentTargets = this.getTargetList(); this.currentTargets = this.getTargetList();
// this.registerTargetHook(); // this.registerTargetHook();
if (this.targetMode === true && this.hasRoll) { if (this.hasRoll) {
this.targetShort = this.targets.reduce( this.targetShort = this.targets.reduce(
(a, c) => { (a, c) => {
if (c.hit) a.hit += 1; if (c.hit) a.hit += 1;
@ -127,7 +127,8 @@ export default class DHActorRoll extends foundry.abstract.TypeDataModel {
} }
this.canViewSecret = this.parent.speakerActor?.testUserPermission(game.user, 'OBSERVER'); this.canViewSecret = this.parent.speakerActor?.testUserPermission(game.user, 'OBSERVER');
this.canButtonApply = game.user.isGM; this.canButtonApply = game.user.isGM; //temp
this.isGM = game.user.isGM; //temp
} }
getTargetList() { getTargetList() {

View file

@ -25,7 +25,7 @@ export default class CostField extends fields.ArrayField {
config.costs = CostField.calcCosts.call(this, costs); config.costs = CostField.calcCosts.call(this, costs);
const hasCost = CostField.hasCost.call(this, config.costs); const hasCost = CostField.hasCost.call(this, config.costs);
if (config.isFastForward && !hasCost) if (config.isFastForward && !hasCost)
return ui.notifications.warn("You don't have the resources to use that action."); return ui.notifications.warn(game.i18n.localize('DAGGERHEART.UI.Notifications.insufficientResources'));
return hasCost; return hasCost;
} }

View file

@ -23,14 +23,22 @@ export class DHActionDiceData extends foundry.abstract.DataModel {
multiplier: new fields.StringField({ multiplier: new fields.StringField({
choices: CONFIG.DH.GENERAL.multiplierTypes, choices: CONFIG.DH.GENERAL.multiplierTypes,
initial: 'prof', initial: 'prof',
label: 'Multiplier' label: 'DAGGERHEART.ACTIONS.Config.damage.multiplier'
}), }),
flatMultiplier: new fields.NumberField({ nullable: true, initial: 1, label: 'Flat Multiplier' }), flatMultiplier: new fields.NumberField({
dice: new fields.StringField({ choices: CONFIG.DH.GENERAL.diceTypes, initial: 'd6', label: 'Dice' }), nullable: true,
bonus: new fields.NumberField({ nullable: true, initial: null, label: 'Bonus' }), initial: 1,
label: 'DAGGERHEART.ACTIONS.Config.damage.flatMultiplier'
}),
dice: new fields.StringField({
choices: CONFIG.DH.GENERAL.diceTypes,
initial: 'd6',
label: 'DAGGERHEART.GENERAL.Dice.single'
}),
bonus: new fields.NumberField({ nullable: true, initial: null, label: 'DAGGERHEART.GENERAL.bonus' }),
custom: new fields.SchemaField({ custom: new fields.SchemaField({
enabled: new fields.BooleanField({ label: 'Custom Formula' }), enabled: new fields.BooleanField({ label: 'DAGGERHEART.ACTIONS.Config.general.customFormula' }),
formula: new FormulaField({ label: 'Formula', initial: '' }) formula: new FormulaField({ label: 'DAGGERHEART.ACTIONS.Config.general.formula', initial: '' })
}) })
}; };
} }

View file

@ -25,7 +25,7 @@ export default class UsesField extends fields.SchemaField {
if (uses && !uses.value) uses.value = 0; if (uses && !uses.value) uses.value = 0;
config.uses = uses; config.uses = uses;
const hasUses = UsesField.hasUses.call(this, config.uses); const hasUses = UsesField.hasUses.call(this, config.uses);
if (config.isFastForward && !hasUses) return ui.notifications.warn("That action doesn't have remaining uses."); if (config.isFastForward && !hasUses) return ui.notifications.warn(game.i18n.localize('DAGGERHEART.UI.Notifications.actionNoUsesRemaining'));
return hasUses; return hasUses;
} }

View file

@ -158,50 +158,30 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel {
} }
if (this.actor && this.actor.type === 'character' && this.features) { if (this.actor && this.actor.type === 'character' && this.features) {
const featureUpdates = {}; const features = [];
for (let f of this.features) { for (let f of this.features) {
const fBase = f.item ?? f; const fBase = f.item ?? f;
const feature = fBase.system ? fBase : await foundry.utils.fromUuid(fBase.uuid); const feature = fBase.system ? fBase : await foundry.utils.fromUuid(fBase.uuid);
const createData = foundry.utils.mergeObject( features.push(
foundry.utils.mergeObject(
feature.toObject(), feature.toObject(),
{ {
_stats: { compendiumSource: fBase.uuid },
system: { system: {
originItemType: this.parent.type, originItemType: this.parent.type,
originId: data._id, identifier: f.item ? f.type : null,
identifier: this.isMulticlass ? 'multiclass' : null multiclassOrigin: this.isMulticlass
} }
}, },
{ inplace: false } { inplace: false }
)
); );
const [doc] = await this.actor.createEmbeddedDocuments('Item', [createData]);
if (!featureUpdates.features)
featureUpdates.features = this.features.map(x => (x.item ? { ...x, item: x.item.uuid } : x.uuid));
if (f.item) {
const existingFeature = featureUpdates.features.find(x => x.item === f.item.uuid);
existingFeature.item = doc.uuid;
} else {
const replaceIndex = featureUpdates.features.findIndex(x => x === f.uuid);
featureUpdates.features.splice(replaceIndex, 1, doc.uuid);
}
} }
await this.updateSource(featureUpdates); await this.actor.createEmbeddedDocuments('Item', features);
} }
} }
async _preDelete() {
if (!this.actor || this.actor.type !== 'character') return;
const items = this.actor.items.filter(item => item.system.originId === this.parent.id);
if (items.length > 0)
await this.actor.deleteEmbeddedDocuments(
'Item',
items.map(x => x.id)
);
}
async _preUpdate(changed, options, userId) { async _preUpdate(changed, options, userId) {
const allowed = await super._preUpdate(changed, options, userId); const allowed = await super._preUpdate(changed, options, userId);
if (allowed === false) return false; if (allowed === false) return false;

View file

@ -1,5 +1,4 @@
import BaseDataItem from './base.mjs'; import BaseDataItem from './base.mjs';
import { ActionField, ActionsField } from '../fields/actionField.mjs';
export default class DHFeature extends BaseDataItem { export default class DHFeature extends BaseDataItem {
/** @inheritDoc */ /** @inheritDoc */
@ -30,24 +29,8 @@ export default class DHFeature extends BaseDataItem {
nullable: true, nullable: true,
initial: null initial: null
}), }),
originId: new fields.StringField({ nullable: true, initial: null }), multiclassOrigin: new fields.BooleanField({ initial: false }),
identifier: new fields.StringField() identifier: new fields.StringField()
}; };
} }
get spellcastingModifier() {
let traitValue = 0;
if (this.actor && this.originId && ['class', 'subclass'].includes(this.originItemType)) {
if (this.originItemType === 'subclass') {
traitValue =
this.actor.system.traits[this.actor.items.get(this.originId).system.spellcastingTrait]?.value ?? 0;
} else {
const { value: multiclass, subclass } = this.actor.system.multiclass;
const selectedSubclass = multiclass?.id === this.originId ? subclass : this.actor.system.class.subclass;
traitValue = this.actor.system.traits[selectedSubclass.system.spellcastingTrait]?.value ?? 0;
}
}
return traitValue;
}
} }

View file

@ -1,3 +1,4 @@
import ForeignDocumentUUIDField from '../fields/foreignDocumentUUIDField.mjs';
import ItemLinkFields from '../fields/itemLinkFields.mjs'; import ItemLinkFields from '../fields/itemLinkFields.mjs';
import BaseDataItem from './base.mjs'; import BaseDataItem from './base.mjs';
@ -25,7 +26,8 @@ export default class DHSubclass extends BaseDataItem {
}), }),
features: new ItemLinkFields(), features: new ItemLinkFields(),
featureState: new fields.NumberField({ required: true, initial: 1, min: 1 }), featureState: new fields.NumberField({ required: true, initial: 1, min: 1 }),
isMulticlass: new fields.BooleanField({ initial: false }) isMulticlass: new fields.BooleanField({ initial: false }),
linkedClass: new ForeignDocumentUUIDField({ type: 'Item', nullable: true, initial: null })
}; };
} }

View file

@ -199,8 +199,8 @@ export default class DHWeapon extends AttachableItem {
]; ];
for (const { value, type } of attack.damage.parts) { for (const { value, type } of attack.damage.parts) {
const parts = [value.dice]; const parts = value.custom.enabled ? [game.i18n.localize('DAGGERHEART.GENERAL.custom')] : [value.dice];
if (value.bonus) parts.push(value.bonus.signedString()); if (!value.custom.enabled && value.bonus) parts.push(value.bonus.signedString());
if (type.size > 0) { if (type.size > 0) {
const typeTags = Array.from(type) const typeTags = Array.from(type)

View file

@ -108,6 +108,13 @@ export default class DhHomebrew extends foundry.abstract.DataModel {
}), }),
description: new fields.HTMLField() description: new fields.HTMLField()
}) })
),
adversaryTypes: new fields.TypedObjectField(
new fields.SchemaField({
id: new fields.StringField({ required: true }),
label: new fields.StringField({ required: true, label: 'DAGGERHEART.GENERAL.label' }),
description: new fields.StringField()
})
) )
}; };
} }

View file

@ -37,7 +37,13 @@ export default class DamageRoll extends DHRoll {
Object.values(config.damage).flatMap(r => r.parts.map(p => p.roll)) Object.values(config.damage).flatMap(r => r.parts.map(p => p.roll))
), ),
diceRoll = Roll.fromTerms([pool]); diceRoll = Roll.fromTerms([pool]);
await game.dice3d.showForRoll(diceRoll, game.user, true, chatMessage.whisper, chatMessage.blind); await game.dice3d.showForRoll(
diceRoll,
game.user,
true,
chatMessage.whisper?.length > 0 ? chatMessage.whisper : null,
chatMessage.blind
);
} }
await super.buildPost(roll, config, message); await super.buildPost(roll, config, message);
if (config.source?.message) { if (config.source?.message) {

View file

@ -167,13 +167,11 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect {
if (subclass) { if (subclass) {
const featureState = subclass.system.featureState; const featureState = subclass.system.featureState;
const featureType = subclass
? (subclass.system.features.find(x => x.item?.uuid === this.parent.uuid)?.type ?? null)
: null;
if ( if (
(featureType === CONFIG.DH.ITEM.featureSubTypes.specialization && featureState < 2) || (this.parent.system.identifier === CONFIG.DH.ITEM.featureSubTypes.specialization &&
(featureType === CONFIG.DH.ITEM.featureSubTypes.mastery && featureState < 3) featureState < 2) ||
(this.parent.system.identifier === CONFIG.DH.ITEM.featureSubTypes.mastery && featureState < 3)
) { ) {
this.transfer = false; this.transfer = false;
} }

View file

@ -167,10 +167,10 @@ export default class DhpActor extends Actor {
if (multiclass) { if (multiclass) {
const multiclassItem = this.items.find(x => x.uuid === multiclass.itemUuid); const multiclassItem = this.items.find(x => x.uuid === multiclass.itemUuid);
const multiclassFeatures = this.items.filter( const multiclassFeatures = this.items.filter(
x => x.system.originItemType === 'class' && x.system.identifier === 'multiclass' x => x.system.originItemType === 'class' && x.system.multiclassOrigin
); );
const subclassFeatures = this.items.filter( const subclassFeatures = this.items.filter(
x => x.system.originItemType === 'subclass' && x.system.identifier === 'multiclass' x => x.system.originItemType === 'subclass' && x.system.multiclassOrigin
); );
this.deleteEmbeddedDocuments( this.deleteEmbeddedDocuments(
@ -772,4 +772,26 @@ export default class DhpActor extends Actor {
this.#scrollTextInterval = setInterval(intervalFunc.bind(this), 600); this.#scrollTextInterval = setInterval(intervalFunc.bind(this), 600);
} }
} }
/** @inheritdoc */
async importFromJSON(json) {
if (!this.type === 'character') return await super.importFromJSON(json);
if (!CONST.WORLD_DOCUMENT_TYPES.includes(this.documentName)) {
throw new Error('Only world Documents may be imported');
}
const parsedJSON = JSON.parse(json);
if (foundry.utils.isNewerVersion('1.1.0', parsedJSON._stats.systemVersion)) {
const confirmed = await foundry.applications.api.DialogV2.confirm({
window: {
title: game.i18n.localize('DAGGERHEART.ACTORS.Character.InvalidOldCharacterImportTitle')
},
content: game.i18n.localize('DAGGERHEART.ACTORS.Character.InvalidOldCharacterImportText')
});
if (!confirmed) return;
}
return await super.importFromJSON(json);
}
} }

View file

@ -2,7 +2,8 @@ export default function DhDamageEnricher(match, _options) {
const parts = match[1].split('|').map(x => x.trim()); const parts = match[1].split('|').map(x => x.trim());
let value = null, let value = null,
type = null; type = null,
inline = false;
parts.forEach(part => { parts.forEach(part => {
const split = part.split(':').map(x => x.toLowerCase().trim()); const split = part.split(':').map(x => x.toLowerCase().trim());
@ -14,16 +15,19 @@ export default function DhDamageEnricher(match, _options) {
case 'type': case 'type':
type = split[1]; type = split[1];
break; break;
case 'inline':
inline = true;
break;
} }
} }
}); });
if (!value || !value) return match[0]; if (!value || !value) return match[0];
return getDamageMessage(value, type, match[0]); return getDamageMessage(value, type, inline, match[0]);
} }
function getDamageMessage(damage, type, defaultElement) { function getDamageMessage(damage, type, inline, defaultElement) {
const typeIcons = type const typeIcons = type
.replace('[', '') .replace('[', '')
.replace(']', '') .replace(']', '')
@ -40,7 +44,7 @@ function getDamageMessage(damage, type, defaultElement) {
const dualityElement = document.createElement('span'); const dualityElement = document.createElement('span');
dualityElement.innerHTML = ` dualityElement.innerHTML = `
<button class="enriched-damage-button" <button class="enriched-damage-button${inline ? ' inline' : ''}"
data-value="${damage}" data-value="${damage}"
data-type="${type}" data-type="${type}"
data-tooltip="${game.i18n.localize('DAGGERHEART.GENERAL.damage')}" data-tooltip="${game.i18n.localize('DAGGERHEART.GENERAL.damage')}"

View file

@ -36,7 +36,7 @@ function getDualityMessage(roll, flavor) {
const dualityElement = document.createElement('span'); const dualityElement = document.createElement('span');
dualityElement.innerHTML = ` dualityElement.innerHTML = `
<button class="duality-roll-button" <button class="duality-roll-button${roll.inline ? ' inline' : ''}"
data-title="${label}" data-title="${label}"
data-label="${dataLabel}" data-label="${dataLabel}"
data-reaction="${roll.reaction ? 'true' : 'false'}" data-reaction="${roll.reaction ? 'true' : 'false'}"

View file

@ -2,7 +2,8 @@ export default function DhTemplateEnricher(match, _options) {
const parts = match[1].split('|').map(x => x.trim()); const parts = match[1].split('|').map(x => x.trim());
let type = null, let type = null,
range = null; range = null,
inline = false;
parts.forEach(part => { parts.forEach(part => {
const split = part.split(':').map(x => x.toLowerCase().trim()); const split = part.split(':').map(x => x.toLowerCase().trim());
@ -20,6 +21,9 @@ export default function DhTemplateEnricher(match, _options) {
); );
range = matchedRange?.id; range = matchedRange?.id;
break; break;
case 'inline':
inline = true;
break;
} }
} }
}); });
@ -30,7 +34,7 @@ export default function DhTemplateEnricher(match, _options) {
const templateElement = document.createElement('span'); const templateElement = document.createElement('span');
templateElement.innerHTML = ` templateElement.innerHTML = `
<button class="measured-template-button" data-type="${type}" data-range="${range}"> <button class="measured-template-button${inline ? ' inline' : ''}" data-type="${type}" data-range="${range}">
${label} - ${game.i18n.localize(`DAGGERHEART.CONFIG.Range.${range}.name`)} ${label} - ${game.i18n.localize(`DAGGERHEART.CONFIG.Range.${range}.name`)}
</button> </button>
`; `;

View file

@ -13,7 +13,8 @@ export default class RegisterHandlebarsHelpers {
hasProperty: foundry.utils.hasProperty, hasProperty: foundry.utils.hasProperty,
getProperty: foundry.utils.getProperty, getProperty: foundry.utils.getProperty,
setVar: this.setVar, setVar: this.setVar,
empty: this.empty empty: this.empty,
pluralize: this.pluralize
}); });
} }
static add(a, b) { static add(a, b) {
@ -64,7 +65,7 @@ export default class RegisterHandlebarsHelpers {
return isNumerical ? (!result ? 0 : Number(result)) : result; return isNumerical ? (!result ? 0 : Number(result)) : result;
} }
static setVar(name, value, context) { static setVar(name, value) {
this[name] = value; this[name] = value;
} }
@ -72,4 +73,20 @@ export default class RegisterHandlebarsHelpers {
if (!(typeof object === 'object')) return true; if (!(typeof object === 'object')) return true;
return Object.keys(object).length === 0; return Object.keys(object).length === 0;
} }
/**
* Pluralize helper that returns the appropriate localized string based on count
* @param {number} count - The number to check for plurality
* @param {string} baseKey - The base localization key (e.g., "DAGGERHEART.GENERAL.Target")
* @returns {string} The localized singular or plural string
*
* Usage: {{pluralize currentTargets.length "DAGGERHEART.GENERAL.Target"}}
* Returns: "Target" if count is exactly 1, "Targets" if count is 0, 2+, or invalid
*/
static pluralize(count, baseKey) {
const numericCount = Number(count);
const isSingular = !isNaN(numericCount) && numericCount === 1;
const key = isSingular ? `${baseKey}.single` : `${baseKey}.plural`;
return game.i18n.localize(key);
}
} }

View file

@ -1,3 +1,4 @@
export { preloadHandlebarsTemplates as handlebarsRegistration } from './handlebars.mjs'; export { preloadHandlebarsTemplates as handlebarsRegistration } from './handlebars.mjs';
export * as settingsRegistration from './settings.mjs'; export * as settingsRegistration from './settings.mjs';
export * as socketRegistration from './socket.mjs'; export * as socketRegistration from './socket.mjs';
export { runMigrations } from './migrations.mjs';

View file

@ -0,0 +1,100 @@
export async function runMigrations() {
let lastMigrationVersion = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LastMigrationVersion);
if (!lastMigrationVersion) lastMigrationVersion = '1.0.6';
if (foundry.utils.isNewerVersion('1.1.0', lastMigrationVersion)) {
const lockedPacks = [];
const compendiumActors = [];
for (let pack of game.packs) {
if (pack.locked) {
lockedPacks.push(pack.collection);
await pack.configure({ locked: false });
}
const documents = await pack.getDocuments();
compendiumActors.push(...documents.filter(x => x.type === 'character'));
}
[...compendiumActors, ...game.actors].forEach(actor => {
const items = actor.items.reduce((acc, item) => {
if (item.type === 'feature') {
const { originItemType, isMulticlass, identifier } = item.system;
const base = originItemType
? actor.items.find(
x => x.type === originItemType && Boolean(isMulticlass) === Boolean(x.system.isMulticlass)
)
: null;
if (base) {
const feature = base.system.features.find(x => x.item && x.item.uuid === item.uuid);
if (feature && identifier !== 'multiclass') {
acc.push({ _id: item.id, system: { identifier: feature.type } });
}
}
}
return acc;
}, []);
actor.updateEmbeddedDocuments('Item', items);
});
for (let packId of lockedPacks) {
const pack = game.packs.get(packId);
await pack.configure({ locked: true });
}
lastMigrationVersion = '1.1.0';
}
if (foundry.utils.isNewerVersion('1.1.1', lastMigrationVersion)) {
const lockedPacks = [];
const compendiumClasses = [];
const compendiumActors = [];
for (let pack of game.packs) {
if (pack.locked) {
lockedPacks.push(pack.collection);
await pack.configure({ locked: false });
}
const documents = await pack.getDocuments();
compendiumClasses.push(...documents.filter(x => x.type === 'class'));
compendiumActors.push(...documents.filter(x => x.type === 'character'));
}
[...compendiumActors, ...game.actors.filter(x => x.type === 'character')].forEach(char => {
const multiclass = char.items.find(x => x.type === 'class' && x.system.isMulticlass);
const multiclassSubclass =
multiclass?.system?.subclasses?.length > 0 ? multiclass.system.subclasses[0] : null;
char.items.forEach(item => {
if (item.type === 'feature' && item.system.identifier === 'multiclass') {
const base = item.system.originItemType === 'class' ? multiclass : multiclassSubclass;
if (base) {
const baseFeature = base.system.features.find(x => x.item.name === item.name);
if (baseFeature) {
item.update({
system: {
multiclassOrigin: true,
identifier: baseFeature.type
}
});
}
}
}
});
});
const worldClasses = game.items.filter(x => x.type === 'class');
for (let classVal of [...compendiumClasses, ...worldClasses]) {
for (let subclass of classVal.system.subclasses) {
await subclass.update({ 'system.linkedClass': classVal.uuid });
}
}
for (let packId of lockedPacks) {
const pack = game.packs.get(packId);
await pack.configure({ locked: true });
}
lastMigrationVersion = '1.1.1';
}
await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LastMigrationVersion, lastMigrationVersion);
}

View file

@ -91,6 +91,12 @@ const registerMenus = () => {
}; };
const registerNonConfigSettings = () => { const registerNonConfigSettings = () => {
game.settings.register(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LastMigrationVersion, {
scope: 'world',
config: false,
type: String
});
game.settings.register(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LevelTiers, { game.settings.register(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LevelTiers, {
scope: 'world', scope: 'world',
config: false, config: false,

View file

@ -270,7 +270,7 @@
"cost": [ "cost": [
{ {
"scalable": false, "scalable": false,
"key": "stress", "key": "fear",
"value": 1, "value": 1,
"keyIsID": false, "keyIsID": false,
"step": null "step": null
@ -286,7 +286,7 @@
"type": "self", "type": "self",
"amount": null "amount": null
}, },
"name": "Mark Stress", "name": "Spend Fear",
"img": "icons/creatures/abilities/tail-strike-bone-orange.webp", "img": "icons/creatures/abilities/tail-strike-bone-orange.webp",
"range": "" "range": ""
} }

View file

@ -12,7 +12,7 @@
"type": "attack", "type": "attack",
"_id": "a6WROv0OKx0lbYVa", "_id": "a6WROv0OKx0lbYVa",
"systemPath": "actions", "systemPath": "actions",
"description": "", "description": "<p>Choose an element for your breath (such as electricity, fire, or ice). You can use this breath against a target or group of targets within Very Close range, treating it as an Instinct weapon that deals <strong>d8</strong> magic damage using your Proficiency.</p>",
"chatDisplay": true, "chatDisplay": true,
"actionType": "action", "actionType": "action",
"cost": [], "cost": [],
@ -102,10 +102,10 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.347", "coreVersion": "13.347",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.0.5", "systemVersion": "1.1.0",
"createdTime": 1753994055921, "createdTime": 1753994055921,
"modifiedTime": 1755394293348, "modifiedTime": 1755938895948,
"lastModifiedBy": "VZIeX2YDvX338Zvr" "lastModifiedBy": "tt3PwMBXcTLCtIQU"
}, },
"_key": "!items!sRaE3CgkgjBF1UpV" "_key": "!items!sRaE3CgkgjBF1UpV"
} }

View file

@ -77,10 +77,10 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.347", "coreVersion": "13.347",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.0.5", "systemVersion": "1.1.0",
"createdTime": 1754174600538, "createdTime": 1754174600538,
"modifiedTime": 1755390999058, "modifiedTime": 1755943467705,
"lastModifiedBy": "VZIeX2YDvX338Zvr" "lastModifiedBy": "tt3PwMBXcTLCtIQU"
}, },
"_id": "vegl3bFOq3pcFTWT", "_id": "vegl3bFOq3pcFTWT",
"sort": 300000, "sort": 300000,

View file

@ -79,10 +79,10 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.347", "coreVersion": "13.347",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.0.5", "systemVersion": "1.1.0",
"createdTime": 1754222247012, "createdTime": 1754222247012,
"modifiedTime": 1755391012909, "modifiedTime": 1755943479440,
"lastModifiedBy": "VZIeX2YDvX338Zvr" "lastModifiedBy": "tt3PwMBXcTLCtIQU"
}, },
"_key": "!items!ZNwUTCyGCEcidZFv" "_key": "!items!ZNwUTCyGCEcidZFv"
} }

View file

@ -75,10 +75,10 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.347", "coreVersion": "13.347",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.0.5", "systemVersion": "1.1.0",
"createdTime": 1754246931974, "createdTime": 1754246931974,
"modifiedTime": 1755391032291, "modifiedTime": 1755943488697,
"lastModifiedBy": "VZIeX2YDvX338Zvr" "lastModifiedBy": "tt3PwMBXcTLCtIQU"
}, },
"_key": "!items!nRAyoC0fOzXPDa4z" "_key": "!items!nRAyoC0fOzXPDa4z"
} }

View file

@ -75,10 +75,10 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.347", "coreVersion": "13.347",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.0.5", "systemVersion": "1.1.0",
"createdTime": 1754268869310, "createdTime": 1754268869310,
"modifiedTime": 1755391043325, "modifiedTime": 1755943505024,
"lastModifiedBy": "VZIeX2YDvX338Zvr" "lastModifiedBy": "tt3PwMBXcTLCtIQU"
}, },
"_key": "!items!BTyfve69LKqoOi9S" "_key": "!items!BTyfve69LKqoOi9S"
} }

View file

@ -79,10 +79,10 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.347", "coreVersion": "13.347",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.0.5", "systemVersion": "1.1.0",
"createdTime": 1754325275832, "createdTime": 1754325275832,
"modifiedTime": 1755391064025, "modifiedTime": 1755943515533,
"lastModifiedBy": "VZIeX2YDvX338Zvr" "lastModifiedBy": "tt3PwMBXcTLCtIQU"
}, },
"_key": "!items!CvHlkHZfpMiCz5uT" "_key": "!items!CvHlkHZfpMiCz5uT"
} }

View file

@ -75,10 +75,10 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.347", "coreVersion": "13.347",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.0.5", "systemVersion": "1.1.0",
"createdTime": 1754351482530, "createdTime": 1754351482530,
"modifiedTime": 1755391077728, "modifiedTime": 1755943523935,
"lastModifiedBy": "VZIeX2YDvX338Zvr" "lastModifiedBy": "tt3PwMBXcTLCtIQU"
}, },
"_key": "!items!5ZnlJ5bEoyOTkUJv" "_key": "!items!5ZnlJ5bEoyOTkUJv"
} }

View file

@ -83,10 +83,10 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.347", "coreVersion": "13.347",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.0.5", "systemVersion": "1.1.0",
"createdTime": 1754349743129, "createdTime": 1754349743129,
"modifiedTime": 1755391092028, "modifiedTime": 1755943536635,
"lastModifiedBy": "VZIeX2YDvX338Zvr" "lastModifiedBy": "tt3PwMBXcTLCtIQU"
}, },
"_key": "!items!DchOzHcWIJE9FKcR" "_key": "!items!DchOzHcWIJE9FKcR"
} }

View file

@ -79,10 +79,10 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.347", "coreVersion": "13.347",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.0.5", "systemVersion": "1.1.0",
"createdTime": 1754255776706, "createdTime": 1754255776706,
"modifiedTime": 1755391103528, "modifiedTime": 1755943545980,
"lastModifiedBy": "VZIeX2YDvX338Zvr" "lastModifiedBy": "tt3PwMBXcTLCtIQU"
}, },
"_key": "!items!xCUWwJz4WSthvLfy" "_key": "!items!xCUWwJz4WSthvLfy"
} }

View file

@ -79,10 +79,10 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.347", "coreVersion": "13.347",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.0.5", "systemVersion": "1.1.0",
"createdTime": 1754253505323, "createdTime": 1754253505323,
"modifiedTime": 1755391118180, "modifiedTime": 1755943555087,
"lastModifiedBy": "VZIeX2YDvX338Zvr" "lastModifiedBy": "tt3PwMBXcTLCtIQU"
}, },
"_key": "!items!5LwX4m8ziY3F1ZGC" "_key": "!items!5LwX4m8ziY3F1ZGC"
} }

View file

@ -12,7 +12,7 @@
"type": "effect", "type": "effect",
"_id": "ZBVqSlsDUKf8uGrI", "_id": "ZBVqSlsDUKf8uGrI",
"systemPath": "actions", "systemPath": "actions",
"description": "", "description": "<p>Record three sayings or values your upbringing instilled in you. Once per rest, when you describe how youre embodying one of these principles through your current action, you can roll a d20 as your Hope Die</p>",
"chatDisplay": true, "chatDisplay": true,
"actionType": "action", "actionType": "action",
"cost": [], "cost": [],
@ -48,10 +48,10 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.347", "coreVersion": "13.347",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.0.5", "systemVersion": "1.1.0",
"createdTime": 1754010247432, "createdTime": 1754010247432,
"modifiedTime": 1755394895431, "modifiedTime": 1755938935013,
"lastModifiedBy": "VZIeX2YDvX338Zvr" "lastModifiedBy": "tt3PwMBXcTLCtIQU"
}, },
"sort": 0, "sort": 0,
"ownership": { "ownership": {

View file

@ -35,7 +35,8 @@
"source": "Daggerheart SRD", "source": "Daggerheart SRD",
"page": 17, "page": 17,
"artist": "" "artist": ""
} },
"linkedClass": "Compendium.daggerheart.classes.Item.BTyfve69LKqoOi9S"
}, },
"effects": [], "effects": [],
"sort": 0, "sort": 0,
@ -50,10 +51,10 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.347", "coreVersion": "13.347",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.0.5", "systemVersion": "1.1.0",
"createdTime": 1754268237448, "createdTime": 1754268237448,
"modifiedTime": 1755391910037, "modifiedTime": 1755943503629,
"lastModifiedBy": "VZIeX2YDvX338Zvr" "lastModifiedBy": "tt3PwMBXcTLCtIQU"
}, },
"_key": "!items!TIUsIlTS1WkK5vr2" "_key": "!items!TIUsIlTS1WkK5vr2"
} }

View file

@ -31,7 +31,8 @@
"source": "Daggerheart SRD", "source": "Daggerheart SRD",
"page": 24, "page": 24,
"artist": "" "artist": ""
} },
"linkedClass": "Compendium.daggerheart.classes.Item.xCUWwJz4WSthvLfy"
}, },
"effects": [], "effects": [],
"sort": 0, "sort": 0,
@ -46,10 +47,10 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.347", "coreVersion": "13.347",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.0.5", "systemVersion": "1.1.0",
"createdTime": 1754256077777, "createdTime": 1754256077777,
"modifiedTime": 1755392366229, "modifiedTime": 1755943544886,
"lastModifiedBy": "VZIeX2YDvX338Zvr" "lastModifiedBy": "tt3PwMBXcTLCtIQU"
}, },
"_key": "!items!NAFU9roaVG7f3RNJ" "_key": "!items!NAFU9roaVG7f3RNJ"
} }

View file

@ -27,7 +27,8 @@
"source": "Daggerheart SRD", "source": "Daggerheart SRD",
"page": 24, "page": 24,
"artist": "" "artist": ""
} },
"linkedClass": "Compendium.daggerheart.classes.Item.xCUWwJz4WSthvLfy"
}, },
"effects": [], "effects": [],
"sort": 0, "sort": 0,
@ -42,10 +43,10 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.347", "coreVersion": "13.347",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.0.5", "systemVersion": "1.1.0",
"createdTime": 1754256112978, "createdTime": 1754256112978,
"modifiedTime": 1755392375946, "modifiedTime": 1755943545973,
"lastModifiedBy": "VZIeX2YDvX338Zvr" "lastModifiedBy": "tt3PwMBXcTLCtIQU"
}, },
"_key": "!items!bcNe5qP3o6CKadhK" "_key": "!items!bcNe5qP3o6CKadhK"
} }

View file

@ -31,7 +31,8 @@
"source": "Daggerheart SRD", "source": "Daggerheart SRD",
"page": 21, "page": 21,
"artist": "" "artist": ""
} },
"linkedClass": "Compendium.daggerheart.classes.Item.5ZnlJ5bEoyOTkUJv"
}, },
"effects": [], "effects": [],
"sort": 0, "sort": 0,
@ -46,10 +47,10 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.347", "coreVersion": "13.347",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.0.5", "systemVersion": "1.1.0",
"createdTime": 1754352806098, "createdTime": 1754352806098,
"modifiedTime": 1755392139199, "modifiedTime": 1755943522722,
"lastModifiedBy": "VZIeX2YDvX338Zvr" "lastModifiedBy": "tt3PwMBXcTLCtIQU"
}, },
"_key": "!items!M5mpGoAj8LRkylrY" "_key": "!items!M5mpGoAj8LRkylrY"
} }

View file

@ -27,7 +27,8 @@
"source": "Daggerheart SRD", "source": "Daggerheart SRD",
"page": 22, "page": 22,
"artist": "" "artist": ""
} },
"linkedClass": "Compendium.daggerheart.classes.Item.DchOzHcWIJE9FKcR"
}, },
"effects": [], "effects": [],
"sort": 0, "sort": 0,
@ -42,10 +43,10 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.347", "coreVersion": "13.347",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.0.5", "systemVersion": "1.1.0",
"createdTime": 1754349604941, "createdTime": 1754349604941,
"modifiedTime": 1755392260989, "modifiedTime": 1755943535524,
"lastModifiedBy": "VZIeX2YDvX338Zvr" "lastModifiedBy": "tt3PwMBXcTLCtIQU"
}, },
"_key": "!items!wg1H0hROc2acHwZh" "_key": "!items!wg1H0hROc2acHwZh"
} }

View file

@ -35,7 +35,8 @@
"source": "Daggerheart SRD", "source": "Daggerheart SRD",
"page": 19, "page": 19,
"artist": "" "artist": ""
} },
"linkedClass": "Compendium.daggerheart.classes.Item.CvHlkHZfpMiCz5uT"
}, },
"effects": [], "effects": [],
"sort": 0, "sort": 0,
@ -50,10 +51,10 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.347", "coreVersion": "13.347",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.0.5", "systemVersion": "1.1.0",
"createdTime": 1754322815758, "createdTime": 1754322815758,
"modifiedTime": 1755392009996, "modifiedTime": 1755943514465,
"lastModifiedBy": "VZIeX2YDvX338Zvr" "lastModifiedBy": "tt3PwMBXcTLCtIQU"
}, },
"_key": "!items!h161OSIK24Up4qNd" "_key": "!items!h161OSIK24Up4qNd"
} }

View file

@ -27,7 +27,8 @@
"source": "Daggerheart SRD", "source": "Daggerheart SRD",
"page": 22, "page": 22,
"artist": "" "artist": ""
} },
"linkedClass": "Compendium.daggerheart.classes.Item.DchOzHcWIJE9FKcR"
}, },
"effects": [], "effects": [],
"sort": 0, "sort": 0,
@ -42,10 +43,10 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.347", "coreVersion": "13.347",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.0.5", "systemVersion": "1.1.0",
"createdTime": 1754349604941, "createdTime": 1754349604941,
"modifiedTime": 1755392267640, "modifiedTime": 1755943536628,
"lastModifiedBy": "VZIeX2YDvX338Zvr" "lastModifiedBy": "tt3PwMBXcTLCtIQU"
}, },
"_key": "!items!GLpRVxnY5E82khxH" "_key": "!items!GLpRVxnY5E82khxH"
} }

View file

@ -39,7 +39,8 @@
"source": "Daggerheart SRD", "source": "Daggerheart SRD",
"page": 25, "page": 25,
"artist": "" "artist": ""
} },
"linkedClass": "Compendium.daggerheart.classes.Item.5LwX4m8ziY3F1ZGC"
}, },
"effects": [], "effects": [],
"sort": 0, "sort": 0,
@ -54,10 +55,10 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.347", "coreVersion": "13.347",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.0.5", "systemVersion": "1.1.0",
"createdTime": 1754253538384, "createdTime": 1754253538384,
"modifiedTime": 1755392466418, "modifiedTime": 1755943553625,
"lastModifiedBy": "VZIeX2YDvX338Zvr" "lastModifiedBy": "tt3PwMBXcTLCtIQU"
}, },
"_key": "!items!qqQlgCqhOivUFoQn" "_key": "!items!qqQlgCqhOivUFoQn"
} }

View file

@ -39,7 +39,8 @@
"source": "Daggerheart SRD", "source": "Daggerheart SRD",
"page": 25, "page": 25,
"artist": "" "artist": ""
} },
"linkedClass": "Compendium.daggerheart.classes.Item.5LwX4m8ziY3F1ZGC"
}, },
"effects": [], "effects": [],
"sort": 0, "sort": 0,
@ -54,10 +55,10 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.347", "coreVersion": "13.347",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.0.5", "systemVersion": "1.1.0",
"createdTime": 1754253587683, "createdTime": 1754253587683,
"modifiedTime": 1755392474218, "modifiedTime": 1755943555081,
"lastModifiedBy": "VZIeX2YDvX338Zvr" "lastModifiedBy": "tt3PwMBXcTLCtIQU"
}, },
"_key": "!items!4y9Ph7RsCIAbkwTk" "_key": "!items!4y9Ph7RsCIAbkwTk"
} }

View file

@ -39,7 +39,8 @@
"source": "Daggerheart SRD", "source": "Daggerheart SRD",
"page": 16, "page": 16,
"artist": "" "artist": ""
} },
"linkedClass": "Compendium.daggerheart.classes.Item.nRAyoC0fOzXPDa4z"
}, },
"effects": [], "effects": [],
"sort": 0, "sort": 0,
@ -54,10 +55,10 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.347", "coreVersion": "13.347",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.0.5", "systemVersion": "1.1.0",
"createdTime": 1754245881893, "createdTime": 1754245881893,
"modifiedTime": 1755391787981, "modifiedTime": 1755943487549,
"lastModifiedBy": "VZIeX2YDvX338Zvr" "lastModifiedBy": "tt3PwMBXcTLCtIQU"
}, },
"_key": "!items!rKRxFBlkbh9cDK8K" "_key": "!items!rKRxFBlkbh9cDK8K"
} }

View file

@ -27,7 +27,8 @@
"source": "Daggerheart SRD", "source": "Daggerheart SRD",
"page": 20, "page": 20,
"artist": "" "artist": ""
} },
"linkedClass": "Compendium.daggerheart.classes.Item.CvHlkHZfpMiCz5uT"
}, },
"effects": [], "effects": [],
"sort": 0, "sort": 0,
@ -42,10 +43,10 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.347", "coreVersion": "13.347",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.0.5", "systemVersion": "1.1.0",
"createdTime": 1754323643089, "createdTime": 1754323643089,
"modifiedTime": 1755392018277, "modifiedTime": 1755943515526,
"lastModifiedBy": "VZIeX2YDvX338Zvr" "lastModifiedBy": "tt3PwMBXcTLCtIQU"
}, },
"_key": "!items!95QxNZwgyEm1LqdG" "_key": "!items!95QxNZwgyEm1LqdG"
} }

View file

@ -26,7 +26,8 @@
"source": "Daggerheart SRD", "source": "Daggerheart SRD",
"page": 9, "page": 9,
"artist": "" "artist": ""
} },
"linkedClass": "Compendium.daggerheart.classes.Item.vegl3bFOq3pcFTWT"
}, },
"effects": [], "effects": [],
"ownership": { "ownership": {
@ -40,10 +41,10 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.347", "coreVersion": "13.347",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.0.5", "systemVersion": "1.1.0",
"createdTime": 1754174653653, "createdTime": 1754174653653,
"modifiedTime": 1755391532634, "modifiedTime": 1755943465827,
"lastModifiedBy": "VZIeX2YDvX338Zvr" "lastModifiedBy": "tt3PwMBXcTLCtIQU"
}, },
"_id": "ld8MIvk0xVJydSBz", "_id": "ld8MIvk0xVJydSBz",
"sort": 100000, "sort": 100000,

View file

@ -31,7 +31,8 @@
"source": "Daggerheart SRD", "source": "Daggerheart SRD",
"page": 16, "page": 16,
"artist": "" "artist": ""
} },
"linkedClass": "Compendium.daggerheart.classes.Item.nRAyoC0fOzXPDa4z"
}, },
"effects": [], "effects": [],
"sort": 0, "sort": 0,
@ -46,10 +47,10 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.347", "coreVersion": "13.347",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.0.5", "systemVersion": "1.1.0",
"createdTime": 1754246011733, "createdTime": 1754246011733,
"modifiedTime": 1755391794966, "modifiedTime": 1755943488691,
"lastModifiedBy": "VZIeX2YDvX338Zvr" "lastModifiedBy": "tt3PwMBXcTLCtIQU"
}, },
"_key": "!items!SUo8NPBPO8aN193u" "_key": "!items!SUo8NPBPO8aN193u"
} }

View file

@ -34,7 +34,8 @@
"source": "Daggerheart SRD", "source": "Daggerheart SRD",
"page": 11, "page": 11,
"artist": "" "artist": ""
} },
"linkedClass": "Compendium.daggerheart.classes.Item.ZNwUTCyGCEcidZFv"
}, },
"effects": [], "effects": [],
"folder": "AZWrSJzGXltzQhAJ", "folder": "AZWrSJzGXltzQhAJ",
@ -50,10 +51,10 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.347", "coreVersion": "13.347",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.0.5", "systemVersion": "1.1.0",
"createdTime": 1754221346981, "createdTime": 1754221346981,
"modifiedTime": 1755391677508, "modifiedTime": 1755943479431,
"lastModifiedBy": "VZIeX2YDvX338Zvr" "lastModifiedBy": "tt3PwMBXcTLCtIQU"
}, },
"_key": "!items!xp0XMjYT85Q7E90o" "_key": "!items!xp0XMjYT85Q7E90o"
} }

View file

@ -26,7 +26,8 @@
"source": "Daggerheart SRD", "source": "Daggerheart SRD",
"page": 11, "page": 11,
"artist": "" "artist": ""
} },
"linkedClass": "Compendium.daggerheart.classes.Item.ZNwUTCyGCEcidZFv"
}, },
"effects": [], "effects": [],
"folder": "AZWrSJzGXltzQhAJ", "folder": "AZWrSJzGXltzQhAJ",
@ -42,10 +43,10 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.347", "coreVersion": "13.347",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.0.5", "systemVersion": "1.1.0",
"createdTime": 1754221102716, "createdTime": 1754221102716,
"modifiedTime": 1755391669341, "modifiedTime": 1755943478132,
"lastModifiedBy": "VZIeX2YDvX338Zvr" "lastModifiedBy": "tt3PwMBXcTLCtIQU"
}, },
"_key": "!items!W9hs5kxOWeY7eA4Q" "_key": "!items!W9hs5kxOWeY7eA4Q"
} }

View file

@ -31,7 +31,8 @@
"source": "Daggerheart SRD", "source": "Daggerheart SRD",
"page": 17, "page": 17,
"artist": "" "artist": ""
} },
"linkedClass": "Compendium.daggerheart.classes.Item.BTyfve69LKqoOi9S"
}, },
"effects": [], "effects": [],
"sort": 0, "sort": 0,
@ -46,10 +47,10 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.347", "coreVersion": "13.347",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.0.5", "systemVersion": "1.1.0",
"createdTime": 1754268318903, "createdTime": 1754268318903,
"modifiedTime": 1755391902003, "modifiedTime": 1755943505016,
"lastModifiedBy": "VZIeX2YDvX338Zvr" "lastModifiedBy": "tt3PwMBXcTLCtIQU"
}, },
"_key": "!items!zsUglcU4NgZ8tNgZ" "_key": "!items!zsUglcU4NgZ8tNgZ"
} }

View file

@ -31,7 +31,8 @@
"source": "Daggerheart SRD", "source": "Daggerheart SRD",
"page": 21, "page": 21,
"artist": "" "artist": ""
} },
"linkedClass": "Compendium.daggerheart.classes.Item.5ZnlJ5bEoyOTkUJv"
}, },
"effects": [], "effects": [],
"sort": 0, "sort": 0,
@ -46,10 +47,10 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.347", "coreVersion": "13.347",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.0.5", "systemVersion": "1.1.0",
"createdTime": 1754354451615, "createdTime": 1754354451615,
"modifiedTime": 1755392149951, "modifiedTime": 1755943523928,
"lastModifiedBy": "VZIeX2YDvX338Zvr" "lastModifiedBy": "tt3PwMBXcTLCtIQU"
}, },
"_key": "!items!y7ERWRIpJsdP9Re4" "_key": "!items!y7ERWRIpJsdP9Re4"
} }

View file

@ -30,7 +30,8 @@
"source": "Daggerheart SRD", "source": "Daggerheart SRD",
"page": 9, "page": 9,
"artist": "" "artist": ""
} },
"linkedClass": "Compendium.daggerheart.classes.Item.vegl3bFOq3pcFTWT"
}, },
"effects": [], "effects": [],
"ownership": { "ownership": {
@ -44,10 +45,10 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.347", "coreVersion": "13.347",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.0.5", "systemVersion": "1.1.0",
"createdTime": 1754174655078, "createdTime": 1754174655078,
"modifiedTime": 1755391551654, "modifiedTime": 1755943467695,
"lastModifiedBy": "VZIeX2YDvX338Zvr" "lastModifiedBy": "tt3PwMBXcTLCtIQU"
}, },
"_id": "XTSODVM8st75Os8M", "_id": "XTSODVM8st75Os8M",
"sort": 200000, "sort": 200000,

View file

@ -41,7 +41,7 @@
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
text-align: center; text-align: center;
font-size: 16px; font-size: var(--font-size-16);
margin: 0 4px; margin: 0 4px;
border: 1px solid light-dark(@dark-blue, @golden); border: 1px solid light-dark(@dark-blue, @golden);
border-radius: 6px; border-radius: 6px;
@ -135,7 +135,7 @@
align-items: center; align-items: center;
i { i {
font-size: 24px; font-size: var(--font-size-24);
} }
} }

View file

@ -75,7 +75,7 @@
label { label {
position: absolute; position: absolute;
font-size: 18px; font-size: var(--font-size-18);
font-weight: bold; font-weight: bold;
padding: 0 2px; padding: 0 2px;
background-image: url(../assets/parchments/dh-parchment-light.png); background-image: url(../assets/parchments/dh-parchment-light.png);
@ -141,7 +141,7 @@
.ancestry-preview-feature { .ancestry-preview-feature {
flex: 1; flex: 1;
font-size: 14px; font-size: var(--font-size-14);
white-space: wrap; white-space: wrap;
padding: 0 2px; padding: 0 2px;
border: 1px solid light-dark(@golden, @dark-blue); border: 1px solid light-dark(@golden, @dark-blue);
@ -178,7 +178,7 @@
legend { legend {
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
font-size: 28px; font-size: var(--font-size-28);
font-weight: bold; font-weight: bold;
padding: 0 8px; padding: 0 8px;
} }
@ -191,7 +191,7 @@
justify-content: center; justify-content: center;
legend { legend {
font-size: 20px; font-size: var(--font-size-20);
white-space: nowrap; white-space: nowrap;
} }
@ -343,7 +343,7 @@
border-radius: 50%; border-radius: 50%;
height: 20px; height: 20px;
width: 20px; width: 20px;
font-size: 14px; font-size: var(--font-size-14);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -358,7 +358,7 @@
.descriptor { .descriptor {
position: absolute; position: absolute;
bottom: -8px; bottom: -8px;
font-size: 12px; font-size: var(--font-size-12);
border-radius: 8px; border-radius: 8px;
width: 56px; width: 56px;
text-align: center; text-align: center;
@ -400,7 +400,7 @@
legend { legend {
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
font-size: 28px; font-size: var(--font-size-28);
font-weight: bold; font-weight: bold;
padding: 0 8px; padding: 0 8px;
white-space: nowrap; white-space: nowrap;
@ -444,7 +444,7 @@
label { label {
position: absolute; position: absolute;
top: -8px; top: -8px;
font-size: 12px; font-size: var(--font-size-12);
white-space: nowrap; white-space: nowrap;
border: 1px solid light-dark(@dark-blue, @golden); border: 1px solid light-dark(@dark-blue, @golden);
border-radius: 6px; border-radius: 6px;
@ -472,7 +472,7 @@
legend { legend {
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
font-size: 12px; font-size: var(--font-size-12);
} }
.suggestion-inner-container { .suggestion-inner-container {
@ -490,7 +490,7 @@
label { label {
position: absolute; position: absolute;
top: -2px; top: -2px;
font-size: 12px; font-size: var(--font-size-12);
} }
img { img {

View file

@ -76,7 +76,7 @@
border-radius: 6px; border-radius: 6px;
height: 26px; height: 26px;
padding: 0 1px; padding: 0 1px;
font-size: 18px; font-size: var(--font-size-18);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -108,7 +108,7 @@
border-radius: 6px; border-radius: 6px;
height: 26px; height: 26px;
padding: 0 4px; padding: 0 4px;
font-size: 18px; font-size: var(--font-size-18);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;

View file

@ -23,7 +23,7 @@
width: auto; width: auto;
opacity: 0.3; opacity: 0.3;
border-radius: 50%; border-radius: 50%;
font-size: 18px; font-size: var(--font-size-18);
font-weight: bold; font-weight: bold;
&:hover { &:hover {
@ -74,7 +74,7 @@
font-family: @font-subtitle; font-family: @font-subtitle;
font-style: normal; font-style: normal;
font-weight: 700; font-weight: 700;
font-size: 16px; font-size: var(--font-size-16);
line-height: 19px; line-height: 19px;
color: light-dark(@dark, @beige); color: light-dark(@dark, @beige);
@ -102,7 +102,7 @@
.label { .label {
font-style: normal; font-style: normal;
font-weight: 400; font-weight: 400;
font-size: 14px; font-size: var(--font-size-14);
line-height: 17px; line-height: 17px;
} }
@ -127,7 +127,7 @@
.label { .label {
font-style: normal; font-style: normal;
font-weight: 400; font-weight: 400;
font-size: 14px; font-size: var(--font-size-14);
line-height: 17px; line-height: 17px;
} }

View file

@ -35,7 +35,7 @@
gap: 4px; gap: 4px;
.activity-marker { .activity-marker {
font-size: 8px; font-size: 0.5rem;
flex: none; flex: none;
color: light-dark(@dark-blue, @golden); color: light-dark(@dark-blue, @golden);
margin-right: 4px; margin-right: 4px;
@ -54,7 +54,7 @@
} }
.activity-selected-marker { .activity-selected-marker {
font-size: 14px; font-size: var(--font-size-14);
border: 1px solid light-dark(@dark-blue, @golden); border: 1px solid light-dark(@dark-blue, @golden);
border-radius: 6px; border-radius: 6px;
color: light-dark(@dark, @beige); color: light-dark(@dark, @beige);
@ -71,7 +71,7 @@
display: grid; display: grid;
grid-template-columns: 1fr 1fr; grid-template-columns: 1fr 1fr;
gap: 4px; gap: 4px;
font-size: 12px; font-size: var(--font-size-12);
&.wide { &.wide {
grid-template-columns: 1fr 1fr 1fr 1fr; grid-template-columns: 1fr 1fr 1fr 1fr;

View file

@ -21,7 +21,7 @@
background: light-dark(@dark-blue-40, @golden-40); background: light-dark(@dark-blue-40, @golden-40);
border-radius: 3px; border-radius: 3px;
padding: 5px; padding: 5px;
font-size: 16px; font-size: var(--font-size-16);
gap: 4px; gap: 4px;
width: 100%; width: 100%;
@ -38,7 +38,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-size: 12px; font-size: var(--font-size-12);
} }
} }
} }
@ -96,7 +96,7 @@
width: 54px; width: 54px;
border-radius: 50%; border-radius: 50%;
border: 2px solid; border: 2px solid;
font-size: 48px; font-size: var(--font-size-48);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -133,7 +133,7 @@
.levelup-selections-title { .levelup-selections-title {
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
font-size: 22px; font-size: 1.375rem;
font-weight: bold; font-weight: bold;
padding: 0 12px; padding: 0 12px;
} }

View file

@ -41,7 +41,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
gap: 4px; gap: 4px;
font-size: 14px; font-size: var(--font-size-14);
color: light-dark(@dark, @beige); color: light-dark(@dark, @beige);
} }
@ -49,7 +49,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
gap: 4px; gap: 4px;
font-size: 16px; font-size: var(--font-size-16);
color: light-dark(@dark, @beige); color: light-dark(@dark, @beige);
margin-bottom: 5px; margin-bottom: 5px;
} }
@ -62,7 +62,7 @@
border: 2px solid; border: 2px solid;
border-radius: 3px; border-radius: 3px;
padding: 0 4px; padding: 0 4px;
font-size: 14px; font-size: var(--font-size-14);
color: light-dark(@dark, @beige); color: light-dark(@dark, @beige);
} }
} }

View file

@ -21,7 +21,7 @@
legend { legend {
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
font-size: 22px; font-size: 1.375rem;
font-weight: bold; font-weight: bold;
padding: 0 12px; padding: 0 12px;
} }
@ -60,7 +60,7 @@
} }
.checkbox-group-label { .checkbox-group-label {
font-size: 12px; font-size: var(--font-size-12);
font-style: italic; font-style: italic;
} }
} }

View file

@ -37,7 +37,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-size: 22px; font-size: 1.375rem;
opacity: 0.8; opacity: 0.8;
&.selected { &.selected {
@ -99,12 +99,12 @@
&:before, &:before,
&:after { &:after {
line-height: 12px; line-height: 12px;
font-size: 12px; font-size: var(--font-size-12);
} }
} }
i { i {
font-size: 10px; font-size: var(--font-size-10);
} }
} }
} }

View file

@ -71,7 +71,7 @@
color: @beige; color: @beige;
h4 { h4 {
font-size: 16px; font-size: var(--font-size-16);
font-weight: bold; font-weight: bold;
margin-bottom: 0; margin-bottom: 0;
font-family: @font-subtitle; font-family: @font-subtitle;
@ -86,7 +86,7 @@
.flavor-text { .flavor-text {
font-size: var(--font-size-12); font-size: var(--font-size-12);
line-height: 20px; line-height: 20px;
color: var(--color-dark-4); color: light-dark(@dark, @beige);
text-align: center; text-align: center;
display: block; display: block;
} }

View file

@ -50,7 +50,7 @@
.formula-label { .formula-label {
font-style: normal; font-style: normal;
font-weight: 500; font-weight: 500;
font-size: 14px; font-size: var(--font-size-14);
line-height: 17px; line-height: 17px;
white-space: nowrap; white-space: nowrap;
color: light-dark(@dark, @beige); color: light-dark(@dark, @beige);

View file

@ -165,7 +165,7 @@
z-index: 1; z-index: 1;
.remove { .remove {
font-size: 10px; font-size: var(--font-size-10);
} }
} }
} }
@ -400,7 +400,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
white-space: nowrap; white-space: nowrap;
font-size: 14px; font-size: var(--font-size-14);
font-weight: 400; font-weight: 400;
&.modifier-label { &.modifier-label {
@ -527,7 +527,7 @@
font-family: @font-body; font-family: @font-body;
margin-top: 4px; margin-top: 4px;
color: light-dark(#14142599, #efe6d850); color: light-dark(#14142599, #efe6d850);
font-size: 12px; font-size: var(--font-size-12);
padding-left: 3px; padding-left: 3px;
} }
} }
@ -541,7 +541,7 @@
text-align: center; text-align: center;
} }
.title-hint { .title-hint {
font-size: 12px; font-size: var(--font-size-12);
font-variant: small-caps; font-variant: small-caps;
text-align: center; text-align: center;
} }
@ -605,7 +605,7 @@
align-items: center; align-items: center;
label { label {
font-size: 16px; font-size: var(--font-size-16);
} }
.form-fields { .form-fields {
@ -776,7 +776,7 @@
.preview-text-container { .preview-text-container {
padding: 10px 0; padding: 10px 0;
text-align: center; text-align: center;
font-size: 16px; font-size: var(--font-size-16);
color: light-dark(@beige, @dark); color: light-dark(@beige, @dark);
background-image: url(../assets/parchments/dh-parchment-light.png); background-image: url(../assets/parchments/dh-parchment-light.png);
border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px;
@ -799,14 +799,14 @@
justify-content: center; justify-content: center;
.preview-add-icon { .preview-add-icon {
font-size: 40px; font-size: var(--font-size-40);
color: light-dark(@dark-blue-50, @beige-50); color: light-dark(@dark-blue-50, @beige-50);
} }
.preview-empty-subtext { .preview-empty-subtext {
position: absolute; position: absolute;
bottom: 5%; bottom: 5%;
font-size: 10px; font-size: var(--font-size-10);
font-variant: small-caps; font-variant: small-caps;
text-align: center; text-align: center;
font-style: italic; font-style: italic;
@ -821,7 +821,7 @@
width: 54px; width: 54px;
border-radius: 50%; border-radius: 50%;
border: 2px solid; border: 2px solid;
font-size: 48px; font-size: var(--font-size-48);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;

View file

@ -0,0 +1,14 @@
.measured-template-button,
.enriched-damage-button,
.duality-roll-button {
display: inline;
&.inline {
min-height: unset;
height: 18px;
}
i {
font-size: 12px;
}
}

View file

@ -0,0 +1,12 @@
.drag-area {
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
width: 100%;
height: 40px;
border: 1px dashed light-dark(@dark-blue-50, @beige-50);
border-radius: 3px;
color: light-dark(@dark-blue-50, @beige-50);
font-family: @font-body;
}

View file

@ -2,6 +2,8 @@
@import './dialog.less'; @import './dialog.less';
@import './chat.less'; @import './chat.less';
@import './elements.less'; @import './elements.less';
@import './enrichment.less';
@import './global.less';
@import './tab-navigation.less'; @import './tab-navigation.less';
@import './tab-form-footer.less'; @import './tab-form-footer.less';
@import './tab-actions.less'; @import './tab-actions.less';

View file

@ -105,7 +105,7 @@
align-self: center; align-self: center;
.item-name { .item-name {
font-size: 14px; font-size: var(--font-size-14);
.expanded-icon { .expanded-icon {
display: none; display: none;
@ -121,9 +121,10 @@
.label { .label {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: center;
align-items: center; align-items: center;
font-size: 12px; font-size: var(--font-size-12);
flex-wrap: wrap;
justify-content: start;
} }
.tag { .tag {
@ -179,18 +180,18 @@
overflow: hidden; overflow: hidden;
h1 { h1 {
font-size: 32px; font-size: var(--font-size-32);
} }
h2 { h2 {
font-size: 28px; font-size: var(--font-size-28);
font-weight: 600; font-weight: 600;
} }
h3 { h3 {
font-size: 20px; font-size: var(--font-size-20);
font-weight: 600; font-weight: 600;
} }
h4 { h4 {
font-size: 16px; font-size: var(--font-size-16);
color: @beige; color: @beige;
font-weight: 600; font-weight: 600;
} }
@ -231,7 +232,7 @@
label { label {
color: light-dark(white, black); color: light-dark(white, black);
filter: drop-shadow(0 0 1px light-dark(@dark-blue, @golden)); filter: drop-shadow(0 0 1px light-dark(@dark-blue, @golden));
font-size: 18px; font-size: var(--font-size-18);
} }
img { img {
@ -243,7 +244,7 @@
text-shadow: 0 0 3px white; text-shadow: 0 0 3px white;
filter: drop-shadow(0 1px white); filter: drop-shadow(0 1px white);
color: black; color: black;
font-size: 26px; font-size: 1.625rem;
} }
} }
} }
@ -310,7 +311,7 @@
.card-name { .card-name {
font-style: normal; font-style: normal;
font-weight: 400; font-weight: 400;
font-size: 12px; font-size: var(--font-size-12);
line-height: 15px; line-height: 15px;
color: @beige; color: @beige;
@ -351,7 +352,7 @@
gap: 4px; gap: 4px;
.resource-edit { .resource-edit {
font-size: 14px; font-size: var(--font-size-14);
} }
} }
@ -363,7 +364,7 @@
i { i {
flex: none; flex: none;
font-size: 14px; font-size: var(--font-size-14);
} }
input { input {
@ -383,7 +384,7 @@
color: light-dark(white, black); color: light-dark(white, black);
filter: drop-shadow(0 0 1px light-dark(@dark-blue, @golden)); filter: drop-shadow(0 0 1px light-dark(@dark-blue, @golden));
z-index: 2; z-index: 2;
font-size: 18px; font-size: var(--font-size-18);
cursor: pointer; cursor: pointer;
} }
@ -397,7 +398,7 @@
text-shadow: 0 0 3px white; text-shadow: 0 0 3px white;
filter: drop-shadow(0 1px white); filter: drop-shadow(0 1px white);
color: black; color: black;
font-size: 26px; font-size: 1.625rem;
} }
} }
} }

View file

@ -35,7 +35,7 @@
width: 80%; width: 80%;
.item-name input[type='text'] { .item-name input[type='text'] {
font-size: 32px; font-size: var(--font-size-32);
height: 42px; height: 42px;
text-align: center; text-align: center;
width: 90%; width: 90%;
@ -103,7 +103,7 @@
transition: all 0.3s ease; transition: all 0.3s ease;
.recall-label { .recall-label {
font-size: 14px; font-size: var(--font-size-14);
opacity: 0; opacity: 0;
margin-right: 0.3rem; margin-right: 0.3rem;
transition: all 0.3s ease; transition: all 0.3s ease;
@ -141,7 +141,7 @@
.item-name { .item-name {
input[type='text'] { input[type='text'] {
font-size: 32px; font-size: var(--font-size-32);
height: 42px; height: 42px;
text-align: center; text-align: center;
width: 90%; width: 90%;

View file

@ -12,18 +12,18 @@
scrollbar-width: thin; scrollbar-width: thin;
scrollbar-color: light-dark(@dark-blue, @golden) transparent; scrollbar-color: light-dark(@dark-blue, @golden) transparent;
h1 { h1 {
font-size: 32px; font-size: var(--font-size-32);
} }
h2 { h2 {
font-size: 28px; font-size: var(--font-size-28);
font-weight: 600; font-weight: 600;
} }
h3 { h3 {
font-size: 20px; font-size: var(--font-size-20);
font-weight: 600; font-weight: 600;
} }
h4 { h4 {
font-size: 16px; font-size: var(--font-size-16);
color: @beige; color: @beige;
font-weight: 600; font-weight: 600;
} }

View file

@ -33,7 +33,7 @@
div { div {
filter: drop-shadow(0 0 3px black); filter: drop-shadow(0 0 3px black);
text-shadow: 0 0 3px black; text-shadow: 0 0 3px black;
font-size: 12px; font-size: var(--font-size-12);
} }
input { input {

View file

@ -34,17 +34,5 @@
width: 100%; width: 100%;
} }
} }
.adversaries-dragger {
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
width: 100%;
height: 40px;
border: 1px dashed light-dark(@dark-blue-50, @beige-50);
border-radius: 3px;
color: light-dark(@dark-blue-50, @beige-50);
}
} }
} }

View file

@ -10,7 +10,7 @@
font-family: @font-subtitle; font-family: @font-subtitle;
font-style: normal; font-style: normal;
font-weight: 700; font-weight: 700;
font-size: 24px; font-size: var(--font-size-24);
margin: 0; margin: 0;
text-align: center; text-align: center;
color: light-dark(@dark-blue, @golden); color: light-dark(@dark-blue, @golden);

View file

@ -18,7 +18,7 @@
flex: 1; flex: 1;
input[type='text'] { input[type='text'] {
font-size: 32px; font-size: var(--font-size-32);
height: 42px; height: 42px;
text-align: start; text-align: start;
border: 1px solid transparent; border: 1px solid transparent;
@ -42,7 +42,7 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
padding: 3px 5px; padding: 3px 5px;
font-size: 12px; font-size: var(--font-size-12);
font: @font-body; font: @font-body;
background: light-dark(@dark-15, @beige-15); background: light-dark(@dark-15, @beige-15);
@ -55,7 +55,7 @@
flex-direction: row; flex-direction: row;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
font-size: 12px; font-size: var(--font-size-12);
} }
} }

View file

@ -74,7 +74,7 @@
height: 30px; height: 30px;
h4 { h4 {
font-size: 14px; font-size: var(--font-size-14);
font-weight: bold; font-weight: bold;
text-transform: uppercase; text-transform: uppercase;
color: light-dark(@dark-blue, @golden); color: light-dark(@dark-blue, @golden);
@ -255,7 +255,7 @@
font-weight: bold; font-weight: bold;
text-align: center; text-align: center;
line-height: 18px; line-height: 18px;
font-size: 12px; font-size: var(--font-size-12);
color: light-dark(@beige, @dark-blue); color: light-dark(@beige, @dark-blue);
} }
} }
@ -295,7 +295,7 @@
align-items: center; align-items: center;
h3 { h3 {
font-size: 20px; font-size: var(--font-size-20);
} }
} }
.items-list { .items-list {
@ -315,7 +315,7 @@
align-items: center; align-items: center;
h3 { h3 {
font-size: 20px; font-size: var(--font-size-20);
} }
} }
@ -337,7 +337,7 @@
.experience-name { .experience-name {
width: 180px; width: 180px;
text-align: start; text-align: start;
font-size: 14px; font-size: var(--font-size-14);
color: light-dark(@dark, @beige); color: light-dark(@dark, @beige);
} }
} }
@ -345,7 +345,7 @@
.experience-value { .experience-value {
height: 25px; height: 25px;
width: 35px; width: 35px;
font-size: 14px; font-size: var(--font-size-14);
color: light-dark(@dark, @beige); color: light-dark(@dark, @beige);
align-content: center; align-content: center;
text-align: center; text-align: center;

View file

@ -41,7 +41,7 @@
flex: 1; flex: 1;
input[type='text'] { input[type='text'] {
font-size: 32px; font-size: var(--font-size-32);
height: 42px; height: 42px;
text-align: start; text-align: start;
border: 1px solid transparent; border: 1px solid transparent;
@ -72,7 +72,7 @@
.level-button { .level-button {
color: light-dark(@dark, @beige); color: light-dark(@dark, @beige);
font-size: 18px; font-size: var(--font-size-18);
line-height: 1; line-height: 1;
min-height: unset; min-height: unset;
height: min-content; height: min-content;
@ -97,7 +97,7 @@
justify-content: space-between; justify-content: space-between;
padding: 5px 0; padding: 5px 0;
margin-bottom: 10px; margin-bottom: 10px;
font-size: 12px; font-size: var(--font-size-12);
color: light-dark(@dark-blue, @golden); color: light-dark(@dark-blue, @golden);
.missing-header-feature { .missing-header-feature {
@ -158,7 +158,7 @@
height: 30px; height: 30px;
h4 { h4 {
font-size: 14px; font-size: var(--font-size-14);
font-weight: bold; font-weight: bold;
text-transform: uppercase; text-transform: uppercase;
color: light-dark(@dark-blue, @golden); color: light-dark(@dark-blue, @golden);
@ -170,7 +170,7 @@
gap: 5px; gap: 5px;
.label { .label {
font-size: 14px; font-size: var(--font-size-14);
font-weight: bold; font-weight: bold;
text-transform: uppercase; text-transform: uppercase;
color: light-dark(@dark-blue, @golden); color: light-dark(@dark-blue, @golden);
@ -205,7 +205,7 @@
align-items: center; align-items: center;
padding-top: 5px; padding-top: 5px;
color: light-dark(@dark-blue, @golden); color: light-dark(@dark-blue, @golden);
font-size: 14px; font-size: var(--font-size-14);
font-weight: 600; font-weight: 600;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -213,14 +213,14 @@
i { i {
line-height: 17px; line-height: 17px;
font-size: 10px; font-size: var(--font-size-10);
} }
} }
.trait-value { .trait-value {
font-style: normal; font-style: normal;
font-weight: 400; font-weight: 400;
font-size: 20px; font-size: var(--font-size-20);
text-align: center; text-align: center;
} }
} }

View file

@ -26,10 +26,6 @@
outline: 2px solid light-dark(@dark, @golden); outline: 2px solid light-dark(@dark, @golden);
} }
&:placeholder {
color: light-dark(@dark-blue-50, @beige-50);
}
&::-webkit-search-cancel-button { &::-webkit-search-cancel-button {
-webkit-appearance: none; -webkit-appearance: none;
display: none; display: none;
@ -41,7 +37,7 @@
height: 32px; height: 32px;
position: absolute; position: absolute;
right: 20px; right: 20px;
font-size: 16px; font-size: var(--font-size-16);
z-index: 1; z-index: 1;
color: light-dark(@dark-blue-50, @beige-50); color: light-dark(@dark-blue-50, @beige-50);
} }

View file

@ -26,10 +26,6 @@
outline: 2px solid light-dark(@dark, @golden); outline: 2px solid light-dark(@dark, @golden);
} }
&:placeholder {
color: light-dark(@dark-blue-50, @beige-50);
}
&::-webkit-search-cancel-button { &::-webkit-search-cancel-button {
-webkit-appearance: none; -webkit-appearance: none;
display: none; display: none;
@ -41,7 +37,7 @@
height: 32px; height: 32px;
position: absolute; position: absolute;
right: 20px; right: 20px;
font-size: 16px; font-size: var(--font-size-16);
z-index: 1; z-index: 1;
color: light-dark(@dark-blue-50, @beige-50); color: light-dark(@dark-blue-50, @beige-50);
} }

View file

@ -11,6 +11,21 @@
padding-bottom: 0; padding-bottom: 0;
overflow-x: auto; overflow-x: auto;
&.viewMode {
button:not(.btn-toggle-view),
input:not(.search),
.controls,
.character-sidebar-sheet,
.img-portait,
.name-row,
.hope-section,
.downtime-section,
.character-traits,
.card-list {
pointer-events: none;
}
}
.character-sidebar-sheet { .character-sidebar-sheet {
grid-row: 1 / span 2; grid-row: 1 / span 2;
grid-column: 1; grid-column: 1;

View file

@ -89,7 +89,7 @@
transition: all 0.3s ease; transition: all 0.3s ease;
.spellcast-label { .spellcast-label {
font-size: 14px; font-size: var(--font-size-14);
opacity: 0; opacity: 0;
margin-right: 0.3rem; margin-right: 0.3rem;
transition: all 0.3s ease; transition: all 0.3s ease;
@ -258,7 +258,7 @@
text-align: center; text-align: center;
line-height: 18px; line-height: 18px;
color: light-dark(@beige, @dark-blue); color: light-dark(@beige, @dark-blue);
font-size: 12px; font-size: var(--font-size-12);
} }
} }
.status-value { .status-value {
@ -402,7 +402,7 @@
font-weight: bold; font-weight: bold;
text-align: center; text-align: center;
line-height: 18px; line-height: 18px;
font-size: 12px; font-size: var(--font-size-12);
color: light-dark(@beige, @dark-blue); color: light-dark(@beige, @dark-blue);
} }
} }
@ -424,7 +424,7 @@
height: 30px; height: 30px;
h4 { h4 {
font-size: 14px; font-size: var(--font-size-14);
font-weight: bold; font-weight: bold;
text-transform: uppercase; text-transform: uppercase;
color: light-dark(@dark-blue, @golden); color: light-dark(@dark-blue, @golden);
@ -490,7 +490,7 @@
.experience-value { .experience-value {
height: 25px; height: 25px;
width: 35px; width: 35px;
font-size: 14px; font-size: var(--font-size-14);
color: light-dark(@dark, @beige); color: light-dark(@dark, @beige);
align-content: center; align-content: center;
text-align: center; text-align: center;

View file

@ -16,7 +16,7 @@
width: 100%; width: 100%;
h3 { h3 {
font-size: 20px; font-size: var(--font-size-20);
} }
} }
.items-list { .items-list {
@ -58,7 +58,7 @@
.experience-name { .experience-name {
width: 180px; width: 180px;
text-align: start; text-align: start;
font-size: 14px; font-size: var(--font-size-14);
color: light-dark(@dark, @beige); color: light-dark(@dark, @beige);
} }
} }
@ -66,7 +66,7 @@
.experience-value { .experience-value {
height: 25px; height: 25px;
width: 35px; width: 35px;
font-size: 14px; font-size: var(--font-size-14);
color: light-dark(@dark, @beige); color: light-dark(@dark, @beige);
align-content: center; align-content: center;
text-align: center; text-align: center;
@ -77,4 +77,17 @@
} }
} }
} }
.action-section {
display: flex;
padding: 0 10px;
margin-top: 20px;
width: 100%;
button {
height: 40px;
width: 100%;
font-weight: 600;
}
}
} }

Some files were not shown because too many files have changed in this diff Show more