mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2024-11-21 16:13:55 +00:00
Optimized more things out of temp
This commit is contained in:
parent
faebc2f075
commit
a8a5a2f46a
6 changed files with 70 additions and 71 deletions
|
@ -406,7 +406,7 @@ addLayer("f", {
|
||||||
// The following are only currently used for "custom" Prestige type:
|
// The following are only currently used for "custom" Prestige type:
|
||||||
prestigeButtonText() { //Is secretly HTML
|
prestigeButtonText() { //Is secretly HTML
|
||||||
if (!this.canBuyMax()) return "Hi! I'm a <u>weird dinosaur</u> and I'll give you a Farm Point in exchange for all of your points and lollipops! (At least " + formatWhole(tmp[this.layer].nextAt) + " points)"
|
if (!this.canBuyMax()) return "Hi! I'm a <u>weird dinosaur</u> and I'll give you a Farm Point in exchange for all of your points and lollipops! (At least " + formatWhole(tmp[this.layer].nextAt) + " points)"
|
||||||
if (this.canBuyMax()) return "Hi! I'm a <u>weird dinosaur</u> and I'll give you <b>" + formatWhole(tmp[this.layer].resetGain) + "</b> Farm Points in exchange for all of your points and lollipops! (You'll get another one at " + formatWhole(tmp[layer].nextAtDisp) + " points)"
|
if (this.canBuyMax()) return "Hi! I'm a <u>weird dinosaur</u> and I'll give you <b>" + formatWhole(tmp[this.layer].resetGain) + "</b> Farm Points in exchange for all of your points and lollipops! (You'll get another one at " + formatWhole(tmp[this.layer].nextAtDisp) + " points)"
|
||||||
},
|
},
|
||||||
getResetGain() {
|
getResetGain() {
|
||||||
return getResetGain(this.layer, useType = "static")
|
return getResetGain(this.layer, useType = "static")
|
||||||
|
|
|
@ -125,15 +125,16 @@ function loadVue() {
|
||||||
Vue.component('challenge', {
|
Vue.component('challenge', {
|
||||||
props: ['layer', 'data'],
|
props: ['layer', 'data'],
|
||||||
template: `
|
template: `
|
||||||
<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: tmp[layer].challenges[data].defaultStyle === 'done', canComplete:tmp[layer].challenges[data].defaultStyle === 'canComplete', locked: tmp[layer].challenges[data].defaultStyle === 'locked'}" v-bind:style="tmp[layer].challenges[data].style">
|
<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', challengeStyle(layer, data)]" v-bind:style="tmp[layer].challenges[data].style">
|
||||||
<br><h3 v-html="tmp[layer].challenges[data].name"></h3><br><br>
|
<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)">{{tmp[layer].challenges[data].buttonText}}</button><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)">{{challengeButtonText(layer, data)}}</button><br><br>
|
||||||
<span v-if="tmp[layer].challenges[data].fullDisplay" v-html="tmp[layer].challenges[data].fullDisplay"></span>
|
<span v-if="layers[layer].challenges[data].fullDisplay" v-html="run(layers[layer].challenges[data].fullDisplay, layers[layer].challenges[data])"></span>
|
||||||
<span v-else>
|
<span v-else>
|
||||||
<span v-html="tmp[layer].challenges[data].challengeDescription"></span><br>
|
<span v-html="tmp[layer].challenges[data].challengeDescription"></span><br>
|
||||||
Goal: <span v-if="tmp[layer].challenges[data].goalDescription" v-html="tmp[layer].challenges[data].goalDescription"></span><span v-else>{{format(tmp[layer].challenges[data].goal)}} {{tmp[layer].challenges[data].currencyDisplayName ? tmp[layer].challenges[data].currencyDisplayName : "points"}}</span><br>
|
Goal: <span v-if="tmp[layer].challenges[data].goalDescription" v-html="tmp[layer].challenges[data].goalDescription"></span><span v-else>{{format(tmp[layer].challenges[data].goal)}} {{tmp[layer].challenges[data].currencyDisplayName ? tmp[layer].challenges[data].currencyDisplayName : "points"}}</span><br>
|
||||||
Reward: <span v-html="tmp[layer].challenges[data].rewardDescription"></span><br>
|
Reward: <span v-html="tmp[layer].challenges[data].rewardDescription"></span><br>
|
||||||
<span v-if="tmp[layer].challenges[data].rewardDisplay!==undefined">Currently: <span v-html="(tmp[layer].challenges[data].rewardDisplay) ? (tmp[layer].challenges[data].rewardDisplay) : format(tmp[layer].challenges[data].rewardEffect)"></span></span>
|
<span v-if="layers[layer].challenges[data].rewardDisplay!==undefined">Currently: <span v-html="(tmp[layer].challenges[data].rewardDisplay) ? (run(layers[layer].challenges[data].rewardDisplay, layers[layer].challenges[data])) : format(tmp[layer].challenges[data].rewardEffect)"></span></span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
|
@ -159,11 +160,11 @@ function loadVue() {
|
||||||
template: `
|
template: `
|
||||||
<button v-if="tmp[layer].upgrades && tmp[layer].upgrades[data]!== undefined && tmp[layer].upgrades[data].unlocked" v-on:click="buyUpg(layer, data)" v-bind:class="{ [layer]: true, upg: true, bought: hasUpgrade(layer, data), locked: (!(canAffordUpgrade(layer, data))&&!hasUpgrade(layer, data)), can: (canAffordUpgrade(layer, data)&&!hasUpgrade(layer, data))}"
|
<button v-if="tmp[layer].upgrades && tmp[layer].upgrades[data]!== undefined && tmp[layer].upgrades[data].unlocked" v-on:click="buyUpg(layer, data)" v-bind:class="{ [layer]: true, upg: true, bought: hasUpgrade(layer, data), locked: (!(canAffordUpgrade(layer, data))&&!hasUpgrade(layer, data)), can: (canAffordUpgrade(layer, data)&&!hasUpgrade(layer, data))}"
|
||||||
v-bind:style="[((!hasUpgrade(layer, data) && canAffordUpgrade(layer, data)) ? {'background-color': tmp[layer].color} : {}), tmp[layer].upgrades[data].style]">
|
v-bind:style="[((!hasUpgrade(layer, data) && canAffordUpgrade(layer, data)) ? {'background-color': tmp[layer].color} : {}), tmp[layer].upgrades[data].style]">
|
||||||
<span v-if="tmp[layer].upgrades[data].fullDisplay" v-html="tmp[layer].upgrades[data].fullDisplay"></span>
|
<span v-if="layers[layer].upgrades[data].fullDisplay" v-html="run(layers[layer].upgrades[data].fullDisplay, layers[layer].upgrades[data])"></span>
|
||||||
<span v-else>
|
<span v-else>
|
||||||
<span v-if= "tmp[layer].upgrades[data].title"><h3 v-html="tmp[layer].upgrades[data].title"></h3><br></span>
|
<span v-if= "tmp[layer].upgrades[data].title"><h3 v-html="tmp[layer].upgrades[data].title"></h3><br></span>
|
||||||
<span v-html="tmp[layer].upgrades[data].description"></span>
|
<span v-html="tmp[layer].upgrades[data].description"></span>
|
||||||
<span v-if="tmp[layer].upgrades[data].effectDisplay"><br>Currently: <span v-html="tmp[layer].upgrades[data].effectDisplay"></span></span>
|
<span v-if="layers[layer].upgrades[data].effectDisplay"><br>Currently: <span v-html="run(layers[layer].upgrades[data].effectDisplay, layers[layer].upgrades[data])"></span></span>
|
||||||
<br><br>Cost: {{ formatWhole(tmp[layer].upgrades[data].cost) }} {{(tmp[layer].upgrades[data].currencyDisplayName ? tmp[layer].upgrades[data].currencyDisplayName : tmp[layer].resource)}}
|
<br><br>Cost: {{ formatWhole(tmp[layer].upgrades[data].cost) }} {{(tmp[layer].upgrades[data].currencyDisplayName ? tmp[layer].upgrades[data].currencyDisplayName : tmp[layer].resource)}}
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
|
@ -190,7 +191,7 @@ function loadVue() {
|
||||||
template: `
|
template: `
|
||||||
<td v-if="tmp[layer].milestones && tmp[layer].milestones[data]!== undefined && milestoneShown(layer, data)" v-bind:style="[(!tmp[layer].milestones[data].unlocked) ? {'visibility': 'hidden'} : {}, tmp[layer].milestones[data].style]" v-bind:class="{milestone: !hasMilestone(layer, data), milestoneDone: hasMilestone(layer, data)}">
|
<td v-if="tmp[layer].milestones && tmp[layer].milestones[data]!== undefined && milestoneShown(layer, data)" v-bind:style="[(!tmp[layer].milestones[data].unlocked) ? {'visibility': 'hidden'} : {}, tmp[layer].milestones[data].style]" v-bind:class="{milestone: !hasMilestone(layer, data), milestoneDone: hasMilestone(layer, data)}">
|
||||||
<h3 v-html="tmp[layer].milestones[data].requirementDescription"></h3><br>
|
<h3 v-html="tmp[layer].milestones[data].requirementDescription"></h3><br>
|
||||||
<span v-html="tmp[layer].milestones[data].effectDescription"></span><br>
|
<span v-html="run(layers[layer].milestones[data].effectDescription, layers[layer].milestones[data])"></span><br>
|
||||||
<span v-if="(tmp[layer].milestones[data].toggles)&&(hasMilestone(layer, data))" v-for="toggle in tmp[layer].milestones[data].toggles"><toggle :layer= "layer" :data= "toggle" v-bind:style="tmp[layer].componentStyles.toggle"></toggle> </span></td></tr>
|
<span v-if="(tmp[layer].milestones[data].toggles)&&(hasMilestone(layer, data))" v-for="toggle in tmp[layer].milestones[data].toggles"><toggle :layer= "layer" :data= "toggle" v-bind:style="tmp[layer].componentStyles.toggle"></toggle> </span></td></tr>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
|
@ -218,7 +219,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="layers[layer].effectDescription">, <span v-html="run(layers[layer].effectDescription, layers[layer])"></span></span><br><br></div>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -261,7 +262,7 @@ function loadVue() {
|
||||||
v-bind:style="[tmp[layer].buyables[data].canBuy ? {'background-color': tmp[layer].color} : {}, size ? {'height': size, 'width': size} : {}, tmp[layer].componentStyles.buyable, tmp[layer].buyables[data].style]"
|
v-bind:style="[tmp[layer].buyables[data].canBuy ? {'background-color': tmp[layer].color} : {}, size ? {'height': size, 'width': size} : {}, tmp[layer].componentStyles.buyable, tmp[layer].buyables[data].style]"
|
||||||
v-on:click="buyBuyable(layer, data)">
|
v-on:click="buyBuyable(layer, data)">
|
||||||
<span v-if= "tmp[layer].buyables[data].title"><h2 v-html="tmp[layer].buyables[data].title"></h2><br></span>
|
<span v-if= "tmp[layer].buyables[data].title"><h2 v-html="tmp[layer].buyables[data].title"></h2><br></span>
|
||||||
<span v-bind:style="{'white-space': 'pre-line'}" v-html="tmp[layer].buyables[data].display"></span>
|
<span v-bind:style="{'white-space': 'pre-line'}" v-html="run(layers[layer].buyables[data].display, layers[layer].buyables[data])"></span>
|
||||||
</button>
|
</button>
|
||||||
<br v-if="(tmp[layer].buyables[data].sellOne !== undefined && !(tmp[layer].buyables[data].canSellOne !== undefined && tmp[layer].buyables[data].canSellOne == false)) || (tmp[layer].buyables[data].sellAll && !(tmp[layer].buyables[data].canSellAll !== undefined && tmp[layer].buyables[data].canSellAll == false))">
|
<br v-if="(tmp[layer].buyables[data].sellOne !== undefined && !(tmp[layer].buyables[data].canSellOne !== undefined && tmp[layer].buyables[data].canSellOne == false)) || (tmp[layer].buyables[data].sellAll && !(tmp[layer].buyables[data].canSellAll !== undefined && tmp[layer].buyables[data].canSellAll == false))">
|
||||||
<sell-one :layer="layer" :data="data" v-bind:style="tmp[layer].componentStyles['sell-one']" v-if="(tmp[layer].buyables[data].sellOne)&& !(tmp[layer].buyables[data].canSellOne !== undefined && tmp[layer].buyables[data].canSellOne == false)"></sell-one>
|
<sell-one :layer="layer" :data="data" v-bind:style="tmp[layer].componentStyles['sell-one']" v-if="(tmp[layer].buyables[data].sellOne)&& !(tmp[layer].buyables[data].canSellOne !== undefined && tmp[layer].buyables[data].canSellOne == false)"></sell-one>
|
||||||
|
@ -306,7 +307,7 @@ function loadVue() {
|
||||||
v-bind:style="[tmp[layer].clickables[data].canClick ? {'background-color': tmp[layer].color} : {}, size ? {'height': size, 'width': size} : {}, tmp[layer].clickables[data].style]"
|
v-bind:style="[tmp[layer].clickables[data].canClick ? {'background-color': tmp[layer].color} : {}, size ? {'height': size, 'width': size} : {}, tmp[layer].clickables[data].style]"
|
||||||
v-on:click="clickClickable(layer, data)">
|
v-on:click="clickClickable(layer, data)">
|
||||||
<span v-if= "tmp[layer].clickables[data].title"><h2 v-html="tmp[layer].clickables[data].title"></h2><br></span>
|
<span v-if= "tmp[layer].clickables[data].title"><h2 v-html="tmp[layer].clickables[data].title"></h2><br></span>
|
||||||
<span v-bind:style="{'white-space': 'pre-line'}" v-html="tmp[layer].clickables[data].display"></span>
|
<span v-bind:style="{'white-space': 'pre-line'}" v-html="run(layers[layer].clickables[data].display, layers[layer].clickables[data])"></span>
|
||||||
</button>
|
</button>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
|
@ -341,10 +342,13 @@ function loadVue() {
|
||||||
// data = id of the bar
|
// data = id of the bar
|
||||||
Vue.component('bar', {
|
Vue.component('bar', {
|
||||||
props: ['layer', 'data'],
|
props: ['layer', 'data'],
|
||||||
|
computed: {
|
||||||
|
style() {return constructBarStyle(layer, data)}
|
||||||
|
},
|
||||||
template: `
|
template: `
|
||||||
<div v-if="tmp[layer].bars && tmp[layer].bars[data].unlocked" v-bind:style="{'position': 'relative'}"><div v-bind:style="[tmp[layer].bars[data].style, tmp[layer].bars[data].dims, {'display': 'table'}]">
|
<div v-if="tmp[layer].bars && tmp[layer].bars[data].unlocked" v-bind:style="{'position': 'relative'}"><div v-bind:style="[tmp[layer].bars[data].style, tmp[layer].bars[data].dims, {'display': 'table'}]">
|
||||||
<div class = "overlayTextContainer barBorder" v-bind:style="[tmp[layer].bars[data].borderStyle, tmp[layer].bars[data].dims]">
|
<div class = "overlayTextContainer barBorder" v-bind:style="[tmp[layer].bars[data].borderStyle, tmp[layer].bars[data].dims]">
|
||||||
<span class = "overlayText" v-bind:style="[tmp[layer].bars[data].style, tmp[layer].bars[data].textStyle]" v-html="tmp[layer].bars[data].display"></span>
|
<span class = "overlayText" v-bind:style="[tmp[layer].bars[data].style, tmp[layer].bars[data].textStyle]" v-html="run(layers[layer].bars[data].display, layers[layer].bars[data])"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class ="barBG barBorder" v-bind:style="[tmp[layer].bars[data].style, tmp[layer].bars[data].baseStyle, tmp[layer].bars[data].borderStyle, tmp[layer].bars[data].dims]">
|
<div class ="barBG barBorder" v-bind:style="[tmp[layer].bars[data].style, tmp[layer].bars[data].baseStyle, tmp[layer].bars[data].borderStyle, tmp[layer].bars[data].dims]">
|
||||||
<div class ="fill" v-bind:style="[tmp[layer].bars[data].style, tmp[layer].bars[data].fillStyle, tmp[layer].bars[data].fillDims]"></div>
|
<div class ="fill" v-bind:style="[tmp[layer].bars[data].style, tmp[layer].bars[data].fillStyle, tmp[layer].bars[data].fillDims]"></div>
|
||||||
|
@ -373,7 +377,7 @@ function loadVue() {
|
||||||
props: ['layer', 'data'],
|
props: ['layer', 'data'],
|
||||||
template: `
|
template: `
|
||||||
<div v-if="tmp[layer].achievements && tmp[layer].achievements[data]!== undefined && tmp[layer].achievements[data].unlocked" v-bind:class="{ [layer]: true, achievement: true, tooltipBox:true, locked: !hasAchievement(layer, data), bought: hasAchievement(layer, data)}"
|
<div v-if="tmp[layer].achievements && tmp[layer].achievements[data]!== undefined && tmp[layer].achievements[data].unlocked" v-bind:class="{ [layer]: true, achievement: true, tooltipBox:true, locked: !hasAchievement(layer, data), bought: hasAchievement(layer, data)}"
|
||||||
v-bind:style="tmp[layer].achievements[data].computedStyle">
|
v-bind:style="achievementStyle(layer, data)">
|
||||||
<tooltip :text="
|
<tooltip :text="
|
||||||
(tmp[layer].achievements[data].tooltip == '') ? false : hasAchievement(layer, data) ? (tmp[layer].achievements[data].doneTooltip ? tmp[layer].achievements[data].doneTooltip : (tmp[layer].achievements[data].tooltip ? tmp[layer].achievements[data].tooltip : 'You did it!'))
|
(tmp[layer].achievements[data].tooltip == '') ? false : hasAchievement(layer, data) ? (tmp[layer].achievements[data].doneTooltip ? tmp[layer].achievements[data].doneTooltip : (tmp[layer].achievements[data].tooltip ? tmp[layer].achievements[data].tooltip : 'You did it!'))
|
||||||
: (tmp[layer].achievements[data].goalTooltip ? tmp[layer].achievements[data].goalTooltip : (tmp[layer].achievements[data].tooltip ? tmp[layer].achievements[data].tooltip : 'LOCKED'))
|
: (tmp[layer].achievements[data].goalTooltip ? tmp[layer].achievements[data].goalTooltip : (tmp[layer].achievements[data].tooltip ? tmp[layer].achievements[data].tooltip : 'LOCKED'))
|
||||||
|
@ -473,6 +477,8 @@ function loadVue() {
|
||||||
canCompleteChallenge,
|
canCompleteChallenge,
|
||||||
subtabShouldNotify,
|
subtabShouldNotify,
|
||||||
subtabResetNotify,
|
subtabResetNotify,
|
||||||
|
challengeStyle,
|
||||||
|
challengeButtonText,
|
||||||
VERSION,
|
VERSION,
|
||||||
LAYERS,
|
LAYERS,
|
||||||
hotkeys,
|
hotkeys,
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
function prestigeButtonText(layer) {
|
||||||
|
if (layers[layer].prestigeButtonText !== undefined)
|
||||||
|
return run(layers[layer].prestigeButtonText(), layers[layer])
|
||||||
|
if (tmp[layer].type == "normal")
|
||||||
|
return `${player[layer].points.lt(1e3) ? (tmp[layer].resetDescription !== undefined ? tmp[layer].resetDescription : "Reset for ") : ""}+<b>${formatWhole(tmp[layer].resetGain)}</b> ${tmp[layer].resource} ${tmp[layer].resetGain.lt(100) && player[layer].points.lt(1e3) ? `<br><br>Next at ${(tmp[layer].roundUpCost ? formatWhole(tmp[layer].nextAt) : format(tmp[layer].nextAt))} ${tmp[layer].baseResource}` : ""}`
|
||||||
|
if (tmp[layer].type == "static")
|
||||||
|
return `${tmp[layer].resetDescription !== undefined ? tmp[layer].resetDescription : "Reset for "}+<b>${formatWhole(tmp[layer].resetGain)}</b> ${tmp[layer].resource}<br><br>${player[layer].points.lt(30) ? (tmp[layer].baseAmount.gte(tmp[layer].nextAt) && (tmp[layer].canBuyMax !== undefined) && tmp[layer].canBuyMax ? "Next:" : "Req:") : ""} ${formatWhole(tmp[layer].baseAmount)} / ${(tmp[layer].roundUpCost ? formatWhole(tmp[layer].nextAtDisp) : format(tmp[layer].nextAtDisp))} ${tmp[layer].baseResource}
|
||||||
|
`
|
||||||
|
if (tmp[layer].type == "none")
|
||||||
|
return ""
|
||||||
|
|
||||||
|
return "You need prestige button text"
|
||||||
|
}
|
||||||
|
|
||||||
|
function constructNodeStyle(layer){
|
||||||
|
let style = []
|
||||||
|
if ((tmp[layer].isLayer && layerunlocked(layer)) || (!tmp[layer].isLayer && tmp[layer].canClick))
|
||||||
|
style.push({'background-color': tmp[layer].color})
|
||||||
|
if (tmp[layer].image !== undefined)
|
||||||
|
style.push({'background-image': 'url("' + tmp[layer].image + '")'})
|
||||||
|
style.push(tmp[layer].nodeStyle)
|
||||||
|
return style
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function challengeStyle(layer, id) {
|
||||||
|
if (player[layer].activeChallenge == id && canCompleteChallenge(layer, id)) return "canComplete"
|
||||||
|
else if (hasChallenge(layer, id)) return "done"
|
||||||
|
return "locked"
|
||||||
|
}
|
||||||
|
|
||||||
|
function challengeButtonText(layer, id) {
|
||||||
|
return (player[layer].activeChallenge==(id)?(canCompleteChallenge(layer, id)?"Finish":"Exit Early"):(hasChallenge(layer, id)?"Completed":"Start"))
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function achievementStyle(layer, id){
|
||||||
|
ach = tmp[layer].achievements[id]
|
||||||
|
let style = []
|
||||||
|
if (ach.image){
|
||||||
|
style.push({'background-image': 'url("' + ach.image + '")'})
|
||||||
|
}
|
||||||
|
if (!ach.unlocked) style.push({'visibility': 'hidden'})
|
||||||
|
style.push(ach.style)
|
||||||
|
return style
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ var systemComponents = {
|
||||||
resetNotify: tmp[layer].prestigeNotify,
|
resetNotify: tmp[layer].prestigeNotify,
|
||||||
can: ((player[layer].unlocked || tmp[layer].isLayer) && tmp[layer].isLayer) || (!tmp[layer].isLayer && tmp[layer].canClick),
|
can: ((player[layer].unlocked || tmp[layer].isLayer) && tmp[layer].isLayer) || (!tmp[layer].isLayer && tmp[layer].canClick),
|
||||||
}"
|
}"
|
||||||
v-bind:style="tmp[layer].computedNodeStyle">
|
v-bind:style="constructNodeStyle(layer)">
|
||||||
<span v-html="(abb !== '' && tmp[layer].image === undefined) ? abb : ' '"></span>
|
<span v-html="(abb !== '' && tmp[layer].image === undefined) ? abb : ' '"></span>
|
||||||
<tooltip
|
<tooltip
|
||||||
v-if="tmp[layer].tooltip != ''"
|
v-if="tmp[layer].tooltip != ''"
|
||||||
|
|
|
@ -8,6 +8,7 @@ var activeFunctions = [
|
||||||
"startData", "onPrestige", "doReset", "update", "automate",
|
"startData", "onPrestige", "doReset", "update", "automate",
|
||||||
"buy", "buyMax", "respec", "onComplete", "onPurchase", "onPress", "onClick", "masterButtonPress",
|
"buy", "buyMax", "respec", "onComplete", "onPurchase", "onPress", "onClick", "masterButtonPress",
|
||||||
"sellOne", "sellAll", "pay", "actualCostFunction", "actualEffectFunction",
|
"sellOne", "sellAll", "pay", "actualCostFunction", "actualEffectFunction",
|
||||||
|
"effectDescription", "display", "fullDisplay", "effectDisplay", "rewardDisplay",
|
||||||
]
|
]
|
||||||
|
|
||||||
var noCall = doNotCallTheseFunctionsEveryTick
|
var noCall = doNotCallTheseFunctionsEveryTick
|
||||||
|
@ -84,10 +85,6 @@ function updateTemp() {
|
||||||
tmp[layer].notify = shouldNotify(layer)
|
tmp[layer].notify = shouldNotify(layer)
|
||||||
tmp[layer].prestigeNotify = prestigeNotify(layer)
|
tmp[layer].prestigeNotify = prestigeNotify(layer)
|
||||||
constructBarStyles(layer)
|
constructBarStyles(layer)
|
||||||
constructAchievementStyles(layer)
|
|
||||||
constructNodeStyle(layer)
|
|
||||||
updateChallengeDisplay(layer)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp.pointGen = getPointGen()
|
tmp.pointGen = getPointGen()
|
||||||
|
@ -124,7 +121,7 @@ function updateTempData(layerData, tmpData, funcsData) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Vue.set(tmpData, item, value)
|
tmpData[item]=value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -132,20 +129,8 @@ function updateTempData(layerData, tmpData, funcsData) {
|
||||||
function updateChallengeTemp(layer)
|
function updateChallengeTemp(layer)
|
||||||
{
|
{
|
||||||
updateTempData(layers[layer].challenges, tmp[layer].challenges, funcs[layer].challenges)
|
updateTempData(layers[layer].challenges, tmp[layer].challenges, funcs[layer].challenges)
|
||||||
updateChallengeDisplay(layer)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateChallengeDisplay(layer) {
|
|
||||||
for (id in player[layer].challenges) {
|
|
||||||
let style = "locked"
|
|
||||||
if (player[layer].activeChallenge == id && canCompleteChallenge(layer, id)) style = "canComplete"
|
|
||||||
else if (hasChallenge(layer, id)) style = "done"
|
|
||||||
tmp[layer].challenges[id].defaultStyle = style
|
|
||||||
|
|
||||||
tmp[layer].challenges[id].buttonText = (player[layer].activeChallenge==(id)?(canCompleteChallenge(layer, id)?"Finish":"Exit Early"):(hasChallenge(layer, id)?"Completed":"Start"))
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateBuyableTemp(layer)
|
function updateBuyableTemp(layer)
|
||||||
{
|
{
|
||||||
|
@ -157,33 +142,6 @@ function updateClickableTemp(layer)
|
||||||
updateTempData(layers[layer].clickables, tmp[layer].clickables, funcs[layer].clickables)
|
updateTempData(layers[layer].clickables, tmp[layer].clickables, funcs[layer].clickables)
|
||||||
}
|
}
|
||||||
|
|
||||||
function constructNodeStyle(layer){
|
|
||||||
let style = []
|
|
||||||
if ((tmp[layer].isLayer && layerunlocked(layer)) || (!tmp[layer].isLayer && tmp[layer].canClick))
|
|
||||||
style.push({'background-color': tmp[layer].color})
|
|
||||||
if (tmp[layer].image !== undefined)
|
|
||||||
style.push({'background-image': 'url("' + tmp[layer].image + '")'})
|
|
||||||
style.push(tmp[layer].nodeStyle)
|
|
||||||
Vue.set(tmp[layer], 'computedNodeStyle', style)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function constructAchievementStyles(layer){
|
|
||||||
for (id in tmp[layer].achievements) {
|
|
||||||
ach = tmp[layer].achievements[id]
|
|
||||||
if (isPlainObject(ach)) {
|
|
||||||
let style = []
|
|
||||||
if (ach.image){
|
|
||||||
style.push({'background-image': 'url("' + ach.image + '")'})
|
|
||||||
}
|
|
||||||
if (!ach.unlocked) style.push({'visibility': 'hidden'})
|
|
||||||
style.push(ach.style)
|
|
||||||
Vue.set(ach, 'computedStyle', style)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function constructBarStyles(layer){
|
function constructBarStyles(layer){
|
||||||
if (layers[layer].bars === undefined)
|
if (layers[layer].bars === undefined)
|
||||||
|
|
13
js/utils.js
13
js/utils.js
|
@ -364,19 +364,6 @@ function focused(x) {
|
||||||
onFocused = x
|
onFocused = x
|
||||||
}
|
}
|
||||||
|
|
||||||
function prestigeButtonText(layer) {
|
|
||||||
if (layers[layer].prestigeButtonText !== undefined)
|
|
||||||
return run(layers[layer].prestigeButtonText(), layers[layer])
|
|
||||||
else if (tmp[layer].type == "normal")
|
|
||||||
return `${player[layer].points.lt(1e3) ? (tmp[layer].resetDescription !== undefined ? tmp[layer].resetDescription : "Reset for ") : ""}+<b>${formatWhole(tmp[layer].resetGain)}</b> ${tmp[layer].resource} ${tmp[layer].resetGain.lt(100) && player[layer].points.lt(1e3) ? `<br><br>Next at ${(tmp[layer].roundUpCost ? formatWhole(tmp[layer].nextAt) : format(tmp[layer].nextAt))} ${tmp[layer].baseResource}` : ""}`
|
|
||||||
else if (tmp[layer].type == "static")
|
|
||||||
return `${tmp[layer].resetDescription !== undefined ? tmp[layer].resetDescription : "Reset for "}+<b>${formatWhole(tmp[layer].resetGain)}</b> ${tmp[layer].resource}<br><br>${player[layer].points.lt(30) ? (tmp[layer].baseAmount.gte(tmp[layer].nextAt) && (tmp[layer].canBuyMax !== undefined) && tmp[layer].canBuyMax ? "Next:" : "Req:") : ""} ${formatWhole(tmp[layer].baseAmount)} / ${(tmp[layer].roundUpCost ? formatWhole(tmp[layer].nextAtDisp) : format(tmp[layer].nextAtDisp))} ${tmp[layer].baseResource}
|
|
||||||
`
|
|
||||||
else if (tmp[layer].type == "none")
|
|
||||||
return ""
|
|
||||||
else
|
|
||||||
return "You need prestige button text"
|
|
||||||
}
|
|
||||||
|
|
||||||
function isFunction(obj) {
|
function isFunction(obj) {
|
||||||
return !!(obj && obj.constructor && obj.call && obj.apply);
|
return !!(obj && obj.constructor && obj.call && obj.apply);
|
||||||
|
|
Loading…
Reference in a new issue