mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-24 00:13:39 +02:00
.
This commit is contained in:
parent
23a497bab8
commit
2e4d3de379
5 changed files with 90 additions and 44 deletions
|
|
@ -231,7 +231,8 @@
|
||||||
"viewParty": "View Party",
|
"viewParty": "View Party",
|
||||||
"InvalidOldCharacterImportTitle": "Old Character Import",
|
"InvalidOldCharacterImportTitle": "Old Character Import",
|
||||||
"InvalidOldCharacterImportText": "Character data exported prior to system version 1.1 will not generate a complete character. Do you wish to continue?",
|
"InvalidOldCharacterImportText": "Character data exported prior to system version 1.1 will not generate a complete character. Do you wish to continue?",
|
||||||
"cancelBeastform": "Cancel Beastform"
|
"cancelBeastform": "Cancel Beastform",
|
||||||
|
"sidebarFavoritesHint": "Drag items, features and domain cards from the sheet to here"
|
||||||
},
|
},
|
||||||
"Companion": {
|
"Companion": {
|
||||||
"FIELDS": {
|
"FIELDS": {
|
||||||
|
|
|
||||||
|
|
@ -266,23 +266,24 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
||||||
async _prepareSidebarContext(context, _options) {
|
async _prepareSidebarContext(context, _options) {
|
||||||
context.isDeath = this.document.system.deathMoveViable;
|
context.isDeath = this.document.system.deathMoveViable;
|
||||||
context.sidebarFavoritesEmpty = this.document.system.sidebarFavorites.length === 0;
|
context.sidebarFavoritesEmpty = this.document.system.sidebarFavorites.length === 0;
|
||||||
|
context.showfavorites = !context.sidebarFavoritesEmpty || this.document.system.usedUnarmed;
|
||||||
|
|
||||||
const initialFavorites = this.document.system.usedUnarmed
|
// const initialFavorites = this.document.system.usedUnarmed
|
||||||
? {
|
// ? {
|
||||||
equipment: {
|
// equipment: {
|
||||||
label: 'DAGGERHEART.GENERAL.equipment',
|
// label: 'DAGGERHEART.GENERAL.equipment',
|
||||||
items: [{ type: 'attack', value: this.document.system.usedUnarmed }]
|
// items: [{ type: 'attack', value: this.document.system.usedUnarmed }]
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
: {};
|
// : {};
|
||||||
context.sidebarFavorites = this.document.system.sidebarFavorites.reduce((acc, item) => {
|
// context.sidebarFavorites = this.document.system.sidebarFavorites.reduce((acc, item) => {
|
||||||
const type = item.type === 'domainCard' ? item.type : 'equipment';
|
// const type = item.type === 'domainCard' ? item.type : 'equipment';
|
||||||
const label = type === 'domainCard' ? 'DAGGERHEART.GENERAL.loadout' : 'DAGGERHEART.GENERAL.equipment';
|
// const label = type === 'domainCard' ? 'DAGGERHEART.GENERAL.loadout' : 'DAGGERHEART.GENERAL.equipment';
|
||||||
if (!acc[type]) acc[type] = { label, items: [] };
|
// if (!acc[type]) acc[type] = { label, items: [] };
|
||||||
acc[type].items.push({ type: item.type, value: item });
|
// acc[type].items.push({ type: item.type, value: item });
|
||||||
|
|
||||||
return acc;
|
// return acc;
|
||||||
}, initialFavorites);
|
// }, initialFavorites);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,26 @@ export default class DHDomainCard extends BaseDataItem {
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
|
||||||
|
/**@inheritdoc */
|
||||||
|
async _preUpdate(data, options, user) {
|
||||||
|
const allowed = await super._preUpdate(data, options, user);
|
||||||
|
if (allowed === false) return;
|
||||||
|
|
||||||
|
if (this.parent.parent?.type === 'character') {
|
||||||
|
if (
|
||||||
|
data.system?.inVault &&
|
||||||
|
!this.inVault &&
|
||||||
|
this.parent.parent.system.sidebarFavorites.find(x => x?.id === this.parent.id)
|
||||||
|
) {
|
||||||
|
this.parent.parent.update({
|
||||||
|
'system.sidebarFavorites': this.parent.parent.system.sidebarFavorites.filter(
|
||||||
|
x => x.id !== this.parent.id
|
||||||
|
)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**@inheritdoc */
|
/**@inheritdoc */
|
||||||
async _preCreate(data, options, user) {
|
async _preCreate(data, options, user) {
|
||||||
const allowed = await super._preCreate(data, options, user);
|
const allowed = await super._preCreate(data, options, user);
|
||||||
|
|
|
||||||
|
|
@ -552,7 +552,6 @@
|
||||||
.shortcut-items-section {
|
.shortcut-items-section {
|
||||||
overflow-y: hidden;
|
overflow-y: hidden;
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
padding-bottom: 20px;
|
|
||||||
mask-image: linear-gradient(0deg, transparent 0%, black 5%);
|
mask-image: linear-gradient(0deg, transparent 0%, black 5%);
|
||||||
scrollbar-gutter: stable;
|
scrollbar-gutter: stable;
|
||||||
scrollbar-width: thin;
|
scrollbar-width: thin;
|
||||||
|
|
@ -565,16 +564,17 @@
|
||||||
.empty-favorites {
|
.empty-favorites {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
height: 40px;
|
|
||||||
border: 1px dashed light-dark(@dark-blue-50, @beige-50);
|
border: 1px dashed light-dark(@dark-blue-50, @beige-50);
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
color: light-dark(@dark-blue-50, @beige-50);
|
color: light-dark(@dark-blue-50, @beige-50);
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
margin-left: 4px;
|
margin-left: 4px;
|
||||||
|
padding: 4px 0;
|
||||||
|
|
||||||
span {
|
span {
|
||||||
width: 250px;
|
width: 250px;
|
||||||
|
|
|
||||||
|
|
@ -96,10 +96,36 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="shortcut-items-section">
|
<div class="shortcut-items-section">
|
||||||
{{#if sidebarFavoritesEmpty}}
|
<div class="equipment-section">
|
||||||
<div class="empty-favorites"><span>{{localize "DAGGERHEART.GENERAL.favorite.plural"}}</span></div>
|
<div class="title">
|
||||||
{{else}}
|
<side-line-div class="invert"></side-line-div>
|
||||||
{{#each sidebarFavorites as |category|}}
|
<h3>{{localize "DAGGERHEART.GENERAL.favorite.plural"}}</h3>
|
||||||
|
<side-line-div></side-line-div>
|
||||||
|
</div>
|
||||||
|
<ul class="items-sidebar-list">
|
||||||
|
{{#if this.document.system.usedUnarmed}}
|
||||||
|
{{> 'daggerheart.inventory-item-compact'
|
||||||
|
item=this.document.system.usedUnarmed
|
||||||
|
type="attack"
|
||||||
|
}}
|
||||||
|
{{/if}}
|
||||||
|
{{#each this.document.system.sidebarFavorites as |item|}}
|
||||||
|
{{> 'daggerheart.inventory-item-compact'
|
||||||
|
item=item
|
||||||
|
type=item.type
|
||||||
|
}}
|
||||||
|
{{/each}}
|
||||||
|
</ul>
|
||||||
|
{{#if sidebarFavoritesEmpty}}
|
||||||
|
<div class="empty-favorites">
|
||||||
|
<span>{{localize "DAGGERHEART.ACTORS.Character.sidebarFavoritesHint"}}</span>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{{!-- {{#each sidebarFavorites as |category|}}
|
||||||
<div class="equipment-section">
|
<div class="equipment-section">
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<side-line-div class="invert"></side-line-div>
|
<side-line-div class="invert"></side-line-div>
|
||||||
|
|
@ -115,29 +141,27 @@
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{{/each}} --}}
|
||||||
{{/if}}
|
<div class="experience-section">
|
||||||
<div class="experience-section">
|
<div class="title">
|
||||||
<div class="title">
|
<side-line-div class="invert"></side-line-div>
|
||||||
<side-line-div class="invert"></side-line-div>
|
<h3>{{localize "DAGGERHEART.GENERAL.experience.single"}}</h3>
|
||||||
<h3>{{localize "DAGGERHEART.GENERAL.experience.single"}}</h3>
|
<side-line-div></side-line-div>
|
||||||
<side-line-div></side-line-div>
|
</div>
|
||||||
</div>
|
<div class="experience-list">
|
||||||
<div class="experience-list">
|
{{#each document.system.experiences as |experience id|}}
|
||||||
{{#each document.system.experiences as |experience id|}}
|
<div class="experience-row" data-tooltip-text="{{experience.description}}">
|
||||||
<div class="experience-row" data-tooltip-text="{{experience.description}}">
|
<span class="experience-value">
|
||||||
<span class="experience-value">
|
+{{experience.value}}
|
||||||
+{{experience.value}}
|
</span>
|
||||||
</span>
|
<span class="experience-name">{{experience.name}}</span>
|
||||||
<span class="experience-name">{{experience.name}}</span>
|
<div class="controls">
|
||||||
<div class="controls">
|
<a data-action="sendExpToChat" data-type="experience" data-id="{{id}}">
|
||||||
<a data-action="sendExpToChat" data-type="experience" data-id="{{id}}">
|
<i class="fa-regular fa-message"></i>
|
||||||
<i class="fa-regular fa-message"></i>
|
</a>
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
{{/each}}
|
</div>
|
||||||
</div>
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue