mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-21 23:13:39 +02:00
Increase reuse of gold and inventory styling
This commit is contained in:
parent
c6335980ba
commit
98810c6909
10 changed files with 84 additions and 146 deletions
|
|
@ -3,7 +3,7 @@ import ForeignDocumentUUIDField from '../fields/foreignDocumentUUIDField.mjs';
|
||||||
import DhLevelData from '../levelData.mjs';
|
import DhLevelData from '../levelData.mjs';
|
||||||
import { commonActorRules } from './base.mjs';
|
import { commonActorRules } from './base.mjs';
|
||||||
import DhCreature from './creature.mjs';
|
import DhCreature from './creature.mjs';
|
||||||
import { attributeField, stressDamageReductionRule, bonusField } from '../fields/actorField.mjs';
|
import { attributeField, stressDamageReductionRule, bonusField, GoldField } from '../fields/actorField.mjs';
|
||||||
import { ActionField } from '../fields/actionField.mjs';
|
import { ActionField } from '../fields/actionField.mjs';
|
||||||
import DHCharacterSettings from '../../applications/sheets-configs/character-settings.mjs';
|
import DHCharacterSettings from '../../applications/sheets-configs/character-settings.mjs';
|
||||||
import { getArmorSources } from '../../helpers/utils.mjs';
|
import { getArmorSources } from '../../helpers/utils.mjs';
|
||||||
|
|
@ -62,12 +62,7 @@ export default class DhCharacter extends DhCreature {
|
||||||
core: new fields.BooleanField({ initial: false })
|
core: new fields.BooleanField({ initial: false })
|
||||||
})
|
})
|
||||||
),
|
),
|
||||||
gold: new fields.SchemaField({
|
gold: new GoldField(),
|
||||||
coins: new fields.NumberField({ initial: 0, integer: true }),
|
|
||||||
handfuls: new fields.NumberField({ initial: 1, integer: true }),
|
|
||||||
bags: new fields.NumberField({ initial: 0, integer: true }),
|
|
||||||
chests: new fields.NumberField({ initial: 0, integer: true })
|
|
||||||
}),
|
|
||||||
scars: new fields.NumberField({ initial: 0, integer: true, label: 'DAGGERHEART.GENERAL.scars' }),
|
scars: new fields.NumberField({ initial: 0, integer: true, label: 'DAGGERHEART.GENERAL.scars' }),
|
||||||
biography: new fields.SchemaField({
|
biography: new fields.SchemaField({
|
||||||
background: new fields.HTMLField(),
|
background: new fields.HTMLField(),
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import BaseDataActor from './base.mjs';
|
||||||
import ForeignDocumentUUIDArrayField from '../fields/foreignDocumentUUIDArrayField.mjs';
|
import ForeignDocumentUUIDArrayField from '../fields/foreignDocumentUUIDArrayField.mjs';
|
||||||
import TagTeamData from '../tagTeamData.mjs';
|
import TagTeamData from '../tagTeamData.mjs';
|
||||||
import GroupRollData from '../groupRollData.mjs';
|
import GroupRollData from '../groupRollData.mjs';
|
||||||
|
import { GoldField } from '../fields/actorField.mjs';
|
||||||
|
|
||||||
export default class DhParty extends BaseDataActor {
|
export default class DhParty extends BaseDataActor {
|
||||||
/**@inheritdoc */
|
/**@inheritdoc */
|
||||||
|
|
@ -11,12 +12,7 @@ export default class DhParty extends BaseDataActor {
|
||||||
...super.defineSchema(),
|
...super.defineSchema(),
|
||||||
partyMembers: new ForeignDocumentUUIDArrayField({ type: 'Actor' }, { prune: true }),
|
partyMembers: new ForeignDocumentUUIDArrayField({ type: 'Actor' }, { prune: true }),
|
||||||
notes: new fields.HTMLField(),
|
notes: new fields.HTMLField(),
|
||||||
gold: new fields.SchemaField({
|
gold: new GoldField(),
|
||||||
coins: new fields.NumberField({ initial: 0, integer: true }),
|
|
||||||
handfuls: new fields.NumberField({ initial: 1, integer: true }),
|
|
||||||
bags: new fields.NumberField({ initial: 0, integer: true }),
|
|
||||||
chests: new fields.NumberField({ initial: 0, integer: true })
|
|
||||||
}),
|
|
||||||
tagTeam: new fields.EmbeddedDataField(TagTeamData),
|
tagTeam: new fields.EmbeddedDataField(TagTeamData),
|
||||||
groupRoll: new fields.EmbeddedDataField(GroupRollData)
|
groupRoll: new fields.EmbeddedDataField(GroupRollData)
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -103,4 +103,15 @@ class ResourcesField extends fields.TypedObjectField {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export { attributeField, ResourcesField, stressDamageReductionRule, bonusField };
|
class GoldField extends fields.SchemaField {
|
||||||
|
constructor() {
|
||||||
|
super({
|
||||||
|
coins: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
handfuls: new fields.NumberField({ initial: 1, integer: true }),
|
||||||
|
bags: new fields.NumberField({ initial: 0, integer: true }),
|
||||||
|
chests: new fields.NumberField({ initial: 0, integer: true })
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export { attributeField, ResourcesField, GoldField, stressDamageReductionRule, bonusField };
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ export const preloadHandlebarsTemplates = async function () {
|
||||||
'templates/generic/tab-navigation.hbs',
|
'templates/generic/tab-navigation.hbs',
|
||||||
'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs',
|
'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs',
|
||||||
'systems/daggerheart/templates/sheets/global/partials/action-item.hbs',
|
'systems/daggerheart/templates/sheets/global/partials/action-item.hbs',
|
||||||
|
'systems/daggerheart/templates/sheets/global/partials/gold.hbs',
|
||||||
'systems/daggerheart/templates/sheets/global/partials/domain-card-item.hbs',
|
'systems/daggerheart/templates/sheets/global/partials/domain-card-item.hbs',
|
||||||
'systems/daggerheart/templates/sheets/global/partials/item-resource.hbs',
|
'systems/daggerheart/templates/sheets/global/partials/item-resource.hbs',
|
||||||
'systems/daggerheart/templates/sheets/global/partials/resource-section/resource-section.hbs',
|
'systems/daggerheart/templates/sheets/global/partials/resource-section/resource-section.hbs',
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,59 @@
|
||||||
color: light-dark(@chat-blue-bg, @beige-50);
|
color: light-dark(@chat-blue-bg, @beige-50);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tab.inventory {
|
||||||
|
.search-section {
|
||||||
|
display: flex;
|
||||||
|
gap: 10px;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.search-bar {
|
||||||
|
position: relative;
|
||||||
|
color: light-dark(@dark-blue-50, @beige-50);
|
||||||
|
width: 100%;
|
||||||
|
padding-top: 5px;
|
||||||
|
|
||||||
|
input {
|
||||||
|
border-radius: 50px;
|
||||||
|
background: light-dark(@dark-blue-10, @golden-10);
|
||||||
|
border: none;
|
||||||
|
outline: 2px solid transparent;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
padding: 0 20px;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
outline: 2px solid light-dark(@dark, @golden);
|
||||||
|
}
|
||||||
|
|
||||||
|
&::-webkit-search-cancel-button {
|
||||||
|
-webkit-appearance: none;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
align-content: center;
|
||||||
|
height: 32px;
|
||||||
|
position: absolute;
|
||||||
|
right: 20px;
|
||||||
|
font-size: 16px;
|
||||||
|
z-index: 1;
|
||||||
|
color: light-dark(@dark-blue-50, @beige-50);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.gold-section {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 1fr 1fr 1fr;
|
||||||
|
gap: 10px;
|
||||||
|
padding: 10px 10px 0;
|
||||||
|
|
||||||
|
.input {
|
||||||
|
color: light-dark(@dark, @beige);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&.limited {
|
&.limited {
|
||||||
&.character,
|
&.character,
|
||||||
&.adversary,
|
&.adversary,
|
||||||
|
|
|
||||||
|
|
@ -3,47 +3,6 @@
|
||||||
|
|
||||||
.application.sheet.daggerheart.actor.dh-style.character {
|
.application.sheet.daggerheart.actor.dh-style.character {
|
||||||
.tab.inventory {
|
.tab.inventory {
|
||||||
.search-section {
|
|
||||||
display: flex;
|
|
||||||
gap: 10px;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
.search-bar {
|
|
||||||
position: relative;
|
|
||||||
color: light-dark(@dark-blue-50, @beige-50);
|
|
||||||
width: 100%;
|
|
||||||
padding-top: 5px;
|
|
||||||
|
|
||||||
input {
|
|
||||||
border-radius: 50px;
|
|
||||||
background: light-dark(@dark-blue-10, @golden-10);
|
|
||||||
border: none;
|
|
||||||
outline: 2px solid transparent;
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
padding: 0 20px;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
outline: 2px solid light-dark(@dark, @golden);
|
|
||||||
}
|
|
||||||
|
|
||||||
&::-webkit-search-cancel-button {
|
|
||||||
-webkit-appearance: none;
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon {
|
|
||||||
align-content: center;
|
|
||||||
height: 32px;
|
|
||||||
position: absolute;
|
|
||||||
right: 20px;
|
|
||||||
font-size: var(--font-size-16);
|
|
||||||
z-index: 1;
|
|
||||||
color: light-dark(@dark-blue-50, @beige-50);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.items-section {
|
.items-section {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
@ -55,16 +14,5 @@
|
||||||
scrollbar-width: thin;
|
scrollbar-width: thin;
|
||||||
scrollbar-color: light-dark(@dark-blue, @golden) transparent;
|
scrollbar-color: light-dark(@dark-blue, @golden) transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.currency-section {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 1fr 1fr 1fr 1fr;
|
|
||||||
gap: 10px;
|
|
||||||
padding: 10px 10px 0;
|
|
||||||
|
|
||||||
.input {
|
|
||||||
color: light-dark(@dark, @beige);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,51 +3,6 @@
|
||||||
|
|
||||||
.application.sheet.daggerheart.actor.dh-style.party {
|
.application.sheet.daggerheart.actor.dh-style.party {
|
||||||
.tab.inventory {
|
.tab.inventory {
|
||||||
.search-section {
|
|
||||||
display: flex;
|
|
||||||
gap: 10px;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
.search-bar {
|
|
||||||
position: relative;
|
|
||||||
color: light-dark(@dark-blue-50, @beige-50);
|
|
||||||
width: 100%;
|
|
||||||
padding-top: 5px;
|
|
||||||
|
|
||||||
input {
|
|
||||||
border-radius: 50px;
|
|
||||||
background: light-dark(@dark-blue-10, @golden-10);
|
|
||||||
border: none;
|
|
||||||
outline: 2px solid transparent;
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
padding: 0 20px;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
outline: 2px solid light-dark(@dark, @golden);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:placeholder {
|
|
||||||
color: light-dark(@dark-blue-50, @beige-50);
|
|
||||||
}
|
|
||||||
|
|
||||||
&::-webkit-search-cancel-button {
|
|
||||||
-webkit-appearance: none;
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon {
|
|
||||||
align-content: center;
|
|
||||||
height: 32px;
|
|
||||||
position: absolute;
|
|
||||||
right: 20px;
|
|
||||||
font-size: 16px;
|
|
||||||
z-index: 1;
|
|
||||||
color: light-dark(@dark-blue-50, @beige-50);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.items-section {
|
.items-section {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
@ -59,16 +14,5 @@
|
||||||
scrollbar-width: thin;
|
scrollbar-width: thin;
|
||||||
scrollbar-color: light-dark(@dark-blue, @golden) transparent;
|
scrollbar-color: light-dark(@dark-blue, @golden) transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.currency-section {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 1fr 1fr 1fr 1fr;
|
|
||||||
gap: 10px;
|
|
||||||
padding: 10px 10px 0;
|
|
||||||
|
|
||||||
.input {
|
|
||||||
color: light-dark(@dark, @beige);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,18 +13,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{#if this.inventory.hasCurrency}}
|
{{#if this.inventory.hasCurrency}}
|
||||||
<div class="currency-section">
|
{{> "systems/daggerheart/templates/sheets/global/partials/gold.hbs" currencies=inventory.currencies}}
|
||||||
{{#each this.inventory.currencies as |currency key|}}
|
|
||||||
{{#if currency.enabled}}
|
|
||||||
<div class="input currency" data-currency="{{key}}">
|
|
||||||
<span class="drag-handle">
|
|
||||||
<i class="{{currency.icon}}" inert></i> {{localize currency.label}}
|
|
||||||
</span>
|
|
||||||
<input type="text" name="{{currency.field.fieldPath}}" data-allow-delta value="{{currency.value}}" data-dtype="Number" min="0" step="1" />
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
{{/each}}
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<div class="items-section">
|
<div class="items-section">
|
||||||
|
|
|
||||||
|
|
@ -16,18 +16,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{#if inventory.hasCurrency}}
|
{{#if inventory.hasCurrency}}
|
||||||
<div class="currency-section">
|
{{> "systems/daggerheart/templates/sheets/global/partials/gold.hbs" currencies=inventory.currencies}}
|
||||||
{{#each this.inventory.currencies as |currency key|}}
|
|
||||||
{{#if currency.enabled}}
|
|
||||||
<div class="input currency" data-currency="{{key}}">
|
|
||||||
<span class="drag-handle">
|
|
||||||
<i class="{{currency.icon}}" inert></i> {{localize currency.label}}
|
|
||||||
</span>
|
|
||||||
<input type="text" name="{{currency.field.fieldPath}}" data-allow-delta value="{{currency.value}}" data-dtype="Number" min="0" step="1" />
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
{{/each}}
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<div class="items-section">
|
<div class="items-section">
|
||||||
|
|
|
||||||
12
templates/sheets/global/partials/gold.hbs
Normal file
12
templates/sheets/global/partials/gold.hbs
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
<div class="gold-section">
|
||||||
|
{{#each currencies as |currency key|}}
|
||||||
|
{{#if currency.enabled}}
|
||||||
|
<div class="input currency" data-currency="{{key}}">
|
||||||
|
<span class="drag-handle">
|
||||||
|
<i class="{{currency.icon}}" inert></i> {{localize currency.label}}
|
||||||
|
</span>
|
||||||
|
<input type="text" name="{{currency.field.fieldPath}}" data-allow-delta value="{{currency.value}}" data-dtype="Number" min="0" step="1" />
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
{{/each}}
|
||||||
|
</div>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue