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

Fixed Decimals not being kept on reset

This commit is contained in:
Harley White 2021-01-17 15:15:52 -05:00
parent 4414580408
commit 4f99695b0a
4 changed files with 8 additions and 4 deletions

View file

@ -1,5 +1,8 @@
# The Modding Tree changelog: # The Modding Tree changelog:
## v2.3.6 -
- Fixed keeping Decimal values on reset.
## v2.3.5 - 12/21/20 ## v2.3.5 - 12/21/20
- Added resetTime, which tracks the time since a layer prestiged or was reset. - Added resetTime, which tracks the time since a layer prestiged or was reset.
- A layer node will be highlighted red if one of its subtabs is highlighted red. - A layer node will be highlighted red if one of its subtabs is highlighted red.
@ -8,7 +11,7 @@
- Other minor fixes. - Other minor fixes.
## v2.3.4 - 12/16/20 ## v2.3.4 - 12/16/20
- Added an node image feature. - Added a node image feature.
- Resource display now always shows the amount of the currency the layer's gain is based on. - Resource display now always shows the amount of the currency the layer's gain is based on.
- Added spacing between tree nodes. - Added spacing between tree nodes.
- Another attempt to fix tooltip flickering. - Another attempt to fix tooltip flickering.

View file

@ -200,7 +200,7 @@ addLayer("c", {
}, },
}, },
doReset(resettingLayer){ // Triggers when this layer is being reset, along with the layer doing the resetting. Not triggered by lower layers resetting, but is by layers on the same row. doReset(resettingLayer){ // Triggers when this layer is being reset, along with the layer doing the resetting. Not triggered by lower layers resetting, but is by layers on the same row.
if(layers[resettingLayer].row > this.row) layerDataReset(this.layer) // This is actually the default behavior if(layers[resettingLayer].row > this.row) layerDataReset(this.layer, ["points"]) // This is actually the default behavior
}, },
layerShown() {return true}, // Condition for when layer appears on the tree layerShown() {return true}, // Condition for when layer appears on the tree
automate() { automate() {

View file

@ -218,7 +218,7 @@ function loadVue() {
Vue.component('main-display', { Vue.component('main-display', {
props: ['layer'], props: ['layer'],
template: ` template: `
<div><span v-if="player[layer].points.lt('1e1000')">You have </span><h2 v-bind:style="{'color': tmp[layer].color, 'text-shadow': '0px 0px 10px' + tmp[layer].color}">{{formatWhole(player[layer].points)}}</h2> {{tmp[layer].resource}}<span v-if="tmp[layer].effectDescription">, <span v-html="tmp[layer].effectDescription"></span></span><br><br></div> <div><span v-if="player[layer].points.lt('1e1000')">You have </span><h2 v-bind:style="{'color': tmp[layer].color, 'text-shadow': '0px 0px 10px ' + tmp[layer].color}">{{formatWhole(player[layer].points)}}</h2> {{tmp[layer].resource}}<span v-if="tmp[layer].effectDescription">, <span v-html="tmp[layer].effectDescription"></span></span><br><br></div>
` `
}) })

View file

@ -663,7 +663,8 @@ function goBack() {
function layOver(obj1, obj2) { function layOver(obj1, obj2) {
for (let x in obj2) { for (let x in obj2) {
if (obj2[x] instanceof Object) layOver(obj1[x], obj2[x]); if (obj2[x] instanceof Decimal) obj1[x] = new Decimal(obj2[x])
else if (obj2[x] instanceof Object) layOver(obj1[x], obj2[x]);
else obj1[x] = obj2[x]; else obj1[x] = obj2[x];
} }
} }