1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2025-05-11 12:31:08 +00:00

Upgrade trees!

This commit is contained in:
Harley White 2021-06-03 13:02:47 -04:00
parent e7b0af397d
commit 7e364cb9af
5 changed files with 39 additions and 5 deletions
js/technical

View file

@ -45,10 +45,19 @@ function drawTree() {
drawTreeBranch(layer, tmp[layer].branches[branch])
}
}
for(id in layers[layer].upgrades) {
if (tmp[layer].upgrades[id].branches) {
for (branch in tmp[layer].upgrades[id].branches)
{
drawTreeBranch(id, tmp[layer].upgrades[id].branches[branch], "upgrade-" + layer + "-")
}
}
}
}
}
function drawTreeBranch(num1, data) { // taken from Antimatter Dimensions & adjusted slightly
function drawTreeBranch(num1, data, prefix) { // taken from Antimatter Dimensions & adjusted slightly
let num2 = data
let color_id = 1
if (Array.isArray(data)){
@ -58,7 +67,10 @@ function drawTreeBranch(num1, data) { // taken from Antimatter Dimensions & adju
if(typeof(color_id) == "number")
color_id = colors_theme[color_id]
if (prefix) {
num1 = prefix + num1
num2 = prefix + num2
}
if (document.getElementById(num1) == null || document.getElementById(num2) == null)
return