From d4e38ba2f6a03ab3d82319cc7826ace95921c937 Mon Sep 17 00:00:00 2001 From: Acamaeda Date: Thu, 8 Oct 2020 23:13:15 -0400 Subject: [PATCH] Gagues are real --- changelog.md | 6 ++++++ js/layerSupport.js | 8 +++++++- js/layers.js | 23 +++++++++++++++++++++++ js/temp.js | 26 ++++++++++++++++++++++++++ js/utils.js | 7 ++++++- js/v.js | 12 ++++++++++++ 6 files changed, 80 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index e0891f3..3399259 100644 --- a/changelog.md +++ b/changelog.md @@ -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. diff --git a/js/layerSupport.js b/js/layerSupport.js index c41ccd7..b5badc2 100644 --- a/js/layerSupport.js +++ b/js/layerSupport.js @@ -85,4 +85,10 @@ function readData(data, args=null){ return data(args); else return data; -} \ No newline at end of file +} + +// This isn't worth making a .ts file over +const UP = 1 +const DOWN = 2 +const LEFT = 3 +const RIGHT = 4 \ No newline at end of file diff --git a/js/layers.js b/js/layers.js index 52be58a..09ee265 100644 --- a/js/layers.js +++ b/js/layers.js @@ -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": { diff --git a/js/temp.js b/js/temp.js index 83596e0..efaebd6 100644 --- a/js/temp.js +++ b/js/temp.js @@ -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 + } + } } \ No newline at end of file diff --git a/js/utils.js b/js/utils.js index 73c460b..71e3a76 100644 --- a/js/utils.js +++ b/js/utils.js @@ -413,4 +413,9 @@ document.onkeydown = function(e) { var onFocused = false function focused(x) { onFocused = x -} \ No newline at end of file +} + +function isFunction(obj) { + return !!(obj && obj.constructor && obj.call && obj.apply); + }; + \ No newline at end of file diff --git a/js/v.js b/js/v.js index caf155f..15b3b24 100644 --- a/js/v.js +++ b/js/v.js @@ -245,6 +245,18 @@ function loadVue() { ` }) + // data = id of gague + Vue.component('gague', { + props: ['layer', 'data'], + template: ` +
+ ` + }) + + // NOT FOR USE IN STANDARD TAB FORMATTING Vue.component('tab-buttons', {