mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 06:26:13 +01:00
Fixed sceneConfig, sceneNavigation and SceneEnvironments
This commit is contained in:
parent
2c36da8433
commit
8c762f3f3e
4 changed files with 64 additions and 3 deletions
|
|
@ -62,7 +62,15 @@ export default class DhSceneConfigSettings extends foundry.applications.sheets.S
|
||||||
}
|
}
|
||||||
|
|
||||||
async _onDrop(event) {
|
async _onDrop(event) {
|
||||||
|
event.stopPropagation();
|
||||||
const data = foundry.applications.ux.TextEditor.implementation.getDragEventData(event);
|
const data = foundry.applications.ux.TextEditor.implementation.getDragEventData(event);
|
||||||
|
if (data.type === 'Level') {
|
||||||
|
const level = await foundry.documents.Level.fromDropData(data);
|
||||||
|
if (level?.parent === this.document) return this._onSortLevel(event, level);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const item = await foundry.utils.fromUuid(data.uuid);
|
const item = await foundry.utils.fromUuid(data.uuid);
|
||||||
if (item instanceof game.system.api.documents.DhpActor && item.type === 'environment') {
|
if (item instanceof game.system.api.documents.DhpActor && item.type === 'environment') {
|
||||||
let sceneUuid = data.uuid;
|
let sceneUuid = data.uuid;
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ export default class DhSceneNavigation extends foundry.applications.ui.SceneNavi
|
||||||
const environments = daggerheartInfo.sceneEnvironments.filter(
|
const environments = daggerheartInfo.sceneEnvironments.filter(
|
||||||
x => x && x.testUserPermission(game.user, 'LIMITED')
|
x => x && x.testUserPermission(game.user, 'LIMITED')
|
||||||
);
|
);
|
||||||
const hasEnvironments = environments.length > 0 && x.isView;
|
const hasEnvironments = environments.length > 0 && x.active;
|
||||||
return {
|
return {
|
||||||
...x,
|
...x,
|
||||||
hasEnvironments,
|
hasEnvironments,
|
||||||
|
|
@ -39,9 +39,10 @@ export default class DhSceneNavigation extends foundry.applications.ui.SceneNavi
|
||||||
environments: environments
|
environments: environments
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
context.scenes.active = extendScenes(context.scenes.active);
|
context.scenes.active = extendScenes(context.scenes.active);
|
||||||
context.scenes.inactive = extendScenes(context.scenes.inactive);
|
context.scenes.inactive = extendScenes(context.scenes.inactive);
|
||||||
|
context.scenes.viewed = context.scenes.viewed ? extendScenes([context.scenes.viewed])[0] : null;
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,8 @@
|
||||||
|
|
||||||
.application.sheet.scene-config {
|
.application.sheet.scene-config {
|
||||||
.sheet-tabs.tabs {
|
.sheet-tabs.tabs {
|
||||||
|
font-size: 12px;
|
||||||
|
|
||||||
a[data-tab='dh'] {
|
a[data-tab='dh'] {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,40 @@
|
||||||
|
|
||||||
|
|
||||||
<nav id="scene-navigation" aria-roledescription="{{localize "SCENE_NAVIGATION.LABEL"}}" data-tooltip-direction="RIGHT">
|
<nav id="scene-navigation" aria-roledescription="{{localize "SCENE_NAVIGATION.LABEL"}}" data-tooltip-direction="RIGHT">
|
||||||
{{#if canExpand}}
|
{{#if canExpand}}
|
||||||
<a id="scene-navigation-expand" class="ui-control" data-action="toggleExpand">
|
<a id="scene-navigation-expand" class="ui-control" data-action="toggleExpand">
|
||||||
<i class="fa-solid fa-caret-down" inert></i>
|
<i class="fa-solid fa-caret-down" inert></i>
|
||||||
</a>
|
</a>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{#with scenes.viewed}}
|
||||||
|
<menu id="scene-navigation-viewed" class="scene-navigation-menu flexcol">
|
||||||
|
{{> ".scene" }}
|
||||||
|
</menu>
|
||||||
|
{{/with}}
|
||||||
|
<menu id="scene-navigation-levels" class="scene-levels scene-navigation-menu flexcol levels-{{ scenes.levels.length }}">
|
||||||
|
{{#each scenes.levels}}
|
||||||
|
<li class="level-row">
|
||||||
|
{{#with button}}
|
||||||
|
<button type="button" class="ui-control icon fa-solid {{ css }}" data-action="cycleLevel"
|
||||||
|
data-direction="{{ direction }}" aria-label="{{ label }}"></button>
|
||||||
|
{{/with}}
|
||||||
|
<div class="ui-control scene scene-level {{ css }}" data-scene-id="{{ sceneId }}" data-level-id="{{ id }}" data-action="viewLevel">
|
||||||
|
<span class="ellipsis">{{ name }}</span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
{{/each}}
|
||||||
|
</menu>
|
||||||
<menu id="scene-navigation-active" class="scene-navigation-menu flexcol">
|
<menu id="scene-navigation-active" class="scene-navigation-menu flexcol">
|
||||||
|
{{#each scenes.active}}
|
||||||
|
{{> ".scene" }}
|
||||||
|
{{/each}}
|
||||||
|
</menu>
|
||||||
|
<menu id="scene-navigation-inactive" class="scene-navigation-menu flexcol">
|
||||||
|
{{#each scenes.inactive as |scene|}}
|
||||||
|
{{> ".scene" }}
|
||||||
|
{{/each}}
|
||||||
|
</menu>
|
||||||
|
{{!-- <menu id="scene-navigation-active" class="scene-navigation-menu flexcol">
|
||||||
{{#each scenes.active as |scene|}}
|
{{#each scenes.active as |scene|}}
|
||||||
<li class="scene-wrapper">
|
<li class="scene-wrapper">
|
||||||
<div class="ui-control scene {{scene.cssClass}}" data-scene-id="{{scene.id}}" data-action="viewScene" {{#if scene.tooltip}}data-tooltip-text="{{scene.tooltip}}"{{/if}}>
|
<div class="ui-control scene {{scene.cssClass}}" data-scene-id="{{scene.id}}" data-action="viewScene" {{#if scene.tooltip}}data-tooltip-text="{{scene.tooltip}}"{{/if}}>
|
||||||
|
|
@ -32,5 +62,25 @@
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</menu>
|
</menu> --}}
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
{{#*inline ".scene"}}
|
||||||
|
<li class="scene-wrapper">
|
||||||
|
<div class="ui-control scene {{ cssClass }}" data-scene-id="{{ id }}" data-action="viewScene" {{#if tooltip}}data-tooltip-text="{{ tooltip }}"{{/if}}>
|
||||||
|
<span class="scene-name ellipsis">{{ name }}</span>
|
||||||
|
{{#if users}}
|
||||||
|
<ul class="scene-players">
|
||||||
|
{{#each users}}
|
||||||
|
<li class="scene-player" style="--color-bg: {{ color }}; --color-border: {{ border }}" data-tooltip
|
||||||
|
aria-label="{{ name }}">{{ letter }}</li>
|
||||||
|
{{/each}}
|
||||||
|
</ul>
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
|
{{#if hasEnvironments}}
|
||||||
|
<button class="ui-control scene-environment {{#if (gt environments.length 1)}}many-environments{{/if}}" data-action="openSceneEnvironment" data-scene-id="{{id}}"><img src="{{environmentImage}}" /> </button>
|
||||||
|
{{/if}}
|
||||||
|
</li>
|
||||||
|
{{/inline}}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue