1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2025-02-16 09:41:41 +00:00

unl is now optional for Big Components, spacing isn't messed up by absent components

This commit is contained in:
Acamaeda 2020-10-10 21:52:27 -04:00
parent 8840d02a9b
commit 5770f03dd1
5 changed files with 28 additions and 10 deletions

View file

@ -3,6 +3,7 @@
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).
##v1.3.5
- Completely automated convertToDecimal, now you never have to worry about it again.

View file

@ -34,6 +34,8 @@ function updateLayers(){
if (!isNaN(thing)){
layers[layer].upgrades[thing].id = thing
layers[layer].upgrades[thing].layer = layer
if (layers[layer].upgrades[thing].unl === undefined)
layers[layer].upgrades[thing].unl = true
}
}
}
@ -42,6 +44,8 @@ function updateLayers(){
if (!isNaN(thing)){
layers[layer].milestones[thing].id = thing
layers[layer].milestones[thing].layer = layer
if (layers[layer].milestones[thing].unl === undefined)
layers[layer].milestones[thing].unl = true
}
}
}
@ -50,6 +54,8 @@ function updateLayers(){
if (!isNaN(thing)){
layers[layer].challs[thing].id = thing
layers[layer].challs[thing].layer = layer
if (layers[layer].challs[thing].unl === undefined)
layers[layer].challs[thing].unl = true
}
}
}
@ -59,7 +65,8 @@ function updateLayers(){
if (!isNaN(thing)){
layers[layer].buyables[thing].id = thing
layers[layer].buyables[thing].layer = layer
if (layers[layer].buyables[thing].unl === undefined)
layers[layer].buyables[thing].unl = true
}
}
}

View file

@ -59,8 +59,8 @@ addLayer("c", {
},
},
challs: {
rows: 1,
cols: 1,
rows: 2,
cols: 12,
11: {
name:() => "Fun",
desc:() => "Makes the game 0% harder",
@ -129,7 +129,7 @@ addLayer("c", {
},
buyables: {
rows: 1,
cols: 1,
cols: 12,
respec() { // Optional, reset things and give back your currency. Having this function makes a respec button appear
player[this.layer].points = player[this.layer].points.add(player[this.layer].spentOnBuyables) // A built-in thing to keep track of this but only keeps a single value
resetBuyables(this.layer)

View file

@ -76,4 +76,14 @@ function updateTempData(layerData, tmpData) {
tmpData[item] = layerData[item]()
}
}
}
function updateChallTemp(layer)
{
updateTempData(layers[layer].challs, tmp[layer].challs)
}
function updateBuyableTemp(layer)
{
updateTempData(layers[layer].buyables, tmp[layer].buyables)
}

12
js/v.js
View file

@ -92,7 +92,7 @@ function loadVue() {
<div v-if="layers[layer].challs" class="upgTable">
<div v-for="row in tmp[layer].challs.rows" class="upgRow">
<div v-for="col in tmp[layer].challs.cols">
<chall :layer = "layer" :data = "row*10+col" v-bind:style="tmp[layer].componentStyles.chall"></chall>
<chall v-if="layers[layer].challs[row*10+col]!== undefined && tmp[layer].challs[row*10+col].unl" :layer = "layer" :data = "row*10+col" v-bind:style="tmp[layer].componentStyles.chall"></chall>
</div>
</div>
</div>
@ -119,9 +119,9 @@ function loadVue() {
template: `
<div v-if="layers[layer].upgrades" class="upgTable">
<div v-for="row in layers[layer].upgrades.rows" class="upgRow">
<div v-for="col in layers[layer].upgrades.cols" class="upgAlign">
<div v-for="col in layers[layer].upgrades.cols"><div v-if="layers[layer].upgrades[row*10+col]!== undefined && tmp[layer].upgrades[row*10+col].unl" class="upgAlign">
<upgrade :layer = "layer" :data = "row*10+col" v-bind:style="tmp[layer].componentStyles.upgrade"></upgrade>
</div>
</div></div>
</div>
<br>
</div>
@ -201,13 +201,13 @@ function loadVue() {
<div v-if="layers[layer].buyables" class="upgTable">
<button v-if="tmp[layer].buyables.respec" v-on:click="respecBuyables(layer)" v-bind:class="{ longUpg: true, can: player[layer].unl, locked: !player[layer].unl }">{{tmp[layer].buyables.respecText ? tmp[layer].buyables.respecText : "Respec"}}</button><br>
<div v-for="row in tmp[layer].buyables.rows" class="upgRow">
<div v-for="col in tmp[layer].buyables.cols" class="upgAlign" v-bind:style="{'margin-left': '7px', 'margin-right': '7px', 'height': (data ? data : '200px'),}">
<div v-for="col in tmp[layer].buyables.cols"><div v-if="layers[layer].buyables[row*10+col]!== undefined && tmp[layer].buyables[row*10+col].unl" class="upgAlign" v-bind:style="{'margin-left': '7px', 'margin-right': '7px', 'height': (data ? data : '200px'),}">
<buyable :layer = "layer" :data = "row*10+col" :size = "data" v-bind:style="tmp[layer].componentStyles.buyable"></buyable>
</div>
</div></div>
<br>
</div>
</div>
`
`
})
// data = id of buyable