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

Fixed issues with challenges

This commit is contained in:
Acamaeda 2020-10-29 20:33:39 -04:00
parent 7c895952bf
commit ca76d130fd
6 changed files with 17 additions and 11 deletions

View file

@ -5,6 +5,7 @@
- Added shouldNotify to subtab/microtab buttons. (You can make them highlighted)
- Added commas to large exponents.
- NaN is now handled more intelligently.
- The "hide completed challenges" setting now only hides challenges at max completions.
- Thank you to thepaperpilot for fixing errors in docs and the infobox appearance!
### v2.1.4 - 10/25/20

View file

@ -154,7 +154,7 @@
<span v-if="canGenPoints()" class="overlayThing">({{format(getPointGen())}}/sec)</span>
<div v-for="thing in tmp.displayThings" class="overlayThing"><span v-if="thing" v-html="thing"></span></div>
</div>
<tree :data="(treeLayout ? treeLayout : TREE_LAYERS)"></tree>
<tree :data="(layoutInfo.treeLayout ? layoutInfo.treeLayout : TREE_LAYERS)"></tree>
</div>
<div v-for="layer in LAYERS" >
<div v-if="player.navTab == 'none'" id="fakeHead" style="visibility: hidden;">

View file

@ -8,14 +8,12 @@ let modInfo = {
initialStartPoints: new Decimal (10), // Used for hard resets and new players
offlineLimit: 1, // In hours
startTab: "none",
startNavTab: "tree",
}
// Set your version in num and name
let VERSION = {
num: "2.1.3.1",
name: " We should have thought of this sooner!",
num: "2.2",
name: "Uprooted",
}
// If you add new functions anywhere inside of a layer, and those functions have an effect when called, add them here.

View file

@ -1,9 +1,12 @@
// treeLayout will override the default tree's layout if used
var treeLayout = "";
/*var treeLayout = [["f", "c"],
["g", "spook", "h"]]
*/
var layoutInfo = {
startTab: "none",
showTree: true,
treeLayout: ""
}
// A "ghost" layer which offsets f in the tree
addNode("spook", {

View file

@ -453,6 +453,10 @@ function hasChallenge(layer, id){
return (player[layer].challenges[id])
}
function maxedChallenge(layer, id){
return (player[layer].challenges[id] >= tmp[layer].challenges[id].completionLimit)
}
function challengeCompletions(layer, id){
return (player[layer].challenges[id])
}
@ -585,7 +589,7 @@ function inChallenge(layer, id){
if (challenge==id) return true
if (layers[layer].challenges[challenge].countsAs)
return tmp[layer].challenges[id].countsAs.includes(id)
return tmp[layer].challenges[challenge].countsAs.includes(id)
}
// ************ Misc ************

View file

@ -119,7 +119,7 @@ function loadVue() {
Vue.component('challenge', {
props: ['layer', 'data'],
template: `
<div v-if="tmp[layer].challenges && tmp[layer].challenges[data]!== undefined && tmp[layer].challenges[data].unlocked && !(player.hideChallenges && hasChallenge(layer, [data]))" v-bind:class="{hChallenge: true, done: hasChallenge(layer, data), canComplete: player[layer].activeChallenge == data&&!hasChallenge(layer, data)&&canCompleteChallenge(layer, data)}">
<div v-if="tmp[layer].challenges && tmp[layer].challenges[data]!== undefined && tmp[layer].challenges[data].unlocked && !(player.hideChallenges && maxedChallenge(layer, [data]))" v-bind:class="{hChallenge: true, done: hasChallenge(layer, data), canComplete: player[layer].activeChallenge == data&&!hasChallenge(layer, data)&&canCompleteChallenge(layer, data)}">
<br><h3 v-html="tmp[layer].challenges[data].name"></h3><br><br>
<button v-bind:class="{ longUpg: true, can: true, [layer]: true }" v-bind:style="{'background-color': tmp[layer].color}" v-on:click="startChallenge(layer, data)">{{player[layer].activeChallenge==(data)?(canCompleteChallenge(layer, data)?"Finish":"Exit Early"):(hasChallenge(layer, data)?"Completed":"Start")}}</button><br><br>
<span v-html="tmp[layer].challenges[data].challengeDescription"></span><br>