mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2024-11-21 16:13:55 +00:00
More code cleanup
This commit is contained in:
parent
945e21a4bd
commit
8e36404ad8
2 changed files with 125 additions and 122 deletions
|
@ -41,6 +41,27 @@ function updateLayers(){
|
|||
TREE_LAYERS = {}
|
||||
OTHER_LAYERS = {}
|
||||
for (layer in layers){
|
||||
setupLayer(layer)
|
||||
}
|
||||
for (row in OTHER_LAYERS) {
|
||||
OTHER_LAYERS[row].sort((a, b) => (a.position > b.position) ? 1 : -1)
|
||||
for (layer in OTHER_LAYERS[row])
|
||||
OTHER_LAYERS[row][layer] = OTHER_LAYERS[row][layer].layer
|
||||
}
|
||||
for (row in TREE_LAYERS) {
|
||||
TREE_LAYERS[row].sort((a, b) => (a.position > b.position) ? 1 : -1)
|
||||
for (layer in TREE_LAYERS[row])
|
||||
TREE_LAYERS[row][layer] = TREE_LAYERS[row][layer].layer
|
||||
}
|
||||
let treeLayers2 = []
|
||||
for (x = 0; x < maxRow + 1; x++) {
|
||||
if (TREE_LAYERS[x]) treeLayers2.push(TREE_LAYERS[x])
|
||||
}
|
||||
TREE_LAYERS = treeLayers2
|
||||
updateHotkeys()
|
||||
}
|
||||
|
||||
function setupLayer(layer){
|
||||
layers[layer].layer = layer
|
||||
if (layers[layer].upgrades){
|
||||
for (thing in layers[layer].upgrades){
|
||||
|
@ -163,23 +184,6 @@ function updateLayers(){
|
|||
if (maxRow < layers[layer].displayRow) maxRow = layers[layer].displayRow
|
||||
|
||||
}
|
||||
for (row in OTHER_LAYERS) {
|
||||
OTHER_LAYERS[row].sort((a, b) => (a.position > b.position) ? 1 : -1)
|
||||
for (layer in OTHER_LAYERS[row])
|
||||
OTHER_LAYERS[row][layer] = OTHER_LAYERS[row][layer].layer
|
||||
}
|
||||
for (row in TREE_LAYERS) {
|
||||
TREE_LAYERS[row].sort((a, b) => (a.position > b.position) ? 1 : -1)
|
||||
for (layer in TREE_LAYERS[row])
|
||||
TREE_LAYERS[row][layer] = TREE_LAYERS[row][layer].layer
|
||||
}
|
||||
let treeLayers2 = []
|
||||
for (x = 0; x < maxRow + 1; x++) {
|
||||
if (TREE_LAYERS[x]) treeLayers2.push(TREE_LAYERS[x])
|
||||
}
|
||||
TREE_LAYERS = treeLayers2
|
||||
updateHotkeys()
|
||||
}
|
||||
|
||||
|
||||
function addLayer(layerName, layerData, tabLayers = null){ // Call this to add layers from a different file!
|
||||
|
|
|
@ -377,7 +377,6 @@ a {
|
|||
display: block;
|
||||
font-size: 20px;
|
||||
color: #41f5f5;
|
||||
text-decoration-line: none;
|
||||
cursor: pointer;
|
||||
font-family: "Lucida Console", "Courier New", monospace;
|
||||
-webkit-text-stroke-width: 1px;
|
||||
|
|
Loading…
Reference in a new issue