1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2024-11-21 16:13:55 +00:00

Added "image-display" component

This commit is contained in:
Acamaeda 2020-10-04 17:14:13 -04:00
parent 1e7bfc1431
commit 8791a8a6af
2 changed files with 26 additions and 10 deletions

View file

@ -34,7 +34,7 @@ addLayer("c", {
icecreamCap: (player[this.layer].points * 10) icecreamCap: (player[this.layer].points * 10)
}}, }},
effectDescription() { // Optional text to describe the effects effectDescription() { // Optional text to describe the effects
eff = this.effect; eff = this.effect();
return "which are boosting waffles by "+format(eff.waffleBoost)+" and increasing the Ice Cream cap by "+format(eff.icecreamCap) return "which are boosting waffles by "+format(eff.waffleBoost)+" and increasing the Ice Cream cap by "+format(eff.icecreamCap)
}, },
milestones: { milestones: {
@ -190,9 +190,11 @@ addLayer("c", {
["column", [ ["column", [
["prestige-button", function() {return "Be redundant for "}, {'width': '150px', 'height': '30px'}], ["prestige-button", function() {return "Be redundant for "}, {'width': '150px', 'height': '30px'}],
["prestige-button", function() {return "Be redundant for "}, {'width': '150px', 'height': '30px'}], ["prestige-button", function() {return "Be redundant for "}, {'width': '150px', 'height': '30px'}],
]],
]], ]],
]], "blank",
], ["display-image", "discord.png"],
],
}, },
style() {return { style() {return {
// 'background-color': '#3325CC' // 'background-color': '#3325CC'

28
js/v.js
View file

@ -33,19 +33,19 @@ function loadVue() {
Vue.component('display-text', { Vue.component('display-text', {
props: ['layer', 'data'], props: ['layer', 'data'],
template: ` template: `
<span>{{readData(data)}}</span> <span>{{readData(data)}}</span>
` `
}) })
// data = a function returning html content, with some limited functionality // data = a function returning html content, with some limited functionality
Vue.component('raw-html', { Vue.component('raw-html', {
props: ['layer', 'data'], props: ['layer', 'data'],
template: ` template: `
<span v-html="readData(data)"></span> <span v-html="readData(data)"></span>
` `
}) })
// Blank lines, data = optional height in px or pair with width and height in px // Blank space, data = optional height in px or pair with width and height in px
Vue.component('blank', { Vue.component('blank', {
props: ['layer', 'data'], props: ['layer', 'data'],
template: ` template: `
@ -57,6 +57,20 @@ function loadVue() {
` `
}) })
// Displays an image, data is the URL
Vue.component('display-image', {
props: ['layer', 'data'],
template: `
<span><img v-bind:src= "readData(data)" v-bind:alt= "readData(data)"></span>
`
})
Vue.component('image', {
props: ['layer', 'data'],
template: `
`
})
// data = an array of Components to be displayed in a row // data = an array of Components to be displayed in a row
Vue.component('row', { Vue.component('row', {
props: ['layer', 'data'], props: ['layer', 'data'],