2. Json Structure
2.1 Settings Object
- The structure is as follows:
"settings":
{
"openbutton": 1,
"hideicon": true,
"hideiconafter": 10,
"iconurl": "https://i.imgur.com/OZ6xOjY.png",
"disableicontext": false,
"iconposition": 0,
"icontextcolor": 0,
"openonstart": true,
"openonstartonlynewplayers": true,
"updateinterval": 24
},
- OpenButton: 0/1/2/3/4/5/6
- Default:
0
- Determines the button the player needs to press to open the UI
- 0=F1, 1=F2, 2=F3, 3=F4, 4=F5, 5=Delete, 6=Home
- Default:
- HideIcon:
true/false
- Default:
false
- If true the icon in the bottom left corner vanishes after some time
- Default:
- HideIconAfter: Integer
- Default:
60
- Determines after how many seconds the icon vanishes.
- Default:
- IconURL: "URL"
- Default:
"https://i.imgur.com/OZ6xOjY.png"
- Checkout 4. Hosting the images on how to host the images
- Default:
- DisableIconText: true/false
- Default:
false
- If true the text "F1 for Info" will not be displayed
- Default:
- IconPosition: 0/1/2/3
- Default:
0
- Set the position of the Icon
- 0=Top Left, 1=Top Right, 2=Bottom Right, 3=Bottom Left
- Default:
- IconTextColor: 0/1/2/3/4/5/6/7/8
- Default:
0
- Sets the color of the "F1 For Info" text
- 0=Light Blue, 1=Red, 2=Green, 3=Blue, 4=Yellow, 5=Orange, 6=Violet, 7=Black, 8=White
- Default:
- OpenOnStart: true/false
- Default:
true
- If true the UI will open automatically after the player spawns
- Default:
- OpenOnStartOnlyNewPlayers: true/false
- Default:
true
- If true the UI only opens automatically the first time the player spawns on the server
- Default:
- UpdateInterval: Integer
- Default:
12
- This value determines the time in hours the mod automatically pulls the JSON from the URL to update settings
- Default:
2.2 Tabs Array
- The minimal structure is as follows:
"tabs": [
{
"layout": 1,
"buttontext": "<RichColor Color=\"1,0,0,1\">1 Box layout</>",
"imageurl": "https://i.imgur.com/mGt3cAF.png",
"content": [
{
"title": "Welcome to WBUI2!",
"text": "Your text could be here.\n\nMore example text..."
}
]
}
],
- layout: 1/2/3/4
- Set one of the four different layouts.
- Layout 1
- Layout 2
- Layout 3
- Layout 4
- Layout 1
- Set one of the four different layouts.
- buttontext
- The text shown on the button for the tab
- imageurl
- Checkout 4. Hosting the images on how to host the images.
- content (Array)
- Each element contains a title and text.
- Further details here: 2.3 Tab Content
- For additional tabs, just copy paste the whole object. e.g.:
"tabs": [
{
"layout": 1,
"buttontext": "1 Box Layout",
"imageurl": "https://i.imgur.com/mGt3cAF.png",
"content": [
{
"title": "title",
"text": "This text goes into the box"
}
]
},
{
"layout": 1,
"buttontext": "1 Box Layout",
"imageurl": "https://i.imgur.com/mGt3cAF.png",
"content": [
{
"title": "title",
"text": "This text goes into the box"
}
]
}
],
- There is no theoretical limit on how many tabs you could add. At some point there will appear a horizontal scrollbox.
2.3 Tab Content
- The content array for each tab allows for flexible structures. For example, a 4-box layout:
{
"layout": 4,
"buttontext": "4 Box layout",
"imageurl": "https://i.imgur.com/mGt3cAF.png",
"content": [
{
"title": "Top left title",
"text": "This text goes into the top left box"
},
{
"title": "Top right title",
"text": "This text goes into the top right box"
},
{
"title": "Bottom left title",
"text": "This text goes into the bottom left box"
},
{
"title": "Bottom right title",
"text": "This text goes into the bottom right box"
}
]
}
- text
- To pass the JSON validation, use "\n" to generate newlines.
- Special characters like
"
have to be escaped with a\
.
2.4.1 buttontext / title / text coloring
- The font color of these keys/values can be changed with a special syntax:
- This would be <RichColor Color=\"1,0,0,1\">Red text</>
- This would be <RichColor Color=\"0,1,0,1\">Green text</>
- This would be <RichColor Color=\"0,0,1,1\">Blue text</>
- This would be <RichColor Color=\"1,0.65,0,1\">Orange text</>
- Only the text between
<RichColor Color=\"1,0,0,1\"></>
will be colored. The rest will be the default light blue. - You HAVE TO unescape the
"
with a\
!!
2.4.2 text coloring (bigger font size)
- The font size/color of these keys/values can be changed with a special syntax:
- This would be bigger <TextStyle.Red>Red text</>
- This would be bigger <TextStyle.LightBlue>Green text</>
- This would be bigger <TextStyle.Green>Green text</>
- This would be bigger <TextStyle.Blue>Blue text</>
- This would be bigger <TextStyle.Yellow>Yellow text</>
- This would be bigger <TextStyle.Orange>Orange text</>
- This would be bigger <TextStyle.Violet>Violet text</>
- This would be bigger <TextStyle.White>White text</>
- This would be bigger <TextStyle.Black>Black text</>
- Only the text between
<TextStyle.Red></>
will be displayed bigger and colored.
2.5 Links Array
- The minimal structure is as follows:
"links": [
{
"text": "Link to Wiki",
"url": "https://wiki.wbui2.de"
}
],
- text
- The text shown on the button for the Link
- url
- The URL to which the link points
- Text can be colored just like 2.4.1 buttontext / title / text coloring
- There is no theoretical limit on how many tabs you could add. At some point there will appear a horizontal scrollbox.
"links": [
{
"text": "Link to Wiki",
"url": "https://wiki.wbui2.de"
},
{
"text": "Link to discord",
"url": "https://discord.com/invite/K7NyrTV"
},
{
"text": "Link to google",
"url": "https://google.com"
}
],
2.6 Version
"version": 2
- The version field specifies the version of the WBUI2 configuration. Current version: 2