2020-08-19 02:50:24 +00:00
var app ;
function loadVue ( ) {
2020-09-11 02:15:05 +00:00
Vue . component ( 'layer-node' , {
props : [ 'layer' , 'abb' ] ,
template : `
< button v - if = "nodeShown(layer)"
v - bind : id = "layer"
v - on : click = " function ( ) {
showTab ( layer )
} "
v - bind : tooltip = "
2020-09-24 15:54:41 +00:00
player [ layer ] . unl ? formatWhole ( player [ layer ] . points ) + ' ' + layers [ layer ] . resource
: 'Reach ' + formatWhole ( tmp . layerReqs [ layer ] ) + ' ' + layers [ layer ] . baseResource + ' to unlock (You have ' + formatWhole ( tmp . layerAmt [ layer ] ) + ' ' + layers [ layer ] . baseResource + ')'
2020-09-11 02:15:05 +00:00
"
v - bind : class = " {
treeNode : true ,
[ layer ] : true ,
2020-09-24 15:54:41 +00:00
hidden : ! layers [ layer ] . layerShown ( ) ,
2020-09-27 20:25:06 +00:00
locked : ! player [ layer ] . unl && ! tmp . layerAmt [ layer ] . gte ( tmp . layerReqs [ layer ] ) ,
2020-09-24 15:54:41 +00:00
can : layerUnl ( layer ) ,
} "
v - bind : style = " {
'background-color' : layers [ layer ] . color ,
2020-09-11 02:15:05 +00:00
} " >
{ { abb } }
< / b u t t o n >
`
} )
2020-08-19 02:50:24 +00:00
app = new Vue ( {
2020-09-11 02:15:05 +00:00
el : "#app" ,
data : {
player ,
tmp ,
2020-09-24 15:54:41 +00:00
layers ,
2020-09-11 02:15:05 +00:00
Decimal ,
format ,
formatWhole ,
formatTime ,
focused ,
2020-09-14 19:26:10 +00:00
getThemeName ,
2020-09-11 02:15:05 +00:00
layerUnl ,
doReset ,
buyUpg ,
2020-09-14 02:41:42 +00:00
startChall ,
2020-09-11 02:15:05 +00:00
milestoneShown ,
keepGoing ,
2020-09-14 19:26:10 +00:00
VERSION ,
ENDGAME ,
2020-09-24 15:54:41 +00:00
LAYERS
2020-09-11 02:15:05 +00:00
} ,
2020-08-19 02:50:24 +00:00
} )
}