From 45e7400e828acdeaad3a3133c45b8ee4abe74000 Mon Sep 17 00:00:00 2001 From: Siegfried Krug Date: Sun, 10 Jan 2021 19:32:10 +0100 Subject: [PATCH 1/7] add currency and basic display --- src/lang/de.json | 4 ++++ src/lang/en.json | 4 ++++ src/module/actor/actor-data.ts | 7 ++++++ src/module/config.ts | 6 +++++ src/module/ds4.ts | 1 + src/template.json | 5 +++++ .../actor/partials/items-overview.hbs | 22 +++++++++++++++++++ 7 files changed, 49 insertions(+) diff --git a/src/lang/de.json b/src/lang/de.json index d5e4d4f7..581c8fbb 100644 --- a/src/lang/de.json +++ b/src/lang/de.json @@ -113,6 +113,10 @@ "DS4.ProfileWeight": "Gewicht", "DS4.ProfileEyeColor": "Augenfarbe", "DS4.ProfileSpecialCharacteristics": "Besondere Eigenschaften", + "DS4.CurrencyGold": "Gold", + "DS4.CurrencySilver": "Silber", + "DS4.CurrencyCopper": "Kupfer", + "DS4.Currency": "Währung", "DS4.WarningManageActiveEffectOnOwnedItem": "Das Verwalten von aktiven Effekten innerhalb eines besessen Items wird derzeit nicht unterstützt und wird in einem nachfolgenden Update hinzugefügt.", "DS4.ErrorDiceCritOverlap": "Es gibt eine Überlappung zwischen Patzern und Immersiegen.", "DS4.ErrorExplodingRecursionLimitExceeded": "Die maximale Rekursionstiefe für slayende Würfelwürfe wurde überschritten." diff --git a/src/lang/en.json b/src/lang/en.json index 4f79f7ef..ef1d3eab 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -113,6 +113,10 @@ "DS4.ProfileWeight": "Weight", "DS4.ProfileEyeColor": "Eye Color", "DS4.ProfileSpecialCharacteristics": "Special Characteristics", + "DS4.CurrencyGold": "Gold", + "DS4.CurrencySilver": "Silver", + "DS4.CurrencyCopper": "Copper", + "DS4.Currency": "Currency", "DS4.WarningManageActiveEffectOnOwnedItem": "Managing Active Effects within an Owned Item is not currently supported and will be added in a subsequent update.", "DS4.ErrorDiceCritOverlap": "There's an overlap between Fumbles and Coups", "DS4.ErrorExplodingRecursionLimitExceeded": "Maximum recursion depth for exploding dice roll exceeded" diff --git a/src/module/actor/actor-data.ts b/src/module/actor/actor-data.ts index a3ac75b9..97d12f1b 100644 --- a/src/module/actor/actor-data.ts +++ b/src/module/actor/actor-data.ts @@ -6,6 +6,7 @@ export interface DS4ActorDataType { progression: DS4ActorDataProgression; language: DS4ActorDataLanguage; profile: DS4ActorDataProfile; + currency: DS4ActorDataCurrency; } interface DS4ActorDataAttributes { @@ -83,3 +84,9 @@ interface DS4ActorDataProfile { eyeColor: string; specialCharacteristics: string; } + +interface DS4ActorDataCurrency { + gold: number; + silver: number; + copper: number; +} diff --git a/src/module/config.ts b/src/module/config.ts index 03b2c9d5..79ce411c 100644 --- a/src/module/config.ts +++ b/src/module/config.ts @@ -188,4 +188,10 @@ export const DS4 = { eyeColor: "String", specialCharacteristics: "String", }, + + currency: { + gold: "DS4.CurrencyGold", + silver: "DS4.CurrencySilver", + copper: "DS4.CurrencyCopper", + }, }; diff --git a/src/module/ds4.ts b/src/module/ds4.ts index a9d46ac2..29a71aa3 100644 --- a/src/module/ds4.ts +++ b/src/module/ds4.ts @@ -83,6 +83,7 @@ Hooks.once("setup", function () { "progression", "language", "profile", + "currency", ]; // Exclude some from sorting where the default order matters diff --git a/src/template.json b/src/template.json index eee8acee..293d54b9 100644 --- a/src/template.json +++ b/src/template.json @@ -107,6 +107,11 @@ "weight": 0, "eyeColor": "", "specialCharacteristics": "" + }, + "currency": { + "gold": 0, + "silver": 0, + "copper": 0 } } }, diff --git a/src/templates/actor/partials/items-overview.hbs b/src/templates/actor/partials/items-overview.hbs index 676a9bfc..4fa28d97 100644 --- a/src/templates/actor/partials/items-overview.hbs +++ b/src/templates/actor/partials/items-overview.hbs @@ -97,6 +97,28 @@
+ + {{!-- Money --}} +

{{localize 'DS4.Currency'}}

+
    +
  1. +
    {{config.currency.gold}}
    +
    {{config.currency.silver}}
    +
    {{config.currency.copper}}
    +
  2. +
  3. + + + +
  4. +
+ + + + {{!-- WEAPONS --}}

{{localize 'DS4.ItemTypeWeaponPlural'}}

{{!-- {{#if (and (ne itemsByType.weapon undefined) (gt itemsByType.weapon.length 0)) }} --}} From 46ec9b0ac89263391f92e33e553219366390c8dc Mon Sep 17 00:00:00 2001 From: Siegfried Krug Date: Sun, 10 Jan 2021 19:33:55 +0100 Subject: [PATCH 2/7] currency add --- src/module/config.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/module/config.ts b/src/module/config.ts index 79ce411c..b6a75295 100644 --- a/src/module/config.ts +++ b/src/module/config.ts @@ -189,6 +189,10 @@ export const DS4 = { specialCharacteristics: "String", }, + /** + * Define currency elemenrs for handlebars of a character + */ + currency: { gold: "DS4.CurrencyGold", silver: "DS4.CurrencySilver", From c10ab44ea9429bd49474bff57adf41239de429de Mon Sep 17 00:00:00 2001 From: Siegfried Krug Date: Sun, 10 Jan 2021 20:40:26 +0100 Subject: [PATCH 3/7] modifications --- src/module/config.ts | 3 +-- .../actor/partials/items-overview.hbs | 21 +++++++------------ 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/module/config.ts b/src/module/config.ts index b6a75295..171b26f8 100644 --- a/src/module/config.ts +++ b/src/module/config.ts @@ -190,9 +190,8 @@ export const DS4 = { }, /** - * Define currency elemenrs for handlebars of a character + * Define currency elements for handlebars of a character */ - currency: { gold: "DS4.CurrencyGold", silver: "DS4.CurrencySilver", diff --git a/src/templates/actor/partials/items-overview.hbs b/src/templates/actor/partials/items-overview.hbs index 4fa28d97..b35c256a 100644 --- a/src/templates/actor/partials/items-overview.hbs +++ b/src/templates/actor/partials/items-overview.hbs @@ -102,23 +102,18 @@

{{localize 'DS4.Currency'}}

  1. -
    {{config.currency.gold}}
    -
    {{config.currency.silver}}
    -
    {{config.currency.copper}}
    + {{#each config.currency as |currency-name|}} +
    {{currency-name}}
    + {{/each}}
  2. - - - -
  3. -
- + {{#each data.currency as |currency-data-value currency-data-key|}} + + {{/each}} - + {{!-- WEAPONS --}}

{{localize 'DS4.ItemTypeWeaponPlural'}}

{{!-- {{#if (and (ne itemsByType.weapon undefined) (gt itemsByType.weapon.length 0)) }} --}} From 03287b3b98a70b3085f8ceadbf99ca0401cde6eb Mon Sep 17 00:00:00 2001 From: Siegfried Krug Date: Sat, 16 Jan 2021 14:59:54 +0100 Subject: [PATCH 4/7] modify ui --- src/module/config.ts | 2 +- .../actor/partials/items-overview.hbs | 20 ++++++++----------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/module/config.ts b/src/module/config.ts index 171b26f8..9cab1d5f 100644 --- a/src/module/config.ts +++ b/src/module/config.ts @@ -190,7 +190,7 @@ export const DS4 = { }, /** - * Define currency elements for handlebars of a character + * Define currency elements of a character */ currency: { gold: "DS4.CurrencyGold", diff --git a/src/templates/actor/partials/items-overview.hbs b/src/templates/actor/partials/items-overview.hbs index b35c256a..5b47b6a0 100644 --- a/src/templates/actor/partials/items-overview.hbs +++ b/src/templates/actor/partials/items-overview.hbs @@ -97,20 +97,16 @@
- - {{!-- Money --}} + {{!-- Money--}}

{{localize 'DS4.Currency'}}

    -
  1. - {{#each config.currency as |currency-name|}} -
    {{currency-name}}
    - {{/each}} -
  2. -
  3. - {{#each data.currency as |currency-data-value currency-data-key|}} - - {{/each}} +
  4. +
    {{config.currency.gold}}
    + +
    {{config.currency.silver}}
    + +
    {{config.currency.copper}}
    +
From 1bc8fcab658a4a251246396b839eb9e8bc4a7b91 Mon Sep 17 00:00:00 2001 From: Siegfried Krug Date: Sat, 16 Jan 2021 17:59:56 +0100 Subject: [PATCH 5/7] using label for currency types --- src/templates/actor/partials/items-overview.hbs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/templates/actor/partials/items-overview.hbs b/src/templates/actor/partials/items-overview.hbs index 5b47b6a0..7fbd5108 100644 --- a/src/templates/actor/partials/items-overview.hbs +++ b/src/templates/actor/partials/items-overview.hbs @@ -101,12 +101,12 @@

{{localize 'DS4.Currency'}}

  1. -
    {{config.currency.gold}}
    - -
    {{config.currency.silver}}
    - -
    {{config.currency.copper}}
    - + + + + + +
From dee56f12ec4309baa4555b6712f343bfa220ed15 Mon Sep 17 00:00:00 2001 From: Johannes Loher Date: Mon, 18 Jan 2021 19:59:25 +0100 Subject: [PATCH 6/7] remove currency from creature sheet --- src/module/ds4.ts | 2 + src/templates/actor/character-sheet.hbs | 2 +- src/templates/actor/creature-sheet.hbs | 2 +- .../actor/partials/character-inventory.hbs | 21 ++ .../actor/partials/creature-inventory.hbs | 5 + .../actor/partials/items-overview.hbs | 216 ++++++++---------- 6 files changed, 128 insertions(+), 120 deletions(-) create mode 100644 src/templates/actor/partials/character-inventory.hbs create mode 100644 src/templates/actor/partials/creature-inventory.hbs diff --git a/src/module/ds4.ts b/src/module/ds4.ts index 1351b96c..131e6675 100644 --- a/src/module/ds4.ts +++ b/src/module/ds4.ts @@ -64,6 +64,8 @@ async function registerHandlebarsPartials() { "systems/ds4/templates/actor/partials/profile.hbs", "systems/ds4/templates/actor/partials/character-progression.hbs", "systems/ds4/templates/actor/partials/special-creature-abilites-overview.hbs", + "systems/ds4/templates/actor/partials/character-inventory.hbs", + "systems/ds4/templates/actor/partials/creature-inventory.hbs", ]; return loadTemplates(templatePaths); } diff --git a/src/templates/actor/character-sheet.hbs b/src/templates/actor/character-sheet.hbs index 5c0b4358..b1008c7a 100644 --- a/src/templates/actor/character-sheet.hbs +++ b/src/templates/actor/character-sheet.hbs @@ -71,7 +71,7 @@ {{!-- Sheet Body --}}
{{!-- Items Tab --}} - {{> systems/ds4/templates/actor/partials/items-overview.hbs}} + {{> systems/ds4/templates/actor/partials/character-inventory.hbs}} {{!-- Spells Tab --}} {{> systems/ds4/templates/actor/partials/spells-overview.hbs}} diff --git a/src/templates/actor/creature-sheet.hbs b/src/templates/actor/creature-sheet.hbs index 2ebf5977..7571eaba 100644 --- a/src/templates/actor/creature-sheet.hbs +++ b/src/templates/actor/creature-sheet.hbs @@ -61,7 +61,7 @@ {{!-- Sheet Body --}}
{{!-- Items Tab --}} - {{> systems/ds4/templates/actor/partials/items-overview.hbs}} + {{> systems/ds4/templates/actor/partials/creature-inventory.hbs}} {{!-- Special Creature Abilities Tab --}} {{> systems/ds4/templates/actor/partials/special-creature-abilites-overview.hbs}} diff --git a/src/templates/actor/partials/character-inventory.hbs b/src/templates/actor/partials/character-inventory.hbs new file mode 100644 index 00000000..19a4009d --- /dev/null +++ b/src/templates/actor/partials/character-inventory.hbs @@ -0,0 +1,21 @@ +
+ + {{!-- Money--}} +

{{localize 'DS4.CharacterCurrency'}}

+
    +
  1. + + + + + + +
  2. +
+ + {{> systems/ds4/templates/actor/partials/items-overview.hbs}} + +
\ No newline at end of file diff --git a/src/templates/actor/partials/creature-inventory.hbs b/src/templates/actor/partials/creature-inventory.hbs new file mode 100644 index 00000000..b9b8acd6 --- /dev/null +++ b/src/templates/actor/partials/creature-inventory.hbs @@ -0,0 +1,5 @@ +
+ + {{> systems/ds4/templates/actor/partials/items-overview.hbs}} + +
\ No newline at end of file diff --git a/src/templates/actor/partials/items-overview.hbs b/src/templates/actor/partials/items-overview.hbs index a941e6bb..55b34411 100644 --- a/src/templates/actor/partials/items-overview.hbs +++ b/src/templates/actor/partials/items-overview.hbs @@ -93,126 +93,106 @@ {{!-- ======================================================================== --}} +{{!-- WEAPONS --}} +

{{localize 'DS4.ItemTypeWeaponPlural'}}

+{{!-- {{#if (and (ne itemsByType.weapon undefined) (gt itemsByType.weapon.length 0)) }} --}} +{{#> ifHasItemOfType itemsArray=itemsByType.weapon dataType='weapon' }} +
    + {{#> itemListHeader dataType='weapon'}} +
    {{localize 'DS4.AttackTypeAbbr'}}
    +
    + {{localize 'DS4.WeaponBonusAbbr'}} +
    +
    + {{localize 'DS4.OpponentDefenseAbbr'}} +
    + {{/itemListHeader}} + {{#each itemsByType.weapon as |item id|}} + {{#> itemListEntry item=item}} +
    + +
    +
    {{ item.data.data.weaponBonus}}
    +
    {{ item.data.data.opponentDefense}}
    + {{/itemListEntry}} + {{/each}} +
+{{!-- {{else}} +{{> systems/ds4/templates/actor/partials/overview-add-button.hbs dataType='weapon' }} --}} +{{/ifHasItemOfType}} -
- - {{!-- Money--}} -

{{localize 'DS4.CharacterCurrency'}}

-
    -
  1. - - - - - - -
  2. -
- - {{!-- WEAPONS --}} -

{{localize 'DS4.ItemTypeWeaponPlural'}}

- {{!-- {{#if (and (ne itemsByType.weapon undefined) (gt itemsByType.weapon.length 0)) }} --}} - {{#> ifHasItemOfType itemsArray=itemsByType.weapon dataType='weapon' }} -
    - {{#> itemListHeader dataType='weapon'}} -
    {{localize 'DS4.AttackTypeAbbr'}}
    -
    - {{localize 'DS4.WeaponBonusAbbr'}} -
    -
    - {{localize 'DS4.OpponentDefenseAbbr'}} -
    - {{/itemListHeader}} - {{#each itemsByType.weapon as |item id|}} - {{#> itemListEntry item=item}} -
    - -
    -
    {{ item.data.data.weaponBonus}}
    -
    {{ item.data.data.opponentDefense}}
    - {{/itemListEntry}} - {{/each}} -
- {{!-- {{else}} - {{> systems/ds4/templates/actor/partials/overview-add-button.hbs dataType='weapon' }} --}} - {{/ifHasItemOfType}} - - {{!-- ARMOR --}} -

{{localize 'DS4.ItemTypeArmorPlural'}}

- {{#> ifHasItemOfType itemsArray=itemsByType.armor dataType='armor' }} -
    - {{#> itemListHeader dataType='armor'}} -
    {{localize 'DS4.ArmorMaterialTypeAbbr'}}
    -
    {{localize 'DS4.ArmorTypeAbbr'}}
    -
    - {{localize 'DS4.ArmorValueAbbr'}} -
    - {{/itemListHeader}} - {{#each itemsByType.armor as |item id|}} - {{#> itemListEntry item=item }} -
    - {{lookup ../../config.armorMaterialTypesAbbr item.data.data.armorMaterialType}} -
    -
    - {{lookup ../../config.armorTypesAbbr item.data.data.armorType}} -
    -
    {{ item.data.data.armorValue}}
    - {{/itemListEntry}} - {{/each}} -
- {{/ifHasItemOfType}} +{{!-- ARMOR --}} +

{{localize 'DS4.ItemTypeArmorPlural'}}

+{{#> ifHasItemOfType itemsArray=itemsByType.armor dataType='armor' }} +
    + {{#> itemListHeader dataType='armor'}} +
    {{localize 'DS4.ArmorMaterialTypeAbbr'}}
    +
    {{localize 'DS4.ArmorTypeAbbr'}}
    +
    + {{localize 'DS4.ArmorValueAbbr'}} +
    + {{/itemListHeader}} + {{#each itemsByType.armor as |item id|}} + {{#> itemListEntry item=item }} +
    + {{lookup ../../config.armorMaterialTypesAbbr item.data.data.armorMaterialType}} +
    +
    + {{lookup ../../config.armorTypesAbbr item.data.data.armorType}} +
    +
    {{ item.data.data.armorValue}}
    + {{/itemListEntry}} + {{/each}} +
+{{/ifHasItemOfType}} - {{!-- SHIELD --}} -

{{localize 'DS4.ItemTypeShieldPlural'}}

{{!-- SPECIFIC --}} - {{#> ifHasItemOfType itemsArray=itemsByType.shield dataType='shield' }} -
    - {{#> itemListHeader dataType='shield' }} -
    - {{localize 'DS4.ArmorValueAbbr'}} -
    - {{/itemListHeader}} - {{#each itemsByType.shield as |item id|}} - {{#> itemListEntry item=item }} -
    {{item.data.data.armorValue}}
    {{!-- SPECIFIC --}} - {{/itemListEntry}} - {{/each}} -
- {{/ifHasItemOfType}} +{{!-- SHIELD --}} +

{{localize 'DS4.ItemTypeShieldPlural'}}

{{!-- SPECIFIC --}} +{{#> ifHasItemOfType itemsArray=itemsByType.shield dataType='shield' }} +
    + {{#> itemListHeader dataType='shield' }} +
    + {{localize 'DS4.ArmorValueAbbr'}} +
    + {{/itemListHeader}} + {{#each itemsByType.shield as |item id|}} + {{#> itemListEntry item=item }} +
    {{item.data.data.armorValue}}
    {{!-- SPECIFIC --}} + {{/itemListEntry}} + {{/each}} +
+{{/ifHasItemOfType}} - {{!-- TRINKET --}} -

{{localize 'DS4.ItemTypeTrinketPlural'}}

- {{#> ifHasItemOfType itemsArray=itemsByType.trinket dataType='trinket' }} -
    - {{#> itemListHeader dataType='trinket'}} -
    {{localize 'DS4.StorageLocation'}}
    - {{/itemListHeader}} - {{#each itemsByType.trinket as |item id|}} - {{#> itemListEntry item=item }} - - {{/itemListEntry}} - {{/each}} -
- {{/ifHasItemOfType}} +{{!-- TRINKET --}} +

{{localize 'DS4.ItemTypeTrinketPlural'}}

+{{#> ifHasItemOfType itemsArray=itemsByType.trinket dataType='trinket' }} +
    + {{#> itemListHeader dataType='trinket'}} +
    {{localize 'DS4.StorageLocation'}}
    + {{/itemListHeader}} + {{#each itemsByType.trinket as |item id|}} + {{#> itemListEntry item=item }} + + {{/itemListEntry}} + {{/each}} +
+{{/ifHasItemOfType}} - {{!-- EQUIPMENT --}} -

{{localize 'DS4.ItemTypeEquipmentPlural'}}

- {{#> ifHasItemOfType itemsArray=itemsByType.equipment dataType='equipment' }} -
    - {{#> itemListHeader dataType='equipment'}} -
    {{localize 'DS4.StorageLocation'}}
    - {{/itemListHeader}} - {{#each itemsByType.equipment as |item id|}} - {{#> itemListEntry item=item }} - - {{/itemListEntry}} - {{/each}} -
- {{/ifHasItemOfType}} -
\ No newline at end of file +{{!-- EQUIPMENT --}} +

{{localize 'DS4.ItemTypeEquipmentPlural'}}

+{{#> ifHasItemOfType itemsArray=itemsByType.equipment dataType='equipment' }} +
    + {{#> itemListHeader dataType='equipment'}} +
    {{localize 'DS4.StorageLocation'}}
    + {{/itemListHeader}} + {{#each itemsByType.equipment as |item id|}} + {{#> itemListEntry item=item }} + + {{/itemListEntry}} + {{/each}} +
+{{/ifHasItemOfType}} \ No newline at end of file From 2f3ee41a9617abd8e9dd1c17d63bf6dc0a816c04 Mon Sep 17 00:00:00 2001 From: Johannes Loher Date: Mon, 18 Jan 2021 20:02:41 +0100 Subject: [PATCH 7/7] fix URL in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9b502a47..bf43ab43 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ To install and use the Dungeonslayers 4 system for Foundry Virtual Tabletop, simply paste the following URL into the **Install System** dialog on the Setup menu of the application. -https://git.f3l.de/dungeonslayers/ds4/-/raw/master/src/system.json?inline=false +https://git.f3l.de/dungeonslayers/ds4/-/raw/latest/src/system.json?inline=false ## Development