diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c416403..211ed66 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,6 @@ +v2.12 +- Fix turf and cohort edge/flaws checkboxes + v2.11 - Fix localize for Rolls (@kinote) - Adjust avatar image position for Actor, Crew and Item (@olivier-grech) diff --git a/module/blades.js b/module/blades.js index 1d23828..15fc099 100644 --- a/module/blades.js +++ b/module/blades.js @@ -49,6 +49,15 @@ Hooks.once("init", async function() { preloadHandlebarsTemplates(); + // Is the value Turf side. + Handlebars.registerHelper('is_turf_side', function(value, options) { + if (["left", "right", "top", "bottom"].includes(value)) { + return options.fn(this); + } else { + return options.inverse(this); + } + }); + // Multiboxes. Handlebars.registerHelper('multiboxes', function(selected, options) { diff --git a/system.json b/system.json index b7b104e..9cf205e 100644 --- a/system.json +++ b/system.json @@ -2,9 +2,9 @@ "name": "blades-in-the-dark", "title": "Blades in the Dark", "description": "Blades in the dark game system.", - "version": "2.11", + "version": "2.12", "minimumCoreVersion": "0.7.2", - "compatibleCoreVersion": "0.7.8", + "compatibleCoreVersion": "0.7.9", "templateVersion": 1, "author": "megastruktur", "esmodules": [ @@ -32,7 +32,7 @@ ], "url": "https://github.com/megastruktur/foundryvtt-blades-in-the-dark/", "manifest": "https://raw.githubusercontent.com/megastruktur/foundryvtt-blades-in-the-dark/master/system.json", - "download": "https://github.com/megastruktur/foundryvtt-blades-in-the-dark/archive/2.11.zip", + "download": "https://github.com/megastruktur/foundryvtt-blades-in-the-dark/archive/2.12.zip", "packs": [ { "name": "class", diff --git a/template.json b/template.json index 8dfe309..bcd81b5 100644 --- a/template.json +++ b/template.json @@ -237,38 +237,46 @@ "edges_list": { "Fearsome": { "label": "BITD.EdgesFearsome", - "description": "BITD.EdgesFearsomeDescription" + "description": "BITD.EdgesFearsomeDescription", + "selected": false }, "Independent": { "label": "BITD.EdgesIndependent", - "description": "BITD.EdgesIndependentDescription" + "description": "BITD.EdgesIndependentDescription", + "selected": false }, "Loyal": { "label": "BITD.EdgesLoyal", - "description": "BITD.EdgesLoyalDescription" + "description": "BITD.EdgesLoyalDescription", + "selected": false }, "Tenacious": { "label": "BITD.EdgesTenacious", - "description": "BITD.EdgesTenaciousDescription" + "description": "BITD.EdgesTenaciousDescription", + "selected": false } }, "flaws": [], "flaws_list": { "Principled": { "label": "BITD.FlawsPrincipled", - "description": "BITD.FlawsPrincipledDescription" + "description": "BITD.FlawsPrincipledDescription", + "selected": false }, "Savage": { "label": "BITD.FlawsSavage", - "description": "BITD.FlawsSavageDescription" + "description": "BITD.FlawsSavageDescription", + "selected": false }, "Unreliable": { "label": "BITD.FlawsUnreliable", - "description": "BITD.FlawsUnreliableDescription" + "description": "BITD.FlawsUnreliableDescription", + "selected": false }, "Wild": { "label": "BITD.FlawsWild", - "description": "BITD.FlawsWildDescription" + "description": "BITD.FlawsWildDescription", + "selected": false } }, "harm": ["No"], diff --git a/templates/items/cohort.html b/templates/items/cohort.html index 9c393c2..09121de 100644 --- a/templates/items/cohort.html +++ b/templates/items/cohort.html @@ -74,24 +74,22 @@
{{localize "BITD.Edges"}}
{{#each data.edges_list as |edge key|}} - {{#multiboxes ../data.edges}}
- - + +
- {{/multiboxes}} {{/each}}
{{localize "BITD.Flaws"}}
{{#each data.flaws_list as |flaw key|}} - {{#multiboxes ../data.flaws}}
- - + +
- {{/multiboxes}} {{/each}}
diff --git a/templates/parts/cohort-block.html b/templates/parts/cohort-block.html index 3ac0ffd..7c94a6d 100644 --- a/templates/parts/cohort-block.html +++ b/templates/parts/cohort-block.html @@ -27,15 +27,15 @@
- {{#each item.data.edges as |edge key|}} - {{#with (lookup ../item.data.edges_list edge)}} -
{{localize description}} ({{localize label}})
- {{/with}} + {{#each item.data.edges_list as |edge key|}} + {{#if edge.selected }} +
{{localize edge.description}} ({{localize edge.label}})
+ {{/if}} {{/each}} - {{#each item.data.flaws as |flaw key|}} - {{#with (lookup ../item.data.flaws_list flaw)}} -
{{localize description}} ({{localize label}})
- {{/with}} + {{#each item.data.flaws_list as |flaw key|}} + {{#if flaw.selected }} +
{{localize flaw.description}} ({{localize flaw.label}})
+ {{/if}} {{/each}}
diff --git a/templates/parts/turf-list.html b/templates/parts/turf-list.html index 2159e80..96b18aa 100644 --- a/templates/parts/turf-list.html +++ b/templates/parts/turf-list.html @@ -4,8 +4,16 @@ {{#each turfs_data as |turf id|}}
- {{#each turf.connects as |connect|}} -
+ {{#each turf.connects as |connect key|}} + + {{#is_turf_side key}} + {{#if connect}} +
+ {{/if}} + {{else}} +
+ {{/is_turf_side}} + {{/each}} {{#if ../can_edit}} @@ -16,10 +24,10 @@
{{#multiboxes turf.connects}} - - - - + + + + {{/multiboxes}}