mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-14 08:38:11 +02:00
Compare commits
No commits in common. "05167b697a6b5ad86cef9b1d72d99386430636a9" and "e28d90fe71676c8e260d09fb6f0e6541add499c5" have entirely different histories.
05167b697a
...
e28d90fe71
6 changed files with 13 additions and 27 deletions
|
|
@ -44,9 +44,9 @@ export default class SubclassSheet extends DHBaseItemSheet {
|
||||||
async _prepareContext(options) {
|
async _prepareContext(options) {
|
||||||
const context = await super._prepareContext(options);
|
const context = await super._prepareContext(options);
|
||||||
if (this.document.system.linkedClass) {
|
if (this.document.system.linkedClass) {
|
||||||
const classData = await fromUuid(this.document.system.linkedClass);
|
context.class = (await fromUuid(this.document.system.linkedClass)) ?? {
|
||||||
context.class = classData ?? {
|
|
||||||
name: _loc('DAGGERHEART.GENERAL.missingX', { x: _loc('TYPES.Item.class') }),
|
name: _loc('DAGGERHEART.GENERAL.missingX', { x: _loc('TYPES.Item.class') }),
|
||||||
|
img: 'systems/daggerheart/assets/icons/documents/items/laurel-crown.svg',
|
||||||
missing: true
|
missing: true
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -357,7 +357,7 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) {
|
||||||
|
|
||||||
async _createFieldFilter() {
|
async _createFieldFilter() {
|
||||||
const filters = ItemBrowser.getFolderConfig(this.selectedMenu.data, 'filters');
|
const filters = ItemBrowser.getFolderConfig(this.selectedMenu.data, 'filters');
|
||||||
for (const f of filters) {
|
for(const f of filters) {
|
||||||
if (typeof f.field === 'string') f.field = foundry.utils.getProperty(game, f.field);
|
if (typeof f.field === 'string') f.field = foundry.utils.getProperty(game, f.field);
|
||||||
else if (typeof f.choices === 'function') {
|
else if (typeof f.choices === 'function') {
|
||||||
f.choices = await f.choices(this.items);
|
f.choices = await f.choices(this.items);
|
||||||
|
|
|
||||||
|
|
@ -383,8 +383,7 @@ export const typeConfig = {
|
||||||
{
|
{
|
||||||
key: 'system.linkedClass',
|
key: 'system.linkedClass',
|
||||||
label: 'TYPES.Item.class',
|
label: 'TYPES.Item.class',
|
||||||
format: linkedClass =>
|
format: linkedClass => linkedClass?.name ?? 'DAGGERHEART.UI.ItemBrowser.missing'
|
||||||
foundry.utils.fromUuidSync(linkedClass)?.name ?? 'DAGGERHEART.UI.ItemBrowser.missing'
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'system.spellcastingTrait',
|
key: 'system.spellcastingTrait',
|
||||||
|
|
@ -398,7 +397,7 @@ export const typeConfig = {
|
||||||
label: 'TYPES.Item.class',
|
label: 'TYPES.Item.class',
|
||||||
choices: async items => {
|
choices: async items => {
|
||||||
const list = [];
|
const list = [];
|
||||||
for (const item of items.filter(item => item.system.linkedClass)) {
|
for(const item of items.filter(item => item.system.linkedClass)) {
|
||||||
const linkedClass = await foundry.utils.fromUuid(item.system.linkedClass);
|
const linkedClass = await foundry.utils.fromUuid(item.system.linkedClass);
|
||||||
list.push({
|
list.push({
|
||||||
value: linkedClass.uuid,
|
value: linkedClass.uuid,
|
||||||
|
|
|
||||||
|
|
@ -35,14 +35,6 @@
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
.image-icon {
|
|
||||||
font-size: 26px;
|
|
||||||
width: 40px;
|
|
||||||
height: 40px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.controls {
|
.controls {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,8 @@
|
||||||
<div class="item-description-outer-container">
|
<div class="item-description-outer-container">
|
||||||
{{#if spellcastTrait}}
|
<div class="item-description-container">
|
||||||
<div class="item-description-container">
|
<h4>{{localize "DAGGERHEART.ITEMS.Subclass.spellcastTrait"}}</h4>
|
||||||
<h4>{{localize "DAGGERHEART.ITEMS.Subclass.spellcastTrait"}}</h4>
|
<span>{{spellcastTrait}}</span>
|
||||||
<span>{{spellcastTrait}}</span>
|
</div>
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
<div class="item-description-container">
|
<div class="item-description-container">
|
||||||
<h4>{{localize "DAGGERHEART.ITEMS.Subclass.foundationFeatures"}}</h4>
|
<h4>{{localize "DAGGERHEART.ITEMS.Subclass.foundationFeatures"}}</h4>
|
||||||
{{#each foundationFeatures as | feature |}}
|
{{#each foundationFeatures as | feature |}}
|
||||||
|
|
|
||||||
|
|
@ -8,12 +8,9 @@
|
||||||
{{#if class}}
|
{{#if class}}
|
||||||
<div class="feature-list">
|
<div class="feature-list">
|
||||||
<li class="feature-line">
|
<li class="feature-line">
|
||||||
{{#if class.missing}}
|
<img class="image" src="{{class.img}}" />
|
||||||
<i class="fa-solid fa-link-slash hint image-icon" inert></i>
|
<span>{{class.name}} {{#if class.missing}}<i class="fa-solid fa-link-slash" inert></i>{{/if}}</span>
|
||||||
<span class="hint">{{class.name}}</span>
|
{{#unless class.missing}}
|
||||||
{{else}}
|
|
||||||
<img class="image" src="{{class.img}}" />
|
|
||||||
<span>{{class.name}}</span>
|
|
||||||
<div class='controls'>
|
<div class='controls'>
|
||||||
<a
|
<a
|
||||||
class='effect-control'
|
class='effect-control'
|
||||||
|
|
@ -24,7 +21,7 @@
|
||||||
<i class="fa-solid fa-globe" inert></i>
|
<i class="fa-solid fa-globe" inert></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/unless}}
|
||||||
</li>
|
</li>
|
||||||
</div>
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue