mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2025-05-01 05:51:07 +00:00
Index.html has lost its relevance!
This commit is contained in:
parent
fc91b3696a
commit
1ff8042fc7
5 changed files with 35 additions and 15 deletions
|
@ -23,10 +23,12 @@ function updateHotkeys()
|
|||
}
|
||||
|
||||
var ROW_LAYERS = {}
|
||||
var TREE_LAYERS = {}
|
||||
|
||||
function updateLayers(){
|
||||
LAYERS = Object.keys(layers);
|
||||
ROW_LAYERS = {}
|
||||
TREE_LAYERS = {}
|
||||
for (layer in layers){
|
||||
layers[layer].layer = layer
|
||||
if (layers[layer].upgrades){
|
||||
|
@ -72,12 +74,21 @@ function updateLayers(){
|
|||
}
|
||||
|
||||
if(!layers[layer].componentStyles) layers[layer].componentStyles = {}
|
||||
|
||||
if(layers[layer].symbol === undefined) layers[layer].symbol = layer.charAt(0).toUpperCase() + layer.slice(1)
|
||||
|
||||
row = layers[layer].row
|
||||
if(!ROW_LAYERS[row]) ROW_LAYERS[row] = {}
|
||||
if(!TREE_LAYERS[row]) TREE_LAYERS[row] = []
|
||||
ROW_LAYERS[row][layer]=layer;
|
||||
let position = (layers[layer].position !== undefined ? layers[layer].position : layer)
|
||||
TREE_LAYERS[row].push({layer: layer, position: position})
|
||||
|
||||
|
||||
}
|
||||
for (row in TREE_LAYERS) {
|
||||
TREE_LAYERS[row].sort((a, b) => (a.position > b.position) ? 1 : -1)
|
||||
}
|
||||
|
||||
updateHotkeys()
|
||||
}
|
||||
|
||||
|
@ -94,6 +105,13 @@ function readData(data, args=null){
|
|||
return data;
|
||||
}
|
||||
|
||||
function someLayerUnlocked(row){
|
||||
for (layer in ROW_LAYERS[row])
|
||||
if (player[layer].unl)
|
||||
return true
|
||||
return false
|
||||
}
|
||||
|
||||
// This isn't worth making a .ts file over
|
||||
const UP = 1
|
||||
const DOWN = 2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue