Merge branch 'release/2.12'

This commit is contained in:
Megastruktur 2021-01-04 18:25:07 +03:00
commit e95b79419c
7 changed files with 59 additions and 33 deletions

View file

@ -1,3 +1,6 @@
v2.12
- Fix turf and cohort edge/flaws checkboxes
v2.11 v2.11
- Fix localize for Rolls (@kinote) - Fix localize for Rolls (@kinote)
- Adjust avatar image position for Actor, Crew and Item (@olivier-grech) - Adjust avatar image position for Actor, Crew and Item (@olivier-grech)

View file

@ -49,6 +49,15 @@ Hooks.once("init", async function() {
preloadHandlebarsTemplates(); 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. // Multiboxes.
Handlebars.registerHelper('multiboxes', function(selected, options) { Handlebars.registerHelper('multiboxes', function(selected, options) {

View file

@ -2,9 +2,9 @@
"name": "blades-in-the-dark", "name": "blades-in-the-dark",
"title": "Blades in the Dark", "title": "Blades in the Dark",
"description": "Blades in the dark game system.", "description": "Blades in the dark game system.",
"version": "2.11", "version": "2.12",
"minimumCoreVersion": "0.7.2", "minimumCoreVersion": "0.7.2",
"compatibleCoreVersion": "0.7.8", "compatibleCoreVersion": "0.7.9",
"templateVersion": 1, "templateVersion": 1,
"author": "megastruktur", "author": "megastruktur",
"esmodules": [ "esmodules": [
@ -32,7 +32,7 @@
], ],
"url": "https://github.com/megastruktur/foundryvtt-blades-in-the-dark/", "url": "https://github.com/megastruktur/foundryvtt-blades-in-the-dark/",
"manifest": "https://raw.githubusercontent.com/megastruktur/foundryvtt-blades-in-the-dark/master/system.json", "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": [ "packs": [
{ {
"name": "class", "name": "class",

View file

@ -237,38 +237,46 @@
"edges_list": { "edges_list": {
"Fearsome": { "Fearsome": {
"label": "BITD.EdgesFearsome", "label": "BITD.EdgesFearsome",
"description": "BITD.EdgesFearsomeDescription" "description": "BITD.EdgesFearsomeDescription",
"selected": false
}, },
"Independent": { "Independent": {
"label": "BITD.EdgesIndependent", "label": "BITD.EdgesIndependent",
"description": "BITD.EdgesIndependentDescription" "description": "BITD.EdgesIndependentDescription",
"selected": false
}, },
"Loyal": { "Loyal": {
"label": "BITD.EdgesLoyal", "label": "BITD.EdgesLoyal",
"description": "BITD.EdgesLoyalDescription" "description": "BITD.EdgesLoyalDescription",
"selected": false
}, },
"Tenacious": { "Tenacious": {
"label": "BITD.EdgesTenacious", "label": "BITD.EdgesTenacious",
"description": "BITD.EdgesTenaciousDescription" "description": "BITD.EdgesTenaciousDescription",
"selected": false
} }
}, },
"flaws": [], "flaws": [],
"flaws_list": { "flaws_list": {
"Principled": { "Principled": {
"label": "BITD.FlawsPrincipled", "label": "BITD.FlawsPrincipled",
"description": "BITD.FlawsPrincipledDescription" "description": "BITD.FlawsPrincipledDescription",
"selected": false
}, },
"Savage": { "Savage": {
"label": "BITD.FlawsSavage", "label": "BITD.FlawsSavage",
"description": "BITD.FlawsSavageDescription" "description": "BITD.FlawsSavageDescription",
"selected": false
}, },
"Unreliable": { "Unreliable": {
"label": "BITD.FlawsUnreliable", "label": "BITD.FlawsUnreliable",
"description": "BITD.FlawsUnreliableDescription" "description": "BITD.FlawsUnreliableDescription",
"selected": false
}, },
"Wild": { "Wild": {
"label": "BITD.FlawsWild", "label": "BITD.FlawsWild",
"description": "BITD.FlawsWildDescription" "description": "BITD.FlawsWildDescription",
"selected": false
} }
}, },
"harm": ["No"], "harm": ["No"],

View file

@ -74,24 +74,22 @@
<div class="edgeflaw-container flex-vertical"> <div class="edgeflaw-container flex-vertical">
<div class="label-stripe">{{localize "BITD.Edges"}}</div> <div class="label-stripe">{{localize "BITD.Edges"}}</div>
{{#each data.edges_list as |edge key|}} {{#each data.edges_list as |edge key|}}
{{#multiboxes ../data.edges}}
<div class="edgeflaw flex-horizontal"> <div class="edgeflaw flex-horizontal">
<input id="edge-{{key}}" type="checkbox" name="data.edges" value="{{key}}"> <input id="cohort-{{item._id}}-edge-{{key}}" type="checkbox" name="data.edges_list.{{key}}.selected"
<label for="edge-{{key}}">{{localize edge.label}}</label> {{checked edge.selected}}>
<label for="cohort-{{item._id}}-edge-{{key}}">{{localize edge.label}}</label>
</div> </div>
{{/multiboxes}}
{{/each}} {{/each}}
</div> </div>
<div class="edgeflaw-container flex-vertical"> <div class="edgeflaw-container flex-vertical">
<div class="label-stripe">{{localize "BITD.Flaws"}}</div> <div class="label-stripe">{{localize "BITD.Flaws"}}</div>
{{#each data.flaws_list as |flaw key|}} {{#each data.flaws_list as |flaw key|}}
{{#multiboxes ../data.flaws}}
<div class="edgeflaw flex-horizontal"> <div class="edgeflaw flex-horizontal">
<input id="flaw-{{key}}" type="checkbox" name="data.flaws" value="{{key}}"> <input id="cohort-{{item._id}}-flaw-{{key}}" type="checkbox" name="data.flaws_list.{{key}}.selected"
<label for="flaw-{{key}}">{{localize flaw.label}}</label> {{checked flaw.selected}}>
<label for="cohort-{{item._id}}-flaw-{{key}}">{{localize flaw.label}}</label>
</div> </div>
{{/multiboxes}}
{{/each}} {{/each}}
</div> </div>

View file

@ -27,15 +27,15 @@
<div class="flex-vertical"> <div class="flex-vertical">
<div class="flex-vertical"> <div class="flex-vertical">
{{#each item.data.edges as |edge key|}} {{#each item.data.edges_list as |edge key|}}
{{#with (lookup ../item.data.edges_list edge)}} {{#if edge.selected }}
<div class="description">{{localize description}} <b>({{localize label}})</b></div> <div class="description">{{localize edge.description}} <b>({{localize edge.label}})</b></div>
{{/with}} {{/if}}
{{/each}} {{/each}}
{{#each item.data.flaws as |flaw key|}} {{#each item.data.flaws_list as |flaw key|}}
{{#with (lookup ../item.data.flaws_list flaw)}} {{#if flaw.selected }}
<div class="description">{{localize description}} <b>({{localize label}})</b></div> <div class="description">{{localize flaw.description}} <b>({{localize flaw.label}})</b></div>
{{/with}} {{/if}}
{{/each}} {{/each}}
</div> </div>
</div> </div>

View file

@ -4,8 +4,16 @@
{{#each turfs_data as |turf id|}} {{#each turfs_data as |turf id|}}
<div class="turf-block {{#if turf.value}}turf-selected{{/if}}"> <div class="turf-block {{#if turf.value}}turf-selected{{/if}}">
{{#each turf.connects as |connect|}} {{#each turf.connects as |connect key|}}
<div class="connector {{connect}}"></div>
{{#is_turf_side key}}
{{#if connect}}
<div class="connector {{key}}"></div>
{{/if}}
{{else}}
<div class="connector {{connect}}"></div>
{{/is_turf_side}}
{{/each}} {{/each}}
{{#if ../can_edit}} {{#if ../can_edit}}
@ -16,10 +24,10 @@
<div> <div>
{{#multiboxes turf.connects}} {{#multiboxes turf.connects}}
<input type="checkbox" name="data.turfs.{{id}}.connects" value="left"> <input type="checkbox" name="data.turfs.{{id}}.connects.left" {{checked turf.connects.left}}>
<input type="checkbox" name="data.turfs.{{id}}.connects" value="top"> <input type="checkbox" name="data.turfs.{{id}}.connects.top" {{checked turf.connects.top}}>
<input type="checkbox" name="data.turfs.{{id}}.connects" value="right"> <input type="checkbox" name="data.turfs.{{id}}.connects.right" {{checked turf.connects.right}}>
<input type="checkbox" name="data.turfs.{{id}}.connects" value="bottom"> <input type="checkbox" name="data.turfs.{{id}}.connects.bottom" {{checked turf.connects.bottom}}>
{{/multiboxes}} {{/multiboxes}}
</div> </div>