1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2025-04-24 02:01:03 +00:00

Lore has evolved into infoboxes!

This commit is contained in:
Acamaeda 2020-10-25 18:21:02 -04:00
parent c5e60b082d
commit 79c5aad414
6 changed files with 32 additions and 15 deletions

View file

@ -41,6 +41,11 @@ addLayer("c", {
eff.waffleBoost = eff.waffleBoost.times(buyableEffect(this.layer, 11).first)
return "which are boosting waffles by "+format(eff.waffleBoost)+" and increasing the Ice Cream cap by "+format(eff.icecreamCap)
},
infoboxes:{
coolInfo: {
text: "momo"
}
},
milestones: {
0: {requirementDescription: "3 Lollipops",
done() {return player[this.layer].best.gte(3)}, // Used to determine when to give the milestone
@ -305,6 +310,7 @@ addLayer("c", {
},
jail: {
content: [
["infobox", "coolInfo"],
["bar", "longBoi"], "blank",
["row", [
["column", [

View file

@ -109,7 +109,15 @@ function updateLayers(){
layers[layer].bars[thing].layer = layer
if (layers[layer].bars[thing].unlocked === undefined)
layers[layer].bars[thing].unlocked = true
}
}
if (layers[layer].infoboxes){
for (thing in layers[layer].infoboxes){
layers[layer].infoboxes[thing].id = thing
layers[layer].infoboxes[thing].layer = layer
if (layers[layer].infoboxes[thing].unlocked === undefined)
layers[layer].infoboxes[thing].unlocked = true
}
}

View file

@ -106,6 +106,8 @@ function getStartPlayer() {
for (thing in extradata)
playerdata[thing] = extradata[thing]
}
playerdata.infoboxes = {}
for (layer in layers){
playerdata[layer] = layers[layer].startData()
playerdata[layer].buyables = getStartBuyables(layer)
@ -124,7 +126,11 @@ function getStartPlayer() {
for (item in layers[layer].microtabs)
playerdata.subtabs[layer][item] = Object.keys(layers[layer].microtabs[item])[0]
}
playerdata[layer].loreHidden = false
if (layers[layer].infoboxes) {
if (playerdata.infoboxes[layer] == undefined) playerdata.infoboxes[layer] = {}
for (item in layers[layer].infoboxes)
playerdata.infoboxes[layer][item] = false
}
}
return playerdata
}

14
js/v.js
View file

@ -69,17 +69,17 @@ function loadVue() {
`
})
Vue.component('lore', {
Vue.component('infobox', {
props: ['layer', 'data'],
template: `
<div class="story instant" v-bind:style="{'border-color': tmp[layer].color, 'border-radius': player[layer].loreHidden ? 0 : '8px'}">
<div class="story instant" v-if="tmp[layer].infoboxes && tmp[layer].infoboxes[data]!== undefined && tmp[layer].infoboxes[data].unlocked" v-bind:style="{'border-color': tmp[layer].color, 'border-radius': player.infoboxes[layer][data] ? 0 : '8px'}">
<button class="story-title" v-bind:style="{'background-color': tmp[layer].color}"
v-on:click="player[layer].loreHidden = !player[layer].loreHidden">
<span class="story-toggle">{{player[layer].loreHidden ? "+" : "-"}}</span>
{{layers[layer].name}}
v-on:click="player.infoboxes[layer][data] = !player.infoboxes[layer][data]">
<span class="story-toggle">{{player.infoboxes[layer][data] ? "+" : "-"}}</span>
<span v-html="tmp[layer].infoboxes[data].title ? tmp[layer].infoboxes[data].title : (tmp[layer].name)"></span>
</button>
<div v-if="!player[layer].loreHidden" class="story-text">
<span v-html="data ? data : layers[layer].lore"></span>
<div v-if="!player.infoboxes[layer][data]" class="story-text">
<span v-html="tmp[layer].infoboxes[data].text ? tmp[layer].infoboxes[data].text : 'Blah'"></span>
</div>
</div>
`