1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2024-11-21 16:13:55 +00:00

Added thing-tree

This commit is contained in:
Harley White 2021-06-07 00:29:22 -04:00
parent 8ae89bd098
commit dde4c00276
6 changed files with 19 additions and 6 deletions

View file

@ -1,8 +1,9 @@
# The Modding Tree changelog: # The Modding Tree changelog:
## v2.6.1 - 6/7/21
- Added global background style to mod.js. - Added global background style to mod.js.
- Tree branches can have custom line widths. - Tree branches can have custom line widths.
- If an upgrade has both canAfford and cost, it checks both. - If an upgrade has both canAfford and cost, it checks both. (So you can use canAfford for other things)
- Releasing a held buyable/clickable with onHold doesn't click it again. - Releasing a held buyable/clickable with onHold doesn't click it again.
- Attempt to fix buttons sometimes not updating. - Attempt to fix buttons sometimes not updating.
- Improvements to theme code, partially by Cubedey. - Improvements to theme code, partially by Cubedey.

View file

@ -65,4 +65,4 @@ If you want to do something more complicated like upgrades that cost two currenc
- branches: **optional**, This is primarially useful for upgrade trees. An array of upgrade ids. A line will appear from this upgrade to all of the upgrades in the list. Alternatively, an entry in the array can be a 2 or 3-element array consisting of the upgrade 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). The third element optionally specifies line width. - branches: **optional**, This is primarially useful for upgrade trees. An array of upgrade ids. A line will appear from this upgrade to all of the upgrades in the list. Alternatively, an entry in the array can be a 2-element array consisting of the upgrade 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). A third element in the array optionally specifies line width.

View file

@ -126,5 +126,7 @@
<bg :layer="player.tab" ></bg> <bg :layer="player.tab" ></bg>
</div> </div>
<div class = "bg2" v-bind:style = "tmp.backgroundStyle"></div>
</div> </div>
</body> </body>

View file

@ -11,7 +11,7 @@ let modInfo = {
// Set your version in num and name // Set your version in num and name
let VERSION = { let VERSION = {
num: "2.6.0.1", num: "2.6.1",
name: "Fixed Reality", name: "Fixed Reality",
} }

View file

@ -510,16 +510,26 @@ function loadVue() {
computed: { computed: {
key() {return this.$vnode.key} key() {return this.$vnode.key}
}, },
template: `<thing-tree :layer="layer" :data = "data" :type = "'upgrade'"></thing-tree>`
})
// Data is an array with the structure of the tree
Vue.component('thing-tree', {
props: ['layer', 'data', 'type'],
computed: {
key() {return this.$vnode.key}
},
template: `<div> template: `<div>
<span class="upgRow" v-for="(row, r) in data"><table> <span class="upgRow" v-for="(row, r) in data"><table>
<span v-for="id in row" style = "{width: 0px; height: 0px;}" v-if="tmp[layer].upgrades[id]!== undefined && tmp[layer].upgrades[id].unlocked" class="upgAlign"> <span v-for="id in row" style = "{width: 0px; height: 0px;}" v-if="tmp[layer][type+'s'][id]!== undefined && tmp[layer][type+'s'][id].unlocked" class="upgAlign">
<upgrade :layer = "layer" :data = "id" v-bind:style="tmp[layer].componentStyles.upgrade" class = "treeThing"></upgrade> <div v-bind:is="type" :layer = "layer" :data = "id" v-bind:style="tmp[layer].componentStyles[type]" class = "treeThing"></div>
</span> </span>
<tr><table><button class="treeNode hidden"></button></table></tr> <tr><table><button class="treeNode hidden"></button></table></tr>
</span></div> </span></div>
` `
}) })
// Updates the value in player[layer][data] // Updates the value in player[layer][data]
Vue.component('text-input', { Vue.component('text-input', {
props: ['layer', 'data'], props: ['layer', 'data'],

View file

@ -4,7 +4,7 @@ var gameEnded = false;
// Don't change this // Don't change this
const TMT_VERSION = { const TMT_VERSION = {
tmtNum: "2.6.0.1", tmtNum: "2.6.1",
tmtName: "Fixed Reality" tmtName: "Fixed Reality"
} }