The-Modding-Tree/js/v.js

76 lines
1.4 KiB
JavaScript
Raw Normal View History

2020-08-18 22:50:24 -04:00
var app;
function loadVue() {
2020-09-10 22:15:05 -04: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="
layerUnl(layer) ? formatWhole(player[layer].points) + ' ' + LAYER_RES[layer]
: 'Reach ' + formatWhole(tmp.layerReqs[layer]) + ' ' + LAYER_AMT_NAMES[layer] + ' to unlock (You have ' + formatWhole(tmp.layerAmt[layer]) + ' ' + LAYER_AMT_NAMES[layer] + ')'
"
v-bind:class="{
treeNode: true,
[layer]: true,
hidden: !layerShown(layer),
locked: !layerUnl(layer),
can: layerUnl(layer)
}">
{{abb}}
</button>
`
})
2020-08-18 22:50:24 -04:00
app = new Vue({
2020-09-10 22:15:05 -04:00
el: "#app",
data: {
player,
tmp,
Decimal,
format,
formatWhole,
formatTime,
focused,
2020-09-14 15:26:10 -04:00
getThemeName,
2020-09-10 22:15:05 -04:00
layerUnl,
getLayerEffDesc,
doReset,
buyUpg,
getEnhancerCost,
getExtCapsuleCost,
getSpace,
getSpaceBuildingsUnl,
getSpaceBuildingCost,
getSpaceBuildingEffDesc,
buyBuilding,
getQuirkLayerCost,
buyQuirkLayer,
2020-09-13 22:41:42 -04:00
startChall,
2020-09-10 22:15:05 -04:00
milestoneShown,
destroyBuilding,
getSpellDesc,
activateSpell,
spellActive,
updateToCast,
keepGoing,
2020-09-14 15:26:10 -04:00
VERSION,
ENDGAME,
2020-09-10 22:15:05 -04:00
LAYERS,
LAYER_RES,
LAYER_TYPE,
LAYER_UPGS,
LAYER_EFFS,
LAYER_AMT_NAMES,
LAYER_RES_CEIL,
2020-09-13 22:41:42 -04:00
LAYER_CHALLS,
SPACE_BUILDINGS,
2020-09-10 22:15:05 -04:00
SPELL_NAMES,
2020-09-12 22:38:32 -04:00
LIFE_BOOSTERS,
2020-09-13 22:41:42 -04:00
HYPERSPACE,
IMPERIUM
2020-09-10 22:15:05 -04:00
},
2020-08-18 22:50:24 -04:00
})
}