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.CombatValuesSpellcasting": "Zaubern",
"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.CharacterBaseInfoClass": "Klasse",
"DS4.CharacterBaseInfoHeroClass": "Heldenklasse",

View file

@ -146,6 +146,14 @@
"DS4.CombatValuesRangedAttack": "Ranged Attack",
"DS4.CombatValuesSpellcasting": "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.CharacterBaseInfoClass": "Class",
"DS4.CharacterBaseInfoHeroClass": "Hero Class",

View file

@ -162,6 +162,20 @@ export const DS4 = {
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
*/

View file

@ -6,13 +6,14 @@
@use "../utils/mixins";
@use "../utils/variables";
@use "../utils/typography";
.ds4-combat-value {
$size: 3.75rem;
display: grid;
place-items: center;
row-gap: 0.5em;
row-gap: 0.125em;
&__value {
$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 {
align-items: center;
justify-content: space-between;

View file

@ -7,11 +7,12 @@
@use "../utils/variables";
.ds4-sheet-tab-nav {
height: auto;
border-top: variables.$border-groove;
border-bottom: variables.$border-groove;
border-top: variables.$border-groove;
height: auto;
&__item {
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-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__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}}
</div>
<span title="{{combat-value-title}}" class="ds4-combat-value__label">{{combat-value-label}}</span>
<div class="ds4-combat-value__formula">
<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>
<input class="ds4-combat-value__formula-modifier" type="number" name="data.combatValues.{{combat-value-key}}.mod"
value='{{combat-value-data.mod}}' data-dtype="Number"
title="{{combat-value-label}} {{localize 'DS4.TooltipModifier'}}" />
<input class="ds4-combat-value__formula-modifier" type="number"
id="data.combatValues.{{combat-value-key}}.mod-{{actor-id}}"
name="data.combatValues.{{combat-value-key}}.mod" value='{{combat-value-data.mod}}' data-dtype="Number"
title="{{combat-value-title}} {{localize 'DS4.TooltipModifier'}}" />
</div>
</div>

View file

@ -6,8 +6,10 @@ SPDX-License-Identifier: MIT
--}}
<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
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}}
</div>

View file

@ -11,21 +11,22 @@ SPDX-License-Identifier: MIT
!-- @param core-value-key: The key of 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 actor-id: The id of the actor the core value belongs to
--}}
<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>
<div class="ds4-core-value__value">
<input class="ds4-core-value__value-input" type="number"
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'}}" />
<span>+</span>
<input class="ds4-core-value__value-input" type="number"
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"
title="{{core-value-label}} {{localize 'DS4.TooltipModifier'}}" />
id="data.{{core-value-variant}}s.{{core-value-key}}.mod-{{actor-id}}" value='{{core-value-data.mod}}'
data-dtype="Number" title="{{core-value-label}} {{localize 'DS4.TooltipModifier'}}" />
<span class="ds4-core-value__value-arrow">➞</span>
<span class="ds4-core-value__value-total"
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|}}
{{> 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
attribute-key) core-value-variant="attribute"}}
attribute-key) core-value-variant="attribute" actor-id=../data._id}}
{{/each}}
{{#each config.i18n.traits as |trait-label trait-key|}}
{{> systems/ds4/templates/sheets/actor/components/core-value.hbs core-value-label=trait-label
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}}
</div>

View file

@ -5,6 +5,6 @@ SPDX-License-Identifier: MIT
--}}
<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}}
</div>