refactor: resturcture files so that lincensing info can be bundled properly

This commit is contained in:
Johannes Loher 2022-01-31 15:13:32 +01:00
parent 699ba74840
commit 1aa284311f
484 changed files with 119 additions and 179 deletions

View file

@ -0,0 +1,17 @@
{{!--
SPDX-FileCopyrightText: 2021 Johannes Loher
SPDX-License-Identifier: MIT
--}}
<div class="ds4-sheet-tab tab biography" data-group="primary" data-tab="biography">
<div class="ds4-biography-tab-content">
<!-- beautify ignore:start -->
<!-- prettier-ignore-start -->
{{!-- remove indentation to avoid annoying Handlebars auto-indent --}}
{{> systems/ds4/templates/sheets/actor/components/profile.hbs}}
{{> systems/ds4/templates/sheets/actor/components/biography.hbs}}
<!-- beautify ignore:end -->
<!-- prettier-ignore-end -->
</div>
</div>

View file

@ -0,0 +1,67 @@
{{!--
SPDX-FileCopyrightText: 2021 Johannes Loher
SPDX-FileCopyrightText: 2021 Gesina Schwalbe
SPDX-License-Identifier: MIT
--}}
<div class="ds4-sheet-tab tab abilities" data-group="primary" data-tab="abilities">
{{!-- TALENT --}}
<h4 class="ds4-embedded-document-list-title">{{localize 'DS4.ItemTypeTalentPlural'}}</h4>
{{#unless (isEmpty itemsByType.talent)}}
<ol class="ds4-embedded-document-list ds4-embedded-document-list--talent item-list">
{{#> systems/ds4/templates/sheets/actor/components/item-list-header.hbs type='talent'}}
{{!-- rank --}}
<div class="ds4-embedded-document-list__clickable sort-items" data-data-path="data.rank.total"
title="{{localize 'DS4.SortByTalentRank'}}">{{localize 'DS4.TalentRank'}}</div>
{{/systems/ds4/templates/sheets/actor/components/item-list-header.hbs}}
{{#each itemsByType.talent as |itemData id|}}
{{#> systems/ds4/templates/sheets/actor/components/item-list-entry.hbs itemData=itemData}}
{{!-- rank --}}
{{> systems/ds4/templates/sheets/actor/components/talent-rank-equation.hbs talentRank=itemData.data.rank}}
{{/systems/ds4/templates/sheets/actor/components/item-list-entry.hbs}}
{{/each}}
</ol>
{{/unless}}
{{> systems/ds4/templates/sheets/shared/components/add-button.hbs title='DS4.UserInteractionAddItemTitle'
documentType='item' type='talent'}}
{{!-- RACIAL ABILITY --}}
<h4 class="ds4-embedded-document-list-title">{{localize 'DS4.ItemTypeRacialAbilityPlural'}}</h4>
{{#unless (isEmpty itemsByType.racialAbility)}}
<ol class="ds4-embedded-document-list ds4-embedded-document-list--racial-ability item-list">
{{> systems/ds4/templates/sheets/actor/components/item-list-header.hbs type='racialAbility'}}
{{#each itemsByType.racialAbility as |itemData id|}}
{{> systems/ds4/templates/sheets/actor/components/item-list-entry.hbs itemData=itemData}}
{{/each}}
</ol>
{{/unless}}
{{> systems/ds4/templates/sheets/shared/components/add-button.hbs title='DS4.UserInteractionAddItemTitle'
documentType='item' type='racialAbility'}}
{{!-- LANGUAGE --}}
<h4 class="ds4-embedded-document-list-title">{{localize 'DS4.ItemTypeLanguagePlural'}}</h4>
{{#unless (isEmpty itemsByType.language)}}
<ol class="ds4-embedded-document-list ds4-embedded-document-list--language item-list">
{{> systems/ds4/templates/sheets/actor/components/item-list-header.hbs type='language'}}
{{#each itemsByType.language as |itemData id|}}
{{> systems/ds4/templates/sheets/actor/components/item-list-entry.hbs itemData=itemData}}
{{/each}}
</ol>
{{/unless}}
{{> systems/ds4/templates/sheets/shared/components/add-button.hbs title='DS4.UserInteractionAddItemTitle'
documentType='item' type='language'}}
{{!-- ALPHABET --}}
<h4 class="ds4-embedded-document-list-title">{{localize 'DS4.ItemTypeAlphabetPlural'}}</h4>
{{#unless (isEmpty itemsByType.alphabet)}}
<ol class="ds4-embedded-document-list ds4-embedded-document-list--alphabet item-list">
{{> systems/ds4/templates/sheets/actor/components/item-list-header.hbs type='alphabet'}}
{{#each itemsByType.alphabet as |itemData id|}}
{{> systems/ds4/templates/sheets/actor/components/item-list-entry.hbs itemData=itemData}}
{{/each}}
</ol>
{{/unless}}
{{> systems/ds4/templates/sheets/shared/components/add-button.hbs title='DS4.UserInteractionAddItemTitle'
documentType='item' type='alphabet'}}
</div>

View file

@ -0,0 +1,11 @@
{{!--
SPDX-FileCopyrightText: 2021 Johannes Loher
SPDX-FileCopyrightText: 2021 Gesina Schwalbe
SPDX-License-Identifier: MIT
--}}
<div class="ds4-sheet-tab tab inventory" data-group="primary" data-tab="inventory">
{{> systems/ds4/templates/sheets/actor/components/currency.hbs}}
{{> systems/ds4/templates/sheets/actor/components/items-overview.hbs}}
</div>

View file

@ -0,0 +1,19 @@
{{!--
SPDX-FileCopyrightText: 2021 Johannes Loher
SPDX-FileCopyrightText: 2021 Gesina Schwalbe
SPDX-License-Identifier: MIT
--}}
<div class="ds4-sheet-tab tab abilities" data-group="primary" data-tab="abilities">
{{#unless (isEmpty itemsByType.specialCreatureAbility)}}
<ol class="ds4-embedded-document-list ds4-embedded-document-list--special-creature-ability item-list">
{{> systems/ds4/templates/sheets/actor/components/item-list-header.hbs type='specialCreatureAbility'}}
{{#each itemsByType.specialCreatureAbility as |itemData id|}}
{{> systems/ds4/templates/sheets/actor/components/item-list-entry.hbs itemData=itemData}}
{{/each}}
</ol>
{{/unless}}
{{> systems/ds4/templates/sheets/shared/components/add-button.hbs title='DS4.UserInteractionAddItemTitle'
documentType='item' type='specialCreatureAbility'}}
</div>

View file

@ -0,0 +1,10 @@
{{!--
SPDX-FileCopyrightText: 2021 Johannes Loher
SPDX-FileCopyrightText: 2021 Gesina Schwalbe
SPDX-License-Identifier: MIT
--}}
<div class="ds4-sheet-tab tab inventory" data-group="primary" data-tab="inventory">
{{> systems/ds4/templates/sheets/actor/components/items-overview.hbs}}
</div>

View file

@ -0,0 +1,10 @@
{{!--
SPDX-FileCopyrightText: 2021 Johannes Loher
SPDX-License-Identifier: MIT
--}}
<div class="ds4-sheet-tab tab description" data-group="primary" data-tab="description">
{{editor content=data.data.baseInfo.description target="data.baseInfo.description" button=true owner=owner
editable=editable}}
</div>

View file

@ -0,0 +1,19 @@
{{!--
SPDX-FileCopyrightText: 2021 Johannes Loher
SPDX-FileCopyrightText: 2021 Gesina Schwalbe
SPDX-License-Identifier: MIT
--}}
<div class="ds4-sheet-tab tab effects" data-group="primary" data-tab="effects">
{{#unless (isEmpty data.effects)}}
<ol class="ds4-embedded-document-list ds4-embedded-document-list--effect effect-list">
{{> systems/ds4/templates/sheets/actor/components/effect-list-header.hbs}}
{{#each enrichedEffects as |effectData id| }}
{{> systems/ds4/templates/sheets/actor/components/effect-list-entry.hbs effectData=effectData}}
{{/each}}
</ol>
{{/unless}}
{{> systems/ds4/templates/sheets/shared/components/add-button.hbs title='DS4.UserInteractionAddEffectTitle'
documentType='effect'}}
</div>

View file

@ -0,0 +1,103 @@
{{!--
SPDX-FileCopyrightText: 2021 Johannes Loher
SPDX-FileCopyrightText: 2021 Gesina Schwalbe
SPDX-License-Identifier: MIT
--}}
{{!-- ======================================================================== --}}
{{!-- INLINE PARTIAL DEFINITIONS --}}
{{!-- ======================================================================== --}}
{{!--
!-- Base template to display a value with unit.
!-- @param unitDatum: the object to display; must have a value and a unit attribute
!-- @param titleKey: The key of the localized title to use.
!-- @param unitNames: mapping of allowed unitDatum.unit values to localized unit name
!-- @param unitAbbrs: mapping of allowed unitDatum.unit values to unit abbreviation
--}}
{{#*inline "unit"}}
<div title="{{localize titleKey}} [{{lookup unitNames unitDatum.unit}}]">
{{#if unitDatum.value }}
{{unitDatum.value}}&thinsp;{{lookup unitAbbrs unitDatum.unit}}
{{else}}-{{/if}}
</div>
{{/inline}}
{{!--
!-- Three templates based on the "unit" template for displaying values with unit.
!-- Both accept a `config` object holding the unitNames and unitAbbr instead of
!-- directly handing over the latter two.
!-- @param titleKey: The key of the localized title to use.
--}}
{{#*inline "temporalUnit"}}
{{> unit unitNames=config.i18n.temporalUnits unitAbbrs=config.i18n.temporalUnitsAbbr unitDatum=unitDatum
titleKey=titleKey}}
{{/inline}}
{{#*inline "customTemporalUnit"}}
{{> unit unitNames=config.i18n.customTemporalUnits unitAbbrs=config.i18n.customTemporalUnitsAbbr unitDatum=unitDatum
titleKey=titleKey}}
{{/inline}}
{{#*inline "distanceUnit"}}
{{> unit unitNames=config.i18n.distanceUnits unitAbbrs=config.i18n.distanceUnitsAbbr unitDatum=unitDatum
titleKey=titleKey}}
{{/inline}}
{{!-- ======================================================================== --}}
<div class="ds4-sheet-tab tab spells" data-group="primary" data-tab="spells">
{{#unless (isEmpty itemsByType.spell)}}
<ol class="ds4-embedded-document-list ds4-embedded-document-list--spell item-list">
{{#> systems/ds4/templates/sheets/actor/components/item-list-header.hbs isEquipable=true hideDescription=true
type='spell'}}
{{!-- spell type --}}
<div class="ds4-embedded-document-list__clickable sort-items" data-data-path="data.spellType"
title="{{localize 'DS4.SortBySpellType'}}">{{localize 'DS4.SpellTypeAbbr'}}</div>
{{!-- spell bonus --}}
<div class="ds4-embedded-document-list__clickable sort-items" data-data-path="data.bonus"
title="{{localize 'DS4.SortBySpellBonus'}}">{{localize 'DS4.SpellBonusAbbr'}}</div>
{{!-- max. distance --}}
<div title="{{localize 'DS4.SpellMaxDistance'}}"><i class="fas fa-ruler"></i></div>
{{!-- duration --}}
<div title="{{localize 'DS4.SpellDuration'}}"><i class="far fa-clock"></i></div>
{{!-- cooldown duration --}}
<div title="{{localize 'DS4.SpellCooldownDuration'}}"><i class="fas fa-hourglass-half"></i></div>
{{/systems/ds4/templates/sheets/actor/components/item-list-header.hbs}}
{{#each itemsByType.spell as |itemData id|}}
{{#> systems/ds4/templates/sheets/actor/components/item-list-entry.hbs itemData=itemData isEquipable=true
hideDescription=true}}
{{!-- spell type --}}
<img class="ds4-embedded-document-list__image"
src="{{lookup ../../config.icons.spellTypes itemData.data.spellType}}"
title="{{lookup ../../config.i18n.spellTypes itemData.data.spellType}}" />
{{!-- spell bonus --}}
<input class="ds4-embedded-document-list__editable change-item" type="text" data-dtype="String"
data-property="data.bonus" value="{{itemData.data.bonus}}" title="{{localize 'DS4.SpellBonus'}}" />
{{!-- max. distance --}}
{{> distanceUnit titleKey='DS4.SpellMaxDistance' unitDatum=itemData.data.maxDistance
config=../../config}}
{{!-- duration --}}
{{> customTemporalUnit titleKey='DS4.SpellDuration' unitDatum=itemData.data.duration config=../../config}}
{{!-- cooldown duration --}}
{{> temporalUnit titleKey='DS4.SpellCooldownDuration' unitDatum=itemData.data.cooldownDuration
config=../../config}}
{{/systems/ds4/templates/sheets/actor/components/item-list-entry.hbs}}
{{/each}}
</ol>
{{/unless}}
{{> systems/ds4/templates/sheets/shared/components/add-button.hbs title='DS4.UserInteractionAddItemTitle'
documentType='item' type='spell'}}
</div>

View file

@ -0,0 +1,11 @@
{{!--
SPDX-FileCopyrightText: 2021 Johannes Loher
SPDX-License-Identifier: MIT
--}}
<div class="ds4-sheet-tab tab values" data-group="primary" data-tab="values">
{{> systems/ds4/templates/sheets/actor/components/core-values.hbs}}
{{> systems/ds4/templates/sheets/actor/components/combat-values.hbs}}
{{> systems/ds4/templates/sheets/actor/components/checks.hbs}}
</div>