mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-14 20:51:07 +01:00
Compendium browser per type (#1103)
* Compendium Browser per type * Sort number column * Re-add subclass config * Sidebar buttons * Add Characters folder * Css * Done
This commit is contained in:
parent
1eb3ff11c0
commit
9dd773001d
17 changed files with 542 additions and 300 deletions
|
|
@ -1,6 +1,5 @@
|
|||
import { abilities } from '../../config/actorConfig.mjs';
|
||||
import { burden } from '../../config/generalConfig.mjs';
|
||||
import { ItemBrowser } from '../ui/itemBrowser.mjs';
|
||||
import { createEmbeddedItemsWithEffects, createEmbeddedItemWithEffects } from '../../helpers/utils.mjs';
|
||||
|
||||
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
|
||||
|
|
@ -46,8 +45,6 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl
|
|||
};
|
||||
|
||||
this._dragDrop = this._createDragDropHandlers();
|
||||
|
||||
this.itemBrowser = null;
|
||||
}
|
||||
|
||||
get title() {
|
||||
|
|
@ -425,8 +422,7 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl
|
|||
equipment = ['armor', 'weapon'];
|
||||
|
||||
const presets = {
|
||||
compendium: 'daggerheart',
|
||||
folder: equipment.includes(type) ? 'equipments' : type,
|
||||
folder: equipment.includes(type) ? `equipments.folders.${type}s` : type,
|
||||
render: {
|
||||
noFolder: true
|
||||
}
|
||||
|
|
@ -449,7 +445,7 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl
|
|||
'type': { key: 'type', value: type }
|
||||
};
|
||||
|
||||
return (this.itemBrowser = await new ItemBrowser({ presets }).render({ force: true }));
|
||||
ui.compendiumBrowser.open(presets);
|
||||
}
|
||||
|
||||
static async viewItem(_, target) {
|
||||
|
|
@ -567,7 +563,7 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl
|
|||
{ overwrite: true }
|
||||
);
|
||||
|
||||
if (this.itemBrowser) this.itemBrowser.close();
|
||||
if (ui.compendiumBrowser) ui.compendiumBrowser.close();
|
||||
this.close();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue