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

Gagues are real

This commit is contained in:
Acamaeda 2020-10-08 23:13:15 -04:00
parent 3a76dae4ad
commit d4e38ba2f6
6 changed files with 80 additions and 2 deletions

View file

@ -1,6 +1,12 @@
#The Modding Tree changelog:
##v1.3.5
- Completely automated convertToDecimal, now you never have to worry about it again.
- Branches can be defined without a color id. But they can also use hex values for color ids!
- Created a tutorial for getting started with TMT and Github.
- Page title is now automatically taken from mod name.
##v1.3.4: 10/8/20
- Added "midsection" feature to add things to a tab's layout while still keeping the standard layout.
- Fix for being able to buy more buyables than you should.

View file

@ -85,4 +85,10 @@ function readData(data, args=null){
return data(args);
else
return data;
}
}
// This isn't worth making a .ts file over
const UP = 1
const DOWN = 2
const LEFT = 3
const RIGHT = 4

View file

@ -206,6 +206,29 @@ addLayer("c", {
}
},
gagues: {
longBoi: {
fillColor:() => "#4BEC13",
// fillStyle:(),
baseColor:() => "#333333",
// baseStyle:(),
// textStyle:(),
borderStyle() {return {'border-color': '#321188'}},
direction:() => RIGHT,
width:() => "250px",
height:() => "250px",
progress() {
return (player.points.log().div(10))
},
display() {
return format(player.points) + " / 1e10"
},
unl:() => true,
},
},
// Optional, lets you format the tab yourself by listing components. You can create your own components in v.js.
tabFormat: {
"main tab": {

View file

@ -30,6 +30,8 @@ function setupTemp(){
}
function updateTemp() {
for (layer in layers) tmp[layer] = {}
if (tmp.genPoints == undefined) tmp.genPoints = false
@ -143,6 +145,13 @@ function updateTemp() {
updateBuyableTemp(layer)
}
}
for (layer in layers) {
if(layers[layer].gagues !== undefined){
tmp[layer].gagues = {}
updateGagueTemp(layer)
}
}
}
@ -309,4 +318,21 @@ function setupBuyableTemp(layer) {
}
}
}
// The start of not being backwards with tmp
function updateGagueTemp(layer) {
if (layers[layer] === undefined) return
let gagues = layers[layer].gagues
for (id in gagues) {
tmp[layer].gagues[id] = {}
for (item in gagues[id]) {
let thing = gagues[id][item]
if (isFunction(thing))
tmp[layer].gagues[id] = thing()
else
tmp[layer].gagues[id] = thing
}
}
}

View file

@ -413,4 +413,9 @@ document.onkeydown = function(e) {
var onFocused = false
function focused(x) {
onFocused = x
}
}
function isFunction(obj) {
return !!(obj && obj.constructor && obj.call && obj.apply);
};

12
js/v.js
View file

@ -245,6 +245,18 @@ function loadVue() {
`
})
// data = id of gague
Vue.component('gague', {
props: ['layer', 'data'],
template: `
<div v-if="layers[layer].gagues && tmp.gagues[layer][data].unl"
v-bind:style="{'border-style': 'solid}"
</div>
`
})
// NOT FOR USE IN STANDARD TAB FORMATTING
Vue.component('tab-buttons', {