mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-05 20:34:15 +02:00
Show actor sheet when clicking actors in item browser (#1930)
This commit is contained in:
parent
de0ab9d047
commit
c2f8b34ef2
3 changed files with 20 additions and 10 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import { getDocFromElement } from '../../helpers/utils.mjs';
|
||||
import { RefreshType, socketEvent } from '../../systemRegistration/socket.mjs';
|
||||
|
||||
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
|
||||
|
|
@ -47,7 +48,8 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) {
|
|||
expandContent: this.expandContent,
|
||||
resetFilters: this.resetFilters,
|
||||
sortList: this.sortList,
|
||||
openSettings: this.openSettings
|
||||
openSettings: this.openSettings,
|
||||
viewSheet: this.#onViewSheet
|
||||
},
|
||||
position: {
|
||||
left: 100,
|
||||
|
|
@ -306,7 +308,8 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) {
|
|||
{
|
||||
items: this.items,
|
||||
menu: this.selectedMenu,
|
||||
formatLabel: this.formatLabel
|
||||
formatLabel: this.formatLabel,
|
||||
viewSheet: this.items[0] instanceof Actor
|
||||
}
|
||||
);
|
||||
|
||||
|
|
@ -568,6 +571,11 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) {
|
|||
}
|
||||
}
|
||||
|
||||
static async #onViewSheet(_, target) {
|
||||
const document = await getDocFromElement(target);
|
||||
document?.sheet?.render(true);
|
||||
}
|
||||
|
||||
_createDragProcess() {
|
||||
new foundry.applications.ux.DragDrop.implementation({
|
||||
dragSelector: '.item-container',
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@
|
|||
}
|
||||
|
||||
.item-list-header,
|
||||
.item-list [data-action='expandContent'] {
|
||||
.item-list .item-info[data-action] {
|
||||
display: flex;
|
||||
|
||||
> * {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{{#each items}}
|
||||
<div class="item-container" data-item-uuid="{{uuid}}" draggable="true">
|
||||
<div class="item-header">
|
||||
<div class="item-info" data-action="expandContent">
|
||||
<div class="item-info" {{#if @root.viewSheet}}data-action="viewSheet"{{else}}data-action="expandContent"{{/if}}>
|
||||
<img src="{{img}}" data-item-key="img" class="item-list-img">
|
||||
<span data-item-key="name" class="item-list-name">{{name}}</span>
|
||||
{{#each ../menu.data.columns}}
|
||||
|
|
@ -9,11 +9,13 @@
|
|||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-desc extensible">
|
||||
<span class="wrapper">
|
||||
{{{system.enrichedTags}}}
|
||||
{{{system.enrichedDescription}}}
|
||||
</span>
|
||||
</div>
|
||||
{{#unless viewSheet}}
|
||||
<div class="item-desc extensible">
|
||||
<span class="wrapper">
|
||||
{{{system.enrichedTags}}}
|
||||
{{{system.enrichedDescription}}}
|
||||
</span>
|
||||
</div>
|
||||
{{/unless}}
|
||||
</div>
|
||||
{{/each}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue