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

34 lines
1.3 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
infoboxes: {
infobox: {
display() {return "Blah"},
etc
}
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.
- 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).
- unlocked(): **optional**, A function returning a bool to determine if the infobox is visible or not. Default is unlocked.
- layer: **Assigned automagically**. It's the same value as the name of this layer, so you can do player[this.layer].points or similar
- id: **Assigned automagically**. It's the "key" which the bar was stored under, for convenient access.
The bar in the example's id is "bigBar".