mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-11 19:25:21 +01:00
Max Cards loadout switch & Homebrew setting (#412)
* Max Cards loadout switch & Homebrew setting * Fixes * Fixes
This commit is contained in:
parent
2a4777f1a0
commit
dddee78356
6 changed files with 42 additions and 4 deletions
|
|
@ -259,7 +259,12 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
|||
name: 'toLoadout',
|
||||
icon: 'fa-solid fa-arrow-up',
|
||||
condition: target => getDocFromElement(target).system.inVault,
|
||||
callback: target => getDocFromElement(target).update({ 'system.inVault': false })
|
||||
callback: target => {
|
||||
const doc = getDocFromElement(target),
|
||||
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 }))
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'toVault',
|
||||
|
|
@ -729,7 +734,7 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
|||
const item = await Item.implementation.fromDropData(data);
|
||||
const itemData = item.toObject();
|
||||
|
||||
if (item.type === 'domainCard' && this.document.system.domainCards.loadout.length >= 5) {
|
||||
if (item.type === 'domainCard' && !this.document.system.loadoutSlot.available) {
|
||||
itemData.system.inVault = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue