From fba4bbf5e78516016f342923ce8e487d356b11d6 Mon Sep 17 00:00:00 2001 From: Harley White Date: Mon, 14 Jun 2021 01:37:12 -0400 Subject: [PATCH] Several minor fixes --- changelog.md | 4 ++++ css/misc.css | 5 +++-- docs/basic-layer-breakdown.md | 4 ++-- docs/tutorials/getting-started.md | 2 +- js/game.js | 6 +----- js/technical/temp.js | 7 ++++++- 6 files changed, 17 insertions(+), 11 deletions(-) diff --git a/changelog.md b/changelog.md index b40190d..734741b 100644 --- a/changelog.md +++ b/changelog.md @@ -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. diff --git a/css/misc.css b/css/misc.css index 0cb6234..83a1fce 100644 --- a/css/misc.css +++ b/css/misc.css @@ -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,7 +42,9 @@ border-radius: 3px; opacity: 0; transition: opacity 0.5s; - + transform: translateX(-50%); + min-width: max-content; + position: absolute; z-index: 20000 ; diff --git a/docs/basic-layer-breakdown.md b/docs/basic-layer-breakdown.md index 91228dc..b054aba 100644 --- a/docs/basic-layer-breakdown.md +++ b/docs/basic-layer-breakdown.md @@ -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) }, diff --git a/docs/tutorials/getting-started.md b/docs/tutorials/getting-started.md index 6684981..ed3bc48 100644 --- a/docs/tutorials/getting-started.md +++ b/docs/tutorials/getting-started.md @@ -43,6 +43,6 @@ The benefits of using Github: 7. Finally, at the top middle, click "push origin" to push your changes out onto the online repository. -8. You can view your project on line, or share it with others, by going to https://raw.githack.com/[YOUR-GITHUB-USERNAME]/The-Modding-Tree/master/index.html. **You do NOT need to do this to test your mod locally.** +8. You can view your project online, or share it with others, by going to https://raw.githack.com/[YOUR-GITHUB-USERNAME]/The-Modding-Tree/master/index.html. **You do NOT need to do this to test your mod locally.** And now, you have successfully used Github! You can look at the next tutorial on [making a mod](making-a-mod.md), or look at the [documentation](/documentation/!general-info.md) to see how The Modding Tree's system works and to make your mod a reality. diff --git a/js/game.js b/js/game.js index 5d87334..955a3dc 100644 --- a/js/game.js +++ b/js/game.js @@ -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 diff --git a/js/technical/temp.js b/js/technical/temp.js index b5cbce5..91ceeaf 100644 --- a/js/technical/temp.js +++ b/js/technical/temp.js @@ -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,7 +80,10 @@ function setupTempData(layerData, tmpData, funcsData) { } else if (isFunction(layerData[item]) && !activeFunctions.includes(item)){ funcsData[item] = layerData[item] - tmpData[item] = decimalOne // The safest thing to put probably? + if (boolNames.includes(item)) + tmpData[item] = false + else + tmpData[item] = decimalOne // The safest thing to put probably? } else { tmpData[item] = layerData[item] }