Save Slot

Component Structure

The following code is this component's initial HTML structure. Remember you can change this structure any time by using the template() component built-in function.
1
let background = '';
2
3
const hasImage = this.props.image && this.engine.asset ('scenes', this.props.image);
4
5
if (hasImage) {
6
background = `url(${this.engine.setting ('AssetsPath').root}/${this.engine.setting ('AssetsPath').scenes}/${this.engine.asset ('scenes', this.props.image)})`;
7
} else if (this.data.game.state.scene) {
8
background = this.data.game.state.scene;
9
10
if (background.indexOf (' with ') > -1) {
11
background = Text.prefix (' with ', background);
12
}
13
14
background = Text.suffix ('show scene', background);
15
16
} else if (this.data.game.state.background) {
17
background = this.data.game.state.background;
18
19
if (background.indexOf (' with ') > -1) {
20
background = Text.prefix (' with ', background);
21
}
22
23
background = Text.suffix ('show background', background);
24
}
25
return `
26
<button data-delete='${this.props.slot}'><span class='fas fa-times'></span></button>
27
<small class='badge'>${this.props.name}</small>
28
<div data-content="background" style="${hasImage ? 'background-image' : 'background'}: ${background}"></div>
29
<figcaption>${moment (this.props.date).format ('MMMM Do YYYY, h:mm:ss a')}</figcaption>
30
`;
Copied!
Last modified 2yr ago
Copy link