weaponplanner: fix missing components
This commit is contained in:
@@ -165,9 +165,19 @@
|
|||||||
|
|
||||||
$.getJSON(DATA_PATH + "weapon/" + weapon_id + "_tree.json",
|
$.getJSON(DATA_PATH + "weapon/" + weapon_id + "_tree.json",
|
||||||
function(data) {
|
function(data) {
|
||||||
all_components = Object.keys(
|
// first pass: collect all components and sort them
|
||||||
data[data.length-1]["components"]);
|
var all_dict = {};
|
||||||
|
for (i=0; i<data.length; i++) {
|
||||||
|
var components = Object.keys(data[i]["components"]);
|
||||||
|
for (j=0; j<components.length; j++) {
|
||||||
|
all_dict[components[j]] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var all_components = Object.keys(all_dict);
|
||||||
all_components.sort();
|
all_components.sort();
|
||||||
|
// second pass: generate the fieldset for each weapon
|
||||||
|
// path. Note that the template uses all components
|
||||||
|
// to order the components and make them line up
|
||||||
for (i=0; i<data.length; i++) {
|
for (i=0; i<data.length; i++) {
|
||||||
delta = {};
|
delta = {};
|
||||||
path = data[i];
|
path = data[i];
|
||||||
|
|||||||
Reference in New Issue
Block a user