From 1ff8042fc7a3d544da7a38b3b9c6f388379afd80 Mon Sep 17 00:00:00 2001 From: Acamaeda Date: Sat, 10 Oct 2020 23:26:26 -0400 Subject: [PATCH] Index.html has lost its relevance! --- changelog.md | 2 ++ docs/layer-features.md | 5 +++++ index.html | 20 +++++++------------- js/layerSupport.js | 20 +++++++++++++++++++- js/layers.js | 3 ++- 5 files changed, 35 insertions(+), 15 deletions(-) diff --git a/changelog.md b/changelog.md index e253b22..2391801 100644 --- a/changelog.md +++ b/changelog.md @@ -1,9 +1,11 @@ #The Modding Tree changelog: +Tmp does not need to be manually updated. Almost every value in layer data can be a function or a constant value! effectDisplay in Challenges and Upgrades no longer takes an argument You don't have to have the same amount of upgrades in every row (and challs and buyables) Unl is optional for all Big Components (defaults to true). +Moved modInfo to game.js, added a spot for a Discord link, and a separate mod version from the TMT version ##v1.3.5 - Completely automated convertToDecimal, now you never have to worry about it again. diff --git a/docs/layer-features.md b/docs/layer-features.md index a0ab1db..8f3d658 100644 --- a/docs/layer-features.md +++ b/docs/layer-features.md @@ -121,6 +121,11 @@ Key: # Tree/node features +- symbol: **optional**, the text that appears on this layer's node. Default is the layer id with the first letter capitalized + +- position: **optional**, Determines the horizontal position of the layer in its row. By default, it uses the layer id, + and layers are sorted in alphabetical order. + - branches: **optional**, an array of layer ids. On a tree, a line will appear from this layer to all of the layers in the list. Alternatively, an entry in the array can be a pair consisting of the layer id and a color value. The color value can either be a string with a hex color code, or a number from 1-3 (theme-affected colors) diff --git a/index.html b/index.html index 9eb66a7..bb3597c 100644 --- a/index.html +++ b/index.html @@ -8,8 +8,8 @@ - + @@ -64,7 +64,7 @@


{{modInfo.discordName}}
- The Modding Tree Discord
+ The Modding Tree Discord
Main Prestige Tree server

Note by Jacorb: If anyone wishes to make a mod of this game, that is perfectly fine with me, just make sure to name it something different (ex: Prestige Tree NG+) and to let me know on my discord. @@ -118,17 +118,11 @@
({{format(getPointGen())}}/sec)



- - - -
- -
- - -


- -
+ + + +


+
diff --git a/js/layerSupport.js b/js/layerSupport.js index bfd5820..6cdd47f 100644 --- a/js/layerSupport.js +++ b/js/layerSupport.js @@ -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 diff --git a/js/layers.js b/js/layers.js index 0163a93..1f3080b 100644 --- a/js/layers.js +++ b/js/layers.js @@ -1,6 +1,8 @@ addLayer("c", { layer: "c", // This is assigned automatically, both to the layer and all upgrades, etc. Shown here so you know about it name: "Candies", // This is optional, only used in a few places, If absent it just uses the layer id. + symbol: "C", // This appears on the layer's node. Default is the id with the first letter capitalized + position: 0, // Horizontal position within a row. By default it uses the layer id and sorts in alphabetical order startData() { return { unl: true, points: new Decimal(0), @@ -346,4 +348,3 @@ addLayer("f", { }, ) -