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

Several minor fixes

This commit is contained in:
Harley White 2021-06-14 01:37:12 -04:00
parent 723d78395b
commit fba4bbf5e7
6 changed files with 17 additions and 11 deletions

View file

@ -1,5 +1,9 @@
# The Modding Tree changelog:
- Fixed baseAmount being set to 0 even when a layer resets nothing.
- Fixed centering on tooltips.
- Changed some default values on startup to prevent potential issues.
# v2.6.3 - 6/11/21
- Added better support for using multiple layer files and similar. See modFiles in modInfo.
- The demo now has each layer in its own file as well.

View file

@ -35,7 +35,6 @@
bottom: 100%;
left: 50%;
margin-bottom: 5px;
margin-left: -80px;
padding: 7px;
font-family: "Lucida Console", "Courier New", monospace;
-webkit-border-radius: 3px;
@ -43,6 +42,8 @@
border-radius: 3px;
opacity: 0;
transition: opacity 0.5s;
transform: translateX(-50%);
min-width: max-content;
position: absolute;
z-index: 20000 ;

View file

@ -1,6 +1,6 @@
# Basic layer breakdown
This is a very minimal layer with minimal features. Most things will require additional features.
This is a relatively minimal layer with few features. Most things will require additional features.
```js
addLayer("p", {
@ -25,7 +25,7 @@ addLayer("p", {
gainMult() { // Returns your multiplier to your gain of the prestige resource.
return new Decimal(1) // Factor in any bonuses multiplying gain here.
},
gainExp() { // Returns your exponent to your gain of the prestige resource.
gainExp() { // Returns the exponent to your gain of the prestige resource.
return new Decimal(1)
},

View file

@ -180,8 +180,6 @@ function generatePoints(layer, diff) {
addPoints(layer, tmp[layer].resetGain.times(diff))
}
var prevOnReset
function doReset(layer, force=false) {
if (tmp[layer].type == "none") return
let row = tmp[layer].row
@ -214,24 +212,22 @@ function doReset(layer, force=false) {
}
}
tmp[layer].baseAmount = decimalZero // quick fix
}
if (run(layers[layer].resetsNothing, layers[layer])) return
tmp[layer].baseAmount = decimalZero // quick fix
for (layerResetting in layers) {
if (row >= layers[layerResetting].row && (!force || layerResetting != layer)) completeChallenge(layerResetting)
}
prevOnReset = {...player}
player.points = (row == 0 ? decimalZero : getStartPoints())
for (let x = row; x >= 0; x--) rowReset(x, layer)
for (r in OTHER_LAYERS){
rowReset(r, layer)
}
prevOnReset = undefined
player[layer].resetTime = 0

View file

@ -55,6 +55,8 @@ function setupTemp() {
temp = tmp
}
const boolNames = ["unlocked", "deactivated"]
function setupTempData(layerData, tmpData, funcsData) {
for (item in layerData){
if (layerData[item] == null) {
@ -78,6 +80,9 @@ function setupTempData(layerData, tmpData, funcsData) {
}
else if (isFunction(layerData[item]) && !activeFunctions.includes(item)){
funcsData[item] = layerData[item]
if (boolNames.includes(item))
tmpData[item] = false
else
tmpData[item] = decimalOne // The safest thing to put probably?
} else {
tmpData[item] = layerData[item]