From 9addb66a50bcec5a9d30a4aa163b672ed4ef0acd Mon Sep 17 00:00:00 2001 From: Gesina Schwalbe Date: Fri, 8 Jan 2021 22:34:34 +0100 Subject: [PATCH 1/4] removed redundant field racialAbilities from actor --- src/lang/en.json | 1 - src/module/actor/actor-data.ts | 1 - src/module/config.ts | 1 - src/template.json | 1 - 4 files changed, 4 deletions(-) diff --git a/src/lang/en.json b/src/lang/en.json index 267e0b2..4396c64 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -88,7 +88,6 @@ "DS4.BaseInfoRace": "Race", "DS4.BaseInfoClass": "Class", "DS4.BaseInfoHeroClass": "Hero Class", - "DS4.BaseInfoRacialAbilities": "Racial Abilites", "DS4.BaseInfoCulture": "Culture", "DS4.ProgressionLevel": "Level", "DS4.ProgressionExperiencePoints": "Experience Points", diff --git a/src/module/actor/actor-data.ts b/src/module/actor/actor-data.ts index 4269bce..a3ac75b 100644 --- a/src/module/actor/actor-data.ts +++ b/src/module/actor/actor-data.ts @@ -57,7 +57,6 @@ interface DS4ActorDataBaseInfo { race: string; class: string; heroClass: string; - racialAbilities: string; culture: string; } diff --git a/src/module/config.ts b/src/module/config.ts index 28e0a65..16f7b5d 100644 --- a/src/module/config.ts +++ b/src/module/config.ts @@ -136,7 +136,6 @@ export const DS4 = { race: "DS4.BaseInfoRace", class: "DS4.BaseInfoClass", heroClass: "DS4.BaseInfoHeroClass", - racialAbilities: "DS4.BaseInfoRacialAbilities", culture: "DS4.BaseInfoCulture", }, diff --git a/src/template.json b/src/template.json index 6e8d635..14a9d87 100644 --- a/src/template.json +++ b/src/template.json @@ -83,7 +83,6 @@ "race": "", "class": "", "heroClass": "", - "racialAbilities": "", "culture": "" }, "progression": { From f8e1f32439100df543e7014fd9505f018028d5da Mon Sep 17 00:00:00 2001 From: Gesina Schwalbe Date: Fri, 8 Jan 2021 23:23:53 +0100 Subject: [PATCH 2/4] added language item - added to database and localization definitions - added sheet - added to talents overview --- src/lang/en.json | 2 + src/module/config.ts | 1 + src/module/ds4.ts | 1 + src/module/item/item-data.ts | 4 +- src/template.json | 5 +- .../actor/partials/talents-overview.hbs | 48 +++++++++++++------ src/templates/item/language-sheet.hbs | 8 ++++ src/templates/item/partials/sheet-header.hbs | 8 ++++ 8 files changed, 60 insertions(+), 17 deletions(-) create mode 100644 src/templates/item/language-sheet.hbs create mode 100644 src/templates/item/partials/sheet-header.hbs diff --git a/src/lang/en.json b/src/lang/en.json index 4396c64..f9a6804 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -44,6 +44,8 @@ "DS4.ItemTypeTalentPlural": "Talents", "DS4.ItemTypeRacialAbility": "Racial Ability", "DS4.ItemTypeRacialAbilityPlural": "Racial Abilities", + "DS4.ItemTypeLanguage": "Language", + "DS4.ItemTypeLanguagePlural": "Languages", "DS4.ArmorType": "Armor Type", "DS4.ArmorTypeAbbr": "AT", "DS4.ArmorMaterialType": "Material Type", diff --git a/src/module/config.ts b/src/module/config.ts index 16f7b5d..3849290 100644 --- a/src/module/config.ts +++ b/src/module/config.ts @@ -50,6 +50,7 @@ export const DS4 = { equipment: "DS4.ItemTypeEquipment", talent: "DS4.ItemTypeTalent", racialAbility: "DS4.ItemTypeRacialAbility", + language: "DS4.ItemTypeLanguage", }, /** diff --git a/src/module/ds4.ts b/src/module/ds4.ts index 6fe0aa7..3e727a4 100644 --- a/src/module/ds4.ts +++ b/src/module/ds4.ts @@ -32,6 +32,7 @@ Hooks.once("init", async function () { async function registerHandlebarsPartials() { const templatePaths = [ + "systems/ds4/templates/item/partials/sheet-header.hbs", "systems/ds4/templates/item/partials/description.hbs", "systems/ds4/templates/item/partials/details.hbs", "systems/ds4/templates/item/partials/effects.hbs", diff --git a/src/module/item/item-data.ts b/src/module/item/item-data.ts index 76b90e7..6a9cd8d 100644 --- a/src/module/item/item-data.ts +++ b/src/module/item/item-data.ts @@ -7,7 +7,8 @@ export type DS4ItemDataType = | DS4Trinket | DS4Equipment | DS4Talent - | DS4RacialAbility; + | DS4RacialAbility + | DS4Language; // types @@ -34,6 +35,7 @@ interface DS4Shield extends DS4ItemBase, DS4ItemPhysical, DS4ItemEquipable, DS4I interface DS4Trinket extends DS4ItemBase, DS4ItemPhysical, DS4ItemEquipable {} interface DS4Equipment extends DS4ItemBase, DS4ItemPhysical {} type DS4RacialAbility = DS4ItemBase; +type DS4Language = DS4ItemBase; // templates diff --git a/src/template.json b/src/template.json index 14a9d87..cc3e291 100644 --- a/src/template.json +++ b/src/template.json @@ -115,7 +115,7 @@ } }, "Item": { - "types": ["weapon", "armor", "shield", "trinket", "equipment", "talent", "racialAbility"], + "types": ["weapon", "armor", "shield", "trinket", "equipment", "talent", "racialAbility", "language"], "templates": { "base": { "description": "" @@ -163,6 +163,9 @@ }, "racialAbility": { "templates": ["base"] + }, + "language": { + "templates": ["base"] } } } diff --git a/src/templates/actor/partials/talents-overview.hbs b/src/templates/actor/partials/talents-overview.hbs index 179703e..753e16b 100644 --- a/src/templates/actor/partials/talents-overview.hbs +++ b/src/templates/actor/partials/talents-overview.hbs @@ -25,7 +25,6 @@ !-- The partial assumes a variable item to be given in the context. !-- !-- @param item: hand over the item to the partial as hash parameter -!-- @param partial-block: hand over custom children of the flexbox in the partial block. --}} {{#*inline "talentListEntry"}}
  • @@ -58,14 +57,14 @@ {{!-- -!-- Render a racial ability list row from a given item. +!-- Render a list row for a base item from a given item. +!-- Base item means it just has an image, a description, and a name (and effects). !-- It is a flexbox with a child for each item value of interest. !-- The partial assumes a variable item to be given in the context. !-- !-- @param item: hand over the item to the partial as hash parameter -!-- @param partial-block: hand over custom children of the flexbox in the partial block. --}} -{{#*inline "racialAbilityListEntry"}} +{{#*inline "baseItemListEntry"}}
  • {{!-- image --}}
    @@ -81,6 +80,26 @@
  • {{/inline}} +{{!-- +!-- Render a list header for a base item list entries from a given item. +!-- The partial assumes a variable dataType to be given in the context. +!-- +!-- @param dataType: the string item type for the list +--}} +{{#*inline "baseItemListHeader"}} +
  • + {{!-- image --}} +
    + {{!-- name --}} +
    {{localize 'DS4.ItemName'}}
    + {{!-- description --}} +
    {{localize 'DS4.HeadingDescription'}}
    + {{!-- add button --}} + {{> systems/ds4/templates/actor/partials/overview-add-button.hbs dataType=dataType }} +
  • +{{/inline}} + + {{!-- ======================================================================== --}} @@ -106,18 +125,17 @@

    {{localize 'DS4.ItemTypeRacialAbilityPlural'}}

      -
    1. - {{!-- image --}} -
      - {{!-- name --}} -
      {{localize 'DS4.ItemName'}}
      - {{!-- description --}} -
      {{localize 'DS4.HeadingDescription'}}
      - {{!-- add button --}} - {{> systems/ds4/templates/actor/partials/overview-add-button.hbs dataType='racialAbility' }} -
    2. + {{> baseItemListHeader dataType='racialAbility' }} {{#each itemsByType.racialAbility as |item id|}} - {{> racialAbilityListEntry item=item}} + {{> baseItemListEntry item=item}} + {{/each}} +
    + +

    {{localize 'DS4.ItemTypeLanguagePlural'}}

    +
      + {{> baseItemListHeader dataType='language' }} + {{#each itemsByType.language as |item id|}} + {{> baseItemListEntry item=item}} {{/each}}
    \ No newline at end of file diff --git a/src/templates/item/language-sheet.hbs b/src/templates/item/language-sheet.hbs new file mode 100644 index 0000000..cfd63f9 --- /dev/null +++ b/src/templates/item/language-sheet.hbs @@ -0,0 +1,8 @@ +
    + {{#> systems/ds4/templates/item/partials/sheet-header.hbs}} + {{/systems/ds4/templates/item/partials/sheet-header.hbs}} + + {{!-- Common Item body --}} + {{> systems/ds4/templates/item/partials/body.hbs}} + +
    \ No newline at end of file diff --git a/src/templates/item/partials/sheet-header.hbs b/src/templates/item/partials/sheet-header.hbs new file mode 100644 index 0000000..cef12b2 --- /dev/null +++ b/src/templates/item/partials/sheet-header.hbs @@ -0,0 +1,8 @@ +
    + +
    +

    +

    {{localize (lookup config.itemTypes item.type)}}

    + {{> @partial-block}} +
    +
    \ No newline at end of file From 1011b8506779541ad19dd5fb723d8f72ab0979ee Mon Sep 17 00:00:00 2001 From: Gesina Schwalbe Date: Fri, 8 Jan 2021 23:32:35 +0100 Subject: [PATCH 3/4] moved redundant item sheet header into partial --- src/templates/item/armor-sheet.hbs | 9 +--- src/templates/item/equipment-sheet.hbs | 9 +--- src/templates/item/racialAbility-sheet.hbs | 9 +--- src/templates/item/shield-sheet.hbs | 19 ++++----- src/templates/item/talent-sheet.hbs | 19 ++++----- src/templates/item/trinket-sheet.hbs | 9 +--- src/templates/item/weapon-sheet.hbs | 49 ++++++++++------------ 7 files changed, 44 insertions(+), 79 deletions(-) diff --git a/src/templates/item/armor-sheet.hbs b/src/templates/item/armor-sheet.hbs index b788713..1a2a14b 100644 --- a/src/templates/item/armor-sheet.hbs +++ b/src/templates/item/armor-sheet.hbs @@ -1,9 +1,5 @@
    -
    - -
    -

    -

    {{localize (lookup config.itemTypes item.type)}}

    + {{#> systems/ds4/templates/item/partials/sheet-header.hbs}}
    @@ -31,8 +27,7 @@ placeholder="0" data-dtype="Number" />
    -
    -
    + {{/systems/ds4/templates/item/partials/sheet-header.hbs}} {{!-- Common Item body --}} {{> systems/ds4/templates/item/partials/body.hbs}} diff --git a/src/templates/item/equipment-sheet.hbs b/src/templates/item/equipment-sheet.hbs index 5c2c3d4..3fa5d4a 100644 --- a/src/templates/item/equipment-sheet.hbs +++ b/src/templates/item/equipment-sheet.hbs @@ -1,11 +1,6 @@ -
    - -
    -

    -

    {{localize (lookup config.itemTypes item.type)}}

    -
    -
    + {{#> systems/ds4/templates/item/partials/sheet-header.hbs}} + {{/systems/ds4/templates/item/partials/sheet-header.hbs}} {{!-- Common Item body --}} {{> systems/ds4/templates/item/partials/body.hbs}} diff --git a/src/templates/item/racialAbility-sheet.hbs b/src/templates/item/racialAbility-sheet.hbs index 46dcf47..4077148 100644 --- a/src/templates/item/racialAbility-sheet.hbs +++ b/src/templates/item/racialAbility-sheet.hbs @@ -1,11 +1,6 @@ -
    - -
    -

    -

    {{localize (lookup config.itemTypes item.type)}}

    -
    -
    + {{#> systems/ds4/templates/item/partials/sheet-header.hbs}} + {{/systems/ds4/templates/item/partials/sheet-header.hbs}} {{!-- Common Item body --}} {{> systems/ds4/templates/item/partials/body.hbs}} diff --git a/src/templates/item/shield-sheet.hbs b/src/templates/item/shield-sheet.hbs index ede8965..1c1092c 100644 --- a/src/templates/item/shield-sheet.hbs +++ b/src/templates/item/shield-sheet.hbs @@ -1,18 +1,13 @@ -
    - -
    -

    -

    {{localize (lookup config.itemTypes item.type)}}

    -
    -
    - - -
    + {{#> systems/ds4/templates/item/partials/sheet-header.hbs}} +
    +
    + +
    -
    + {{/systems/ds4/templates/item/partials/sheet-header.hbs}} {{!-- Common Item body --}} {{> systems/ds4/templates/item/partials/body.hbs}} diff --git a/src/templates/item/talent-sheet.hbs b/src/templates/item/talent-sheet.hbs index a4be9b0..1611bee 100644 --- a/src/templates/item/talent-sheet.hbs +++ b/src/templates/item/talent-sheet.hbs @@ -17,19 +17,14 @@ -
    - -
    -

    -

    {{localize (lookup config.itemTypes item.type)}}

    -
    - {{> talentRankBasicProperty data=data property='base' localizeString='DS4.TalentRankBase' }} - {{> talentRankBasicProperty data=data property='max' localizeString='DS4.TalentRankMax'}} - {{> talentRankBasicProperty data=data property='mod' localizeString='DS4.TalentRankMod'}} - {{> talentRankBasicProperty data=data property='total' localizeString='DS4.TalentRankTotal' disabled='disabled'}} -
    + {{#> systems/ds4/templates/item/partials/sheet-header.hbs}} +
    + {{> talentRankBasicProperty data=data property='base' localizeString='DS4.TalentRankBase' }} + {{> talentRankBasicProperty data=data property='max' localizeString='DS4.TalentRankMax'}} + {{> talentRankBasicProperty data=data property='mod' localizeString='DS4.TalentRankMod'}} + {{> talentRankBasicProperty data=data property='total' localizeString='DS4.TalentRankTotal' disabled='disabled'}}
    -
    + {{/systems/ds4/templates/item/partials/sheet-header.hbs}} {{!-- Common Item body --}} {{> systems/ds4/templates/item/partials/body.hbs}} diff --git a/src/templates/item/trinket-sheet.hbs b/src/templates/item/trinket-sheet.hbs index 5c2c3d4..3fa5d4a 100644 --- a/src/templates/item/trinket-sheet.hbs +++ b/src/templates/item/trinket-sheet.hbs @@ -1,11 +1,6 @@ -
    - -
    -

    -

    {{localize (lookup config.itemTypes item.type)}}

    -
    -
    + {{#> systems/ds4/templates/item/partials/sheet-header.hbs}} + {{/systems/ds4/templates/item/partials/sheet-header.hbs}} {{!-- Common Item body --}} {{> systems/ds4/templates/item/partials/body.hbs}} diff --git a/src/templates/item/weapon-sheet.hbs b/src/templates/item/weapon-sheet.hbs index 24a5f2d..6914537 100644 --- a/src/templates/item/weapon-sheet.hbs +++ b/src/templates/item/weapon-sheet.hbs @@ -1,33 +1,28 @@ -
    - -
    -

    -

    {{localize (lookup config.itemTypes item.type)}}

    -
    -
    - - -
    -
    - - -
    -
    - - -
    + {{#> systems/ds4/templates/item/partials/sheet-header.hbs}} +
    +
    + + +
    +
    + + +
    +
    + +
    -
    + {{/systems/ds4/templates/item/partials/sheet-header.hbs}} {{!-- Common Item body --}} {{> systems/ds4/templates/item/partials/body.hbs}} From 737a644ecd3b22d1aff435359267141c6238c4f5 Mon Sep 17 00:00:00 2001 From: Gesina Schwalbe Date: Fri, 8 Jan 2021 23:54:41 +0100 Subject: [PATCH 4/4] added alphabet item - added to database and localization definitions - added sheet - added to talents & abilities tab - removed languages & alphabets from actor properties --- src/lang/en.json | 2 ++ src/module/config.ts | 1 + src/module/item/item-data.ts | 4 +++- src/template.json | 19 ++++++++++++++----- .../actor/partials/talents-overview.hbs | 8 ++++++++ src/templates/item/alphabet-sheet.hbs | 8 ++++++++ 6 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 src/templates/item/alphabet-sheet.hbs diff --git a/src/lang/en.json b/src/lang/en.json index f9a6804..7867592 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -46,6 +46,8 @@ "DS4.ItemTypeRacialAbilityPlural": "Racial Abilities", "DS4.ItemTypeLanguage": "Language", "DS4.ItemTypeLanguagePlural": "Languages", + "DS4.ItemTypeAlphabet": "Alphabet", + "DS4.ItemTypeAlphabetPlural": "Alphabets", "DS4.ArmorType": "Armor Type", "DS4.ArmorTypeAbbr": "AT", "DS4.ArmorMaterialType": "Material Type", diff --git a/src/module/config.ts b/src/module/config.ts index 3849290..03b2c9d 100644 --- a/src/module/config.ts +++ b/src/module/config.ts @@ -51,6 +51,7 @@ export const DS4 = { talent: "DS4.ItemTypeTalent", racialAbility: "DS4.ItemTypeRacialAbility", language: "DS4.ItemTypeLanguage", + alphabet: "DS4.ItemTypeAlphabet", }, /** diff --git a/src/module/item/item-data.ts b/src/module/item/item-data.ts index 6a9cd8d..23105eb 100644 --- a/src/module/item/item-data.ts +++ b/src/module/item/item-data.ts @@ -8,7 +8,8 @@ export type DS4ItemDataType = | DS4Equipment | DS4Talent | DS4RacialAbility - | DS4Language; + | DS4Language + | DS4Alphabet; // types @@ -36,6 +37,7 @@ interface DS4Trinket extends DS4ItemBase, DS4ItemPhysical, DS4ItemEquipable {} interface DS4Equipment extends DS4ItemBase, DS4ItemPhysical {} type DS4RacialAbility = DS4ItemBase; type DS4Language = DS4ItemBase; +type DS4Alphabet = DS4ItemBase; // templates diff --git a/src/template.json b/src/template.json index cc3e291..eee8ace 100644 --- a/src/template.json +++ b/src/template.json @@ -97,10 +97,6 @@ "used": 0 } }, - "language": { - "languages": "", - "alphabets": "" - }, "profile": { "gender": "", "birthday": "", @@ -115,7 +111,17 @@ } }, "Item": { - "types": ["weapon", "armor", "shield", "trinket", "equipment", "talent", "racialAbility", "language"], + "types": [ + "weapon", + "armor", + "shield", + "trinket", + "equipment", + "talent", + "racialAbility", + "language", + "alphabet" + ], "templates": { "base": { "description": "" @@ -166,6 +172,9 @@ }, "language": { "templates": ["base"] + }, + "alphabet": { + "templates": ["base"] } } } diff --git a/src/templates/actor/partials/talents-overview.hbs b/src/templates/actor/partials/talents-overview.hbs index 753e16b..7aa194e 100644 --- a/src/templates/actor/partials/talents-overview.hbs +++ b/src/templates/actor/partials/talents-overview.hbs @@ -138,4 +138,12 @@ {{> baseItemListEntry item=item}} {{/each}} + +

    {{localize 'DS4.ItemTypeAlphabetPlural'}}

    +
      + {{> baseItemListHeader dataType='alphabet' }} + {{#each itemsByType.alphabet as |item id|}} + {{> baseItemListEntry item=item}} + {{/each}} +
    \ No newline at end of file diff --git a/src/templates/item/alphabet-sheet.hbs b/src/templates/item/alphabet-sheet.hbs new file mode 100644 index 0000000..cfd63f9 --- /dev/null +++ b/src/templates/item/alphabet-sheet.hbs @@ -0,0 +1,8 @@ + + {{#> systems/ds4/templates/item/partials/sheet-header.hbs}} + {{/systems/ds4/templates/item/partials/sheet-header.hbs}} + + {{!-- Common Item body --}} + {{> systems/ds4/templates/item/partials/body.hbs}} + + \ No newline at end of file