mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
[Feature] Loadout&Domains Homebrew (#529)
* Removed ChatTheme from settings * 0 or blank loadoutSize now means unlimited * Added Homebrew maxDomains
This commit is contained in:
parent
2e5337c5c5
commit
ee5c3a9322
14 changed files with 74 additions and 65 deletions
|
|
@ -19,7 +19,7 @@ export default class DHClass extends BaseDataItem {
|
|||
const fields = foundry.data.fields;
|
||||
return {
|
||||
...super.defineSchema(),
|
||||
domains: new fields.ArrayField(new fields.StringField(), { max: 2 }),
|
||||
domains: new fields.ArrayField(new fields.StringField()),
|
||||
classItems: new ForeignDocumentUUIDArrayField({ type: 'Item', required: false }),
|
||||
hitPoints: new fields.NumberField({
|
||||
required: true,
|
||||
|
|
@ -123,6 +123,14 @@ export default class DHClass extends BaseDataItem {
|
|||
const allowed = await super._preUpdate(changed, options, userId);
|
||||
if (allowed === false) return false;
|
||||
|
||||
if (changed.system?.domains) {
|
||||
const maxDomains = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).maxDomains;
|
||||
if (changed.system.domains.length > maxDomains) {
|
||||
ui.notifications.warn(game.i18n.localize('DAGGERHEART.UI.Notifications.domainMaxReached'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
const paths = [
|
||||
'subclasses',
|
||||
'characterGuide.suggestedPrimaryWeapon',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue