renamed talent property from talentRank to rank

This commit is contained in:
Gesina Schwalbe 2021-01-06 11:52:11 +01:00
parent 17b5eee902
commit 98f31d9e8c
5 changed files with 9 additions and 8 deletions

View file

@ -16,7 +16,7 @@ interface DS4Armor extends DS4ItemBase, DS4ItemPhysical, DS4ItemEquipable, DS4It
} }
export interface DS4Talent extends DS4ItemBase { export interface DS4Talent extends DS4ItemBase {
talentRank: DS4TalentRank; rank: DS4TalentRank;
} }
interface DS4TalentRank extends ModifiableData<number> { interface DS4TalentRank extends ModifiableData<number> {

View file

@ -23,7 +23,7 @@ export class DS4Item extends Item<DS4ItemDataType, DS4ActorDataType, DS4Actor> {
prepareDerivedData(): void { prepareDerivedData(): void {
if (this.type === "talent") { if (this.type === "talent") {
const data = this.data.data as DS4Talent; const data = this.data.data as DS4Talent;
data.talentRank.total = data.talentRank.base + data.talentRank.mod; data.rank.total = data.rank.base + data.rank.mod;
} }
} }
} }

View file

@ -140,7 +140,7 @@
}, },
"talent": { "talent": {
"templates": ["base"], "templates": ["base"],
"talentRank": { "rank": {
"base": 0, "base": 0,
"max": 0, "max": 0,
"mod": 0 "mod": 0

View file

@ -1,6 +1,7 @@
{{!-- ======================================================================== --}} {{!-- ======================================================================== --}}
{{!-- INLINE PARTIAL DEFINITIONS --}} {{!-- INLINE PARTIAL DEFINITIONS --}}
{{!-- ======================================================================== --}} {{!-- ======================================================================== --}}
{{!-- TODO: remove duplicate add and delete button definition --}}
{{!-- {{!--
!-- Render an "add" button for a given data type. !-- Render an "add" button for a given data type.
@ -28,9 +29,9 @@
{{#*inline "talentRankValue"}} {{#*inline "talentRankValue"}}
<input class="item-num-val item-change" data-dtype="Number" type="number" min="0" step="1" <input class="item-num-val item-change" data-dtype="Number" type="number" min="0" step="1"
{{#if (eq property 'base') }}max="{{item.data.data.talentRank.max}}"{{/if}} {{#if (eq property 'base') }}max="{{item.data.data.rank.max}}"{{/if}}
{{disabled}} {{disabled}}
data-property="data.talentRank.{{property}}" value="{{lookup item.data.data.talentRank property}}" data-property="data.rank.{{property}}" value="{{lookup item.data.data.rank property}}"
title="{{localize localizeString}}" /> title="{{localize localizeString}}" />
{{/inline}} {{/inline}}

View file

@ -5,10 +5,10 @@
{{#*inline "talentRankSideProperty" }} {{#*inline "talentRankSideProperty" }}
<div class="side-property"> <div class="side-property">
<label for="data.talentRank.{{property}}">{{localize localizeString}}</label> <label for="data.rank.{{property}}">{{localize localizeString}}</label>
<input type="number" min="0" step="1" data-dtype="Number" {{disabled}} <input type="number" min="0" step="1" data-dtype="Number" {{disabled}}
{{#if (eq property 'base') }}max="{{data.talentRank.max}}"{{/if}} {{#if (eq property 'base') }}max="{{data.rank.max}}"{{/if}}
name="data.talentRank.{{property}}" value="{{lookup data.talentRank property}}" /> name="data.rank.{{property}}" value="{{lookup data.rank property}}" />
</div> </div>
{{/inline}} {{/inline}}