[Feature] Loadout&Domains Homebrew (#529)

* Removed ChatTheme from settings

* 0 or blank loadoutSize now means unlimited

* Added Homebrew maxDomains
This commit is contained in:
WBHarry 2025-08-02 22:36:21 +02:00 committed by GitHub
parent 2e5337c5c5
commit ee5c3a9322
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 74 additions and 65 deletions

View file

@ -1,4 +1,4 @@
import DhAppearance, { DualityRollColor } from '../../data/settings/Appearance.mjs';
import DhAppearance from '../../data/settings/Appearance.mjs';
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
@ -96,11 +96,6 @@ export default class DHAppearanceSettings extends HandlebarsApplicationMixin(App
static async save() {
await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance, this.settings.toObject());
document.body.classList.toggle(
'theme-colorful',
game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance).dualityColorScheme ===
DualityRollColor.colorful.value
);
this.close();
}

View file

@ -266,9 +266,7 @@ export default class CharacterSheet extends DHBaseActorSheet {
const doc = await getDocFromElement(target);
const actorLoadout = doc.actor.system.loadoutSlot;
if (actorLoadout.available) return doc.update({ 'system.inVault': false });
ui.notifications.warn(
game.i18n.format('DAGGERHEART.UI.Notifications.loadoutMaxReached', { max: actorLoadout.max })
);
ui.notifications.warn(game.i18n.localize('DAGGERHEART.UI.Notifications.loadoutMaxReached'));
}
},
{
@ -686,6 +684,11 @@ export default class CharacterSheet extends DHBaseActorSheet {
*/
static async #toggleVault(_event, button) {
const doc = await getDocFromElement(button);
const { available } = this.document.system.loadoutSlot;
if (doc.system.inVault && !available) {
return ui.notifications.warn(game.i18n.localize('DAGGERHEART.UI.Notifications.loadoutMaxReached'));
}
await doc?.update({ 'system.inVault': !doc.system.inVault });
}

View file

@ -15,7 +15,10 @@ export default class ClassSheet extends DHBaseItemSheet {
{
selector: '.domain-input',
options: () => CONFIG.DH.DOMAIN.domains,
callback: ClassSheet.#onDomainSelect
callback: ClassSheet.#onDomainSelect,
tagifyOptions: {
maxTags: () => game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).maxDomains
}
}
],
dragDrop: [