1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2024-11-24 01:11:46 +00:00
The-Modding-Tree/docs/infoboxes.md

32 lines
1.2 KiB
Markdown
Raw Normal View History

# Infoboxes
Infoboxes are good for displaying "lore", or story elements, as well as for explaining complicated things.
In the default tab layout, the first infobox will be displayed at the very top of the tab.
Infoboxes are defined like other Big Features:
```js
2020-10-26 20:45:22 +00:00
infoboxes: {
lore: {
title: "foo",
body() { return "bar" },
etc
2020-10-26 20:45:22 +00:00
},
etc
}
```
Features:
- title: The text displayed above the main box. Can be a function to be dynamic, and can use basic HTML.
- body: The text displayed inside the box. Can be a function to be dynamic, and can use basic HTML.
2020-10-26 20:45:22 +00:00
- style, titleStyle, bodyStyle: **optional**. Apply CSS to the infobox, or to the title button or body of the infobox, in the form of an object where the keys are CSS attributes, and the values are the values for those attributes (both as strings).
2020-10-26 20:45:22 +00:00
- unlocked(): **optional**. A function returning a bool to determine if the infobox is visible or not. Default is unlocked.
2020-10-26 20:45:22 +00:00
- layer: **assigned automagically**. It's the same value as the name of this layer, so you can do `player[this.layer].points` or similar
2020-10-26 20:45:22 +00:00
- id: **assigned automagically**. It's the "key" which the bar was stored under, for convenient access. The infobox in the example's id is "lore".