fix label-input matching for core values and addit text to combat values

This commit is contained in:
Johannes Loher 2021-07-12 01:00:50 +02:00
parent 959bfcc3e4
commit 9b7d3e5a7b
10 changed files with 63 additions and 18 deletions

View file

@ -146,6 +146,14 @@
"DS4.CombatValuesRangedAttack": "Schießen", "DS4.CombatValuesRangedAttack": "Schießen",
"DS4.CombatValuesSpellcasting": "Zaubern", "DS4.CombatValuesSpellcasting": "Zaubern",
"DS4.CombatValuesTargetedSpellcasting": "Zielzaubern", "DS4.CombatValuesTargetedSpellcasting": "Zielzaubern",
"DS4.CombatValuesHitPointsSheet": "Lebenskraft",
"DS4.CombatValuesDefenseSheet": "Abwehr",
"DS4.CombatValuesInitiativeSheet": "Initiative",
"DS4.CombatValuesMovementSheet": "Laufen",
"DS4.CombatValuesMeleeAttackSheet": "Schlagen",
"DS4.CombatValuesRangedAttackSheet": "Schießen",
"DS4.CombatValuesSpellcastingSheet": "Zaubern",
"DS4.CombatValuesTargetedSpellcastingSheet": "Zielzaubern",
"DS4.CharacterBaseInfoRace": "Volk", "DS4.CharacterBaseInfoRace": "Volk",
"DS4.CharacterBaseInfoClass": "Klasse", "DS4.CharacterBaseInfoClass": "Klasse",
"DS4.CharacterBaseInfoHeroClass": "Heldenklasse", "DS4.CharacterBaseInfoHeroClass": "Heldenklasse",

View file

@ -146,6 +146,14 @@
"DS4.CombatValuesRangedAttack": "Ranged Attack", "DS4.CombatValuesRangedAttack": "Ranged Attack",
"DS4.CombatValuesSpellcasting": "Spellcasting", "DS4.CombatValuesSpellcasting": "Spellcasting",
"DS4.CombatValuesTargetedSpellcasting": "Targeted Spellcasting", "DS4.CombatValuesTargetedSpellcasting": "Targeted Spellcasting",
"DS4.CombatValuesHitPointsSheet": "Hit Points",
"DS4.CombatValuesDefenseSheet": "Defense",
"DS4.CombatValuesInitiativeSheet": "Initiative",
"DS4.CombatValuesMovementSheet": "Movement",
"DS4.CombatValuesMeleeAttackSheet": "Melee Attack",
"DS4.CombatValuesRangedAttackSheet": "RAT",
"DS4.CombatValuesSpellcastingSheet": "Spellcasting",
"DS4.CombatValuesTargetedSpellcastingSheet": "TSC",
"DS4.CharacterBaseInfoRace": "Race", "DS4.CharacterBaseInfoRace": "Race",
"DS4.CharacterBaseInfoClass": "Class", "DS4.CharacterBaseInfoClass": "Class",
"DS4.CharacterBaseInfoHeroClass": "Hero Class", "DS4.CharacterBaseInfoHeroClass": "Hero Class",

View file

@ -162,6 +162,20 @@ export const DS4 = {
targetedSpellcasting: "DS4.CombatValuesTargetedSpellcasting", targetedSpellcasting: "DS4.CombatValuesTargetedSpellcasting",
}, },
/**
* The what do display in the actor sheets for the combat value text (in some languages, abbreviations are necessary)
*/
combatValuesSheet: {
hitPoints: "DS4.CombatValuesHitPointsSheet",
defense: "DS4.CombatValuesDefenseSheet",
initiative: "DS4.CombatValuesInitiativeSheet",
movement: "DS4.CombatValuesMovementSheet",
meleeAttack: "DS4.CombatValuesMeleeAttackSheet",
rangedAttack: "DS4.CombatValuesRangedAttackSheet",
spellcasting: "DS4.CombatValuesSpellcastingSheet",
targetedSpellcasting: "DS4.CombatValuesTargetedSpellcastingSheet",
},
/** /**
* Define the base info of a character * Define the base info of a character
*/ */

View file

@ -6,13 +6,14 @@
@use "../utils/mixins"; @use "../utils/mixins";
@use "../utils/variables"; @use "../utils/variables";
@use "../utils/typography";
.ds4-combat-value { .ds4-combat-value {
$size: 3.75rem; $size: 3.75rem;
display: grid; display: grid;
place-items: center; place-items: center;
row-gap: 0.5em; row-gap: 0.125em;
&__value { &__value {
$combat-values-icons-path: "#{variables.$official-icons-path}/combat-values"; $combat-values-icons-path: "#{variables.$official-icons-path}/combat-values";
@ -51,6 +52,12 @@
} }
} }
&__label {
@include typography.font-heading-upper;
font-size: 1.2em;
white-space: nowrap;
}
&__formula { &__formula {
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;

View file

@ -7,11 +7,12 @@
@use "../utils/variables"; @use "../utils/variables";
.ds4-sheet-tab-nav { .ds4-sheet-tab-nav {
height: auto;
border-top: variables.$border-groove;
border-bottom: variables.$border-groove; border-bottom: variables.$border-groove;
border-top: variables.$border-groove;
height: auto;
&__item { &__item {
font-weight: bold; font-weight: bold;
white-space: nowrap;
} }
} }

View file

@ -9,20 +9,24 @@ SPDX-License-Identifier: MIT
!-- !--
!-- @param combat-value-key: The key of the combat value !-- @param combat-value-key: The key of the combat value
!-- @param combat-value-data: The data for the combat value !-- @param combat-value-data: The data for the combat value
!-- @param combat-value-label: The label for the combat value !-- @param combat-value-title: The title for the combat value
!-- @param combat-value-label: The label for the combat value (possibly an abbreviation)
!-- @param actor-id: The id of the actor the core value belongs to
--}} --}}
<div class="ds4-combat-value"> <div class="ds4-combat-value">
<div class="ds4-combat-value__value ds4-combat-value__value--{{combat-value-key}}" <div class="ds4-combat-value__value ds4-combat-value__value--{{combat-value-key}}"
title="{{combat-value-label}}: {{combat-value-data.tooltip}}"> title="{{combat-value-title}}: {{combat-value-data.tooltip}}">
{{combat-value-data.total}} {{combat-value-data.total}}
</div> </div>
<span title="{{combat-value-title}}" class="ds4-combat-value__label">{{combat-value-label}}</span>
<div class="ds4-combat-value__formula"> <div class="ds4-combat-value__formula">
<span class="ds4-combat-value__formula-base" <span class="ds4-combat-value__formula-base"
title="{{combat-value-label}} {{localize 'DS4.TooltipBaseValue'}}">{{combat-value-data.base}}</span> title="{{combat-value-title}} {{localize 'DS4.TooltipBaseValue'}}">{{combat-value-data.base}}</span>
<span>+</span> <span>+</span>
<input class="ds4-combat-value__formula-modifier" type="number" name="data.combatValues.{{combat-value-key}}.mod" <input class="ds4-combat-value__formula-modifier" type="number"
value='{{combat-value-data.mod}}' data-dtype="Number" id="data.combatValues.{{combat-value-key}}.mod-{{actor-id}}"
title="{{combat-value-label}} {{localize 'DS4.TooltipModifier'}}" /> name="data.combatValues.{{combat-value-key}}.mod" value='{{combat-value-data.mod}}' data-dtype="Number"
title="{{combat-value-title}} {{localize 'DS4.TooltipModifier'}}" />
</div> </div>
</div> </div>

View file

@ -6,8 +6,10 @@ SPDX-License-Identifier: MIT
--}} --}}
<div class="ds4-combat-values"> <div class="ds4-combat-values">
{{#each config.i18n.combatValues as |combat-value-label combat-value-key|}} {{#each config.i18n.combatValues as |combat-value-title combat-value-key|}}
{{> systems/ds4/templates/sheets/actor/components/combat-value.hbs combat-value-key=combat-value-key {{> systems/ds4/templates/sheets/actor/components/combat-value.hbs combat-value-key=combat-value-key
combat-value-data=(lookup ../data.data.combatValues combat-value-key) combat-value-label=combat-value-label}} combat-value-data=(lookup ../data.data.combatValues combat-value-key) combat-value-label=(lookup
../config.i18n.combatValuesSheet combat-value-key) combat-value-title=combat-value-title
actor-id=../data._id}}
{{/each}} {{/each}}
</div> </div>

View file

@ -11,21 +11,22 @@ SPDX-License-Identifier: MIT
!-- @param core-value-key: The key of the core value !-- @param core-value-key: The key of the core value
!-- @param core-value-data: The data for the core value !-- @param core-value-data: The data for the core value
!-- @param core-value-variant: The variant of the core value, i.e. attribute or trait !-- @param core-value-variant: The variant of the core value, i.e. attribute or trait
!-- @param actor-id: The id of the actor the core value belongs to
--}} --}}
<div class="ds4-core-value ds4-core-value--{{core-value-variant}}"> <div class="ds4-core-value ds4-core-value--{{core-value-variant}}">
<label for="data.{{core-value-variant}}s.{{core-value-key}}.base" <label for="data.{{core-value-variant}}s.{{core-value-key}}.base-{{actor-id}}"
class="ds4-core-value__label">{{core-value-label}}</label> class="ds4-core-value__label">{{core-value-label}}</label>
<div class="ds4-core-value__value"> <div class="ds4-core-value__value">
<input class="ds4-core-value__value-input" type="number" <input class="ds4-core-value__value-input" type="number"
name="data.{{core-value-variant}}s.{{core-value-key}}.base" name="data.{{core-value-variant}}s.{{core-value-key}}.base"
id="data.{{core-value-variant}}s.{{core-value-key}}.base" value='{{core-value-data.base}}' id="data.{{core-value-variant}}s.{{core-value-key}}.base-{{actor-id}}" value='{{core-value-data.base}}'
data-dtype="Number" title="{{core-value-label}} {{localize 'DS4.TooltipBaseValue'}}" /> data-dtype="Number" title="{{core-value-label}} {{localize 'DS4.TooltipBaseValue'}}" />
<span>+</span> <span>+</span>
<input class="ds4-core-value__value-input" type="number" <input class="ds4-core-value__value-input" type="number"
name="data.{{core-value-variant}}s.{{core-value-key}}.mod" name="data.{{core-value-variant}}s.{{core-value-key}}.mod"
id="data.{{core-value-variant}}s.{{core-value-key}}.mod" value='{{core-value-data.mod}}' data-dtype="Number" id="data.{{core-value-variant}}s.{{core-value-key}}.mod-{{actor-id}}" value='{{core-value-data.mod}}'
title="{{core-value-label}} {{localize 'DS4.TooltipModifier'}}" /> data-dtype="Number" title="{{core-value-label}} {{localize 'DS4.TooltipModifier'}}" />
<span class="ds4-core-value__value-arrow">➞</span> <span class="ds4-core-value__value-arrow">➞</span>
<span class="ds4-core-value__value-total" <span class="ds4-core-value__value-total"
title="{{core-value-label}}: {{core-value-data.tooltip}}">{{core-value-data.total}}</span> title="{{core-value-label}}: {{core-value-data.tooltip}}">{{core-value-data.total}}</span>

View file

@ -9,11 +9,11 @@ SPDX-License-Identifier: MIT
{{#each config.i18n.attributes as |attribute-label attribute-key|}} {{#each config.i18n.attributes as |attribute-label attribute-key|}}
{{> systems/ds4/templates/sheets/actor/components/core-value.hbs core-value-label=attribute-label {{> systems/ds4/templates/sheets/actor/components/core-value.hbs core-value-label=attribute-label
core-value-key=attribute-key core-value-data=(lookup ../data.data.attributes core-value-key=attribute-key core-value-data=(lookup ../data.data.attributes
attribute-key) core-value-variant="attribute"}} attribute-key) core-value-variant="attribute" actor-id=../data._id}}
{{/each}} {{/each}}
{{#each config.i18n.traits as |trait-label trait-key|}} {{#each config.i18n.traits as |trait-label trait-key|}}
{{> systems/ds4/templates/sheets/actor/components/core-value.hbs core-value-label=trait-label {{> systems/ds4/templates/sheets/actor/components/core-value.hbs core-value-label=trait-label
core-value-key=trait-key core-value-key=trait-key
core-value-data=(lookup ../data.data.traits trait-key) core-value-variant="trait"}} core-value-data=(lookup ../data.data.traits trait-key) core-value-variant="trait" actor-id=../data._id}}
{{/each}} {{/each}}
</div> </div>

View file

@ -5,6 +5,6 @@ SPDX-License-Identifier: MIT
--}} --}}
<div class="tab description" data-group="primary" data-tab="description"> <div class="tab description" data-group="primary" data-tab="description">
{{editor content=data.baseInfo.description target="data.baseInfo.description" button=true owner=owner {{editor content=data.data.baseInfo.description target="data.baseInfo.description" button=true owner=owner
editable=editable}} editable=editable}}
</div> </div>