[#19] Sort recipe names within each optgroup
This commit is contained in:
+7
-1
@@ -123,8 +123,14 @@ function updateCraftingSelector() {
|
|||||||
var $optgroup = $("<optgroup label=\"" + recipebook.name + "\">");
|
var $optgroup = $("<optgroup label=\"" + recipebook.name + "\">");
|
||||||
$selector.append($optgroup);
|
$selector.append($optgroup);
|
||||||
|
|
||||||
|
var names = [];
|
||||||
for (var name in recipebook.recipes) {
|
for (var name in recipebook.recipes) {
|
||||||
$optgroup.append("<option value=\"" + name + "\">" + name + "</option>");
|
names.push(name);
|
||||||
|
}
|
||||||
|
names.sort();
|
||||||
|
|
||||||
|
for (var i = 0; i < names.length; i++) {
|
||||||
|
$optgroup.append("<option value=\"" + names[i] + "\">" + names[i] + "</option>");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$selector.removeAttr("disabled");
|
$selector.removeAttr("disabled");
|
||||||
|
|||||||
@@ -330,6 +330,22 @@
|
|||||||
"output": [[1, "Wrench (industrial craft)"]],
|
"output": [[1, "Wrench (industrial craft)"]],
|
||||||
"input": [[6, "Bronze Ingot"]],
|
"input": [[6, "Bronze Ingot"]],
|
||||||
"tools": ["Crafting Table"]
|
"tools": ["Crafting Table"]
|
||||||
|
}, {
|
||||||
|
"output": [[1, "Detector Cable"]],
|
||||||
|
"input": [[3, "Redstone"], [1, "Electronic Circuit"], [1, "HV 3x Insulated Cable"]],
|
||||||
|
"tools": ["Crafting Table"]
|
||||||
|
}, {
|
||||||
|
"output": [[1, "HV 3x Insulated Cable"]],
|
||||||
|
"input": [[1, "HV 2x Insulated Cable"], [1, "Rubber"]],
|
||||||
|
"tools": []
|
||||||
|
}, {
|
||||||
|
"output": [[1, "HV 2x Insulated Cable"]],
|
||||||
|
"input": [[1, "HV Insulated Cable"], [1, "Rubber"]],
|
||||||
|
"tools": []
|
||||||
|
}, {
|
||||||
|
"output": [[12, "HV Cable"]],
|
||||||
|
"input": [[3, "Refined Iron"]],
|
||||||
|
"tools": ["Crafting Table"]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user