From 009b731b7ec8851e84834df0fe652236475e3f0c Mon Sep 17 00:00:00 2001 From: Megastruktur Date: Thu, 17 Sep 2020 10:40:26 +0300 Subject: [PATCH 1/3] GH-76 - Closes #76 - Fixes the "Add multiple items" bug When multiple items were added, the foreach mechanism caused the actor to update multiple times and rewrite previously added items. That's where some items were not actually added to an Actor (the UI was working fine but not the backend part). So it seemed that items are added (you can see them on the UI) but actuallythey were not. Now everything should work fine. --- module/blades-sheet.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/module/blades-sheet.js b/module/blades-sheet.js index 63a37a1..cf34aa6 100644 --- a/module/blades-sheet.js +++ b/module/blades-sheet.js @@ -88,9 +88,7 @@ export class BladesSheet extends ActorSheet { items_to_add.push(items.find(e => e._id === $(this).val())); }); - items_to_add.forEach(e => { - this.actor.createEmbeddedEntity("OwnedItem", duplicate(e)); - }); + this.actor.createEmbeddedEntity("OwnedItem", items_to_add); } /* -------------------------------------------- */ From 41396ddd7321ec343f26b92b1568543f4ede5d58 Mon Sep 17 00:00:00 2001 From: Megastruktur Date: Thu, 17 Sep 2020 10:57:52 +0300 Subject: [PATCH 2/3] GH-77 - Closes #77 - Adds new "concat" handlebars helper to concat str and var - Adds Short attributes names to use them in layout --- lang/en.json | 3 +++ lang/es.json | 3 +++ lang/ru.json | 3 +++ module/blades.js | 13 +++++++++++++ templates/parts/attributes.html | 2 +- 5 files changed, 23 insertions(+), 1 deletion(-) diff --git a/lang/en.json b/lang/en.json index cd0b60a..7a0f03c 100644 --- a/lang/en.json +++ b/lang/en.json @@ -138,18 +138,21 @@ "BITD.EffectGreat": "Great", "BITD.SkillsInsight": "Insight", + "BITD.SkillsInsightShort": "Insight", "BITD.SkillsHunt": "Hunt", "BITD.SkillsStudy": "Study", "BITD.SkillsSurvey": "Survey", "BITD.SkillsTinker": "Tinker", "BITD.SkillsProwess": "Prowess", + "BITD.SkillsProwessShort": "Prowess", "BITD.SkillsFinesse": "Finesse", "BITD.SkillsProwl": "Prowl", "BITD.SkillsSkirmish": "Skirmish", "BITD.SkillsWreck": "Wreck", "BITD.SkillsResolve": "Resolve", + "BITD.SkillsResolveShort": "Resolve", "BITD.SkillsAttune": "Attune", "BITD.SkillsCommand": "Command", "BITD.SkillsConsort": "Consort", diff --git a/lang/es.json b/lang/es.json index efe52e7..de90711 100644 --- a/lang/es.json +++ b/lang/es.json @@ -138,18 +138,21 @@ "BITD.EffectGreat": "Excelente", "BITD.SkillsInsight": "Perspicacia", + "BITD.SkillsInsightShort": "Per.", "BITD.SkillsHunt": "Cazar", "BITD.SkillsStudy": "Estudiar", "BITD.SkillsSurvey": "Analizar", "BITD.SkillsTinker": "Trastear", "BITD.SkillsProwess": "Destreza", + "BITD.SkillsProwessShort": "Des.", "BITD.SkillsFinesse": "Afinar", "BITD.SkillsProwl": "Acechar", "BITD.SkillsSkirmish": "Pelear", "BITD.SkillsWreck": "Destrozar", "BITD.SkillsResolve": "Voluntad", + "BITD.SkillsResolveShort": "Vol.", "BITD.SkillsAttune": "Armonizar", "BITD.SkillsCommand": "Mandar", "BITD.SkillsConsort": "Socializar", diff --git a/lang/ru.json b/lang/ru.json index dfa5222..196b66e 100644 --- a/lang/ru.json +++ b/lang/ru.json @@ -131,16 +131,19 @@ "BITD.EffectStandard": "Средняя", "BITD.EffectGreat": "Высокая", "BITD.SkillsInsight": "Чутьё", + "BITD.SkillsInsightShort": "Чутьё", "BITD.SkillsHunt": "Охота", "BITD.SkillsStudy": "Изучение", "BITD.SkillsSurvey": "Разведка", "BITD.SkillsTinker": "Ремесло", "BITD.SkillsProwess": "Удаль", + "BITD.SkillsProwessShort": "Удаль", "BITD.SkillsFinesse": "Сноровка", "BITD.SkillsProwl": "Проникновение", "BITD.SkillsSkirmish": "Драка", "BITD.SkillsWreck": "Разрушение", "BITD.SkillsResolve": "Воля", + "BITD.SkillsResolveShort": "Воля", "BITD.SkillsAttune": "Манипулирование", "BITD.SkillsCommand": "Приказ", "BITD.SkillsConsort": "Общение", diff --git a/module/blades.js b/module/blades.js index 9316b8f..5171714 100644 --- a/module/blades.js +++ b/module/blades.js @@ -165,6 +165,19 @@ Hooks.once("init", async function() { return accum; }); + // Concat helper + // https://gist.github.com/adg29/f312d6fab93652944a8a1026142491b1 + // Usage: (concat 'first 'second') + Handlebars.registerHelper('concat', function() { + var outStr = ''; + for(var arg in arguments){ + if(typeof arguments[arg]!='object'){ + outStr += arguments[arg]; + } + } + return outStr; + }); + }); /** diff --git a/templates/parts/attributes.html b/templates/parts/attributes.html index 85081cc..fb826ce 100644 --- a/templates/parts/attributes.html +++ b/templates/parts/attributes.html @@ -5,7 +5,7 @@
{{#multiboxes attribute.exp}} From b632b9516d9aad3b5d2a4e8e7c2ee696ed4a6790 Mon Sep 17 00:00:00 2001 From: Megastruktur Date: Thu, 17 Sep 2020 11:00:52 +0300 Subject: [PATCH 3/3] Release 2.3 --- CHANGELOG.txt | 4 ++++ system.json | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 26b41a3..dfc0cce 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,7 @@ +v2.3 +- Added shortened attribute names to use in templates +- Handlebars "concat" helper added + v2.2 - Spanish translation added - Cohorts localization fix diff --git a/system.json b/system.json index f85a418..f62a43e 100644 --- a/system.json +++ b/system.json @@ -2,8 +2,8 @@ "name": "blades-in-the-dark", "title": "Blades in the Dark", "description": "Blades in the dark game system.", - "version": "2.2", - "minimumCoreVersion": "0.5.3", + "version": "2.3", + "minimumCoreVersion": "0.6.6", "compatibleCoreVersion": "0.7.2", "templateVersion": 1, "author": "megastruktur", @@ -31,8 +31,8 @@ } ], "url": "https://github.com/megastruktur/foundryvtt-blades-in-the-dark/", - "manifest": "https://raw.githubusercontent.com/megastruktur/foundryvtt-blades-in-the-dark/2.2/system.json", - "download": "https://github.com/megastruktur/foundryvtt-blades-in-the-dark/archive/2.2.zip", + "manifest": "https://raw.githubusercontent.com/megastruktur/foundryvtt-blades-in-the-dark/2.3/system.json", + "download": "https://github.com/megastruktur/foundryvtt-blades-in-the-dark/archive/2.3.zip", "packs": [ { "name": "class",