1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2025-02-17 10:02:45 +00:00
The-Modding-Tree/js/Demo/demoTree.js

55 lines
1.3 KiB
JavaScript
Raw Normal View History

2020-10-27 22:35:07 -04:00
// treeLayout will override the default tree's layout if used
2020-10-29 20:33:39 -04:00
var layoutInfo = {
2020-10-30 19:40:48 -04:00
startTab: "c",
2021-05-27 00:54:58 -04:00
startNavTab: "tree-tab",
2020-10-29 20:33:39 -04:00
showTree: true,
2020-10-27 22:35:07 -04:00
2020-10-29 21:49:34 -04:00
//treeLayout: ""
2020-10-29 20:33:39 -04:00
}
2020-10-27 22:35:07 -04:00
// A "ghost" layer which offsets f in the tree
addNode("spook", {
row: 1,
layerShown: "ghost",
},
)
// A "ghost" layer which offsets f in the tree
addNode("g", {
symbol: "TH",
2021-06-07 00:13:18 -04:00
branches: [["c", "red", 4]],
2020-10-27 22:35:07 -04:00
color: '#6d3678',
layerShown: true,
canClick() {return player.points.gte(10)},
tooltip: "Thanos your points",
tooltipLocked: "Thanos your points",
2020-12-12 21:43:22 -05:00
onClick() {player.points = player.points.div(2)
console.log(this.layer)}
2020-10-27 22:35:07 -04:00
},
)
// A "ghost" layer which offsets f in the tree
addNode("h", {
branches: ["g"],
layerShown: true,
2021-04-26 23:16:34 -04:00
tooltip() {return "Restore your points to " + player.c.otherThingy},
tooltipLocked() {return "Restore your points to " + player.c.otherThingy},
row: "side",
2021-04-26 23:16:34 -04:00
canClick() {return player.points.lt(player.c.otherThingy)},
onClick() {player.points = new Decimal(player.c.otherThingy)}
2020-10-27 22:35:07 -04:00
},
)
2020-10-29 21:49:34 -04:00
addLayer("tree-tab", {
2021-05-26 01:44:12 -04:00
tabFormat: [["tree", function() {return (layoutInfo.treeLayout ? layoutInfo.treeLayout : TREE_LAYERS)}]],
previousTab: "",
leftTab: true,
2021-06-02 18:51:33 -04:00
style() {return {'background-color': '#222222'}},
2021-05-26 01:44:12 -04:00
2020-10-29 21:49:34 -04:00
})