var app;
function loadVue() {
Vue.component('layer-node', {
props: ['layer', 'abb'],
template: `
{{abb}}
`
})
Vue.component('challs', {
props: ['layer'],
template: `
{{layers[layer].challs[row*10+col].name}}
{{player[layer].active==(row*10+col)?(canCompleteChall(layer, row*10+col)?"Finish":"Exit Early"):(player[layer].challs.includes(row*10+col)?"Completed":"Start")}}
{{layers[layer].challs[row*10+col].desc}}
Goal: {{format(layers[layer].challs[row*10+col].goal)}} {{layers[layer].challs[row*10+col].currencyDisplayName ? layers[layer].challs[row*10+col].currencyDisplayName : "points"}}
Reward: {{layers[layer].challs[row*10+col].reward}}
Currently: {{(layers[layer].challs[row*10+col].effDisp) ? (layers[layer].challs[row*10+col].effDisp(layers[layer].challs[row*10+col].effect())) : format(layers[layer].challs[row*10+col].effect())}}
`
})
Vue.component('upgrades', {
props: ['layer'],
template: `
{{ layers[layer].upgrades[row*10+col].desc }} Currently: {{(layers[layer].upgrades[row*10+col].effDisp) ? (layers[layer].upgrades[row*10+col].effDisp(layers[layer].upgrades[row*10+col].effect())) : format(layers[layer].upgrades[row*10+col].effect())}} Cost: {{ formatWhole(layers[layer].upgrades[row*10+col].cost) }} {{(layers[layer].upgrades[row*10+col].currencyDisplayName ? layers[layer].upgrades[row*10+col].currencyDisplayName : layers[layer].resource)}}
`
})
Vue.component('milestones', {
props: ['layer'],
template: `
{{layers[layer].milestones[id].requirementDesc}} {{layers[layer].milestones[id].effectDesc}}
`
})
Vue.component('toggle', {
props: ['layer', 'data'],
template: `
{{player[data[0]][data[1]]?"ON":"OFF"}}
`
})
// data = function to return the text describing the reset before the amount gained (optional)
Vue.component('prestige-button', {
props: ['layer', 'data'],
template: `
{{data ? data() : "Reset for "}} +{{formatWhole(tmp.resetGain[layer])}} {{layers[layer].resource}} Next at {{ (layers[layer].resCeil ? formatWhole(tmp.nextAt[layer]) : format(tmp.nextAt[layer])) }} {{ layers[layer].baseResource }}
{{data ? data() : "Reset for "}} +{{formatWhole(tmp.resetGain[layer])}} {{layers[layer].resource}}Req: {{formatWhole(tmp.layerAmt[layer])}} / {{(layers[layer].resCeil ? formatWhole(tmp.nextAt[layer]) : format(tmp.nextAt[layer]))}} {{ layers[layer].baseResource }}
`
})
// Displays the main resource for the layer
Vue.component('main-display', {
props: ['layer'],
template: `
You have
{{formatWhole(player[layer].points)}} {{layers[layer].resource}}, {{layers[layer].effectDescription()}}
`
})
// data = a function returning the content, data2 = a CSS object with the formatting (optional)
Vue.component('display-text', {
props: ['layer', 'data' , 'data2'],
template: `
{{data()}}
`
})
// data = a function returning html content, with some limited functionality
Vue.component('raw-html', {
props: ['layer', 'data'],
template: `
`
})
// Blank lines
Vue.component('blank', {
props: ['layer', 'data'],
template: `
`
})
app = new Vue({
el: "#app",
data: {
player,
tmp,
layers,
Decimal,
format,
formatWhole,
formatTime,
focused,
getThemeName,
layerUnl,
doReset,
buyUpg,
startChall,
milestoneShown,
keepGoing,
VERSION,
ENDGAME,
LAYERS
},
})
}