mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 22:46:12 +01:00
Merge 2123ae1965 into 17aa0680d2
This commit is contained in:
commit
374ef6040f
12 changed files with 335 additions and 181 deletions
|
|
@ -532,6 +532,40 @@ export default function DHApplicationMixin(Base) {
|
|||
callback: async target => (await getDocFromElement(target)).toChat(this.document.uuid)
|
||||
});
|
||||
|
||||
options.push({
|
||||
name: 'Unfavorite',
|
||||
icon: 'fa-regular fa-star',
|
||||
condition: target => {
|
||||
const doc = getDocFromElementSync(target);
|
||||
const isFavorited = this.document.system.sidebarFavorites.some(x => x.id === doc.id);
|
||||
return this.document.type === 'character' && isFavorited;
|
||||
},
|
||||
callback: async (target, _event) => {
|
||||
const doc = await getDocFromElement(target);
|
||||
this.document.update({
|
||||
'system.sidebarFavorites': this.document.system.sidebarFavorites.filter(x => x.id !== doc.id)
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
options.push({
|
||||
name: 'Favorite',
|
||||
icon: 'fa-solid fa-star',
|
||||
condition: target => {
|
||||
const doc = getDocFromElementSync(target);
|
||||
const isFavorited = this.document.system.sidebarFavorites.some(x => x.id === doc.id);
|
||||
return (
|
||||
!(doc instanceof game.system.api.documents.DhActiveEffect) &&
|
||||
this.document.type === 'character' &&
|
||||
!isFavorited
|
||||
);
|
||||
},
|
||||
callback: async (target, _event) => {
|
||||
const doc = await getDocFromElement(target);
|
||||
this.document.setFavoriteItem(doc, true);
|
||||
}
|
||||
});
|
||||
|
||||
if (deletable)
|
||||
options.push({
|
||||
name: 'CONTROLS.CommonDelete',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue