Skip to content

Commit 4c3b862

Browse files
authored
fancydialogs - update docs (#58)
requirements, width, columns, exitaction
1 parent abd9722 commit 4c3b862

1 file changed

Lines changed: 33 additions & 4 deletions

File tree

content/docs/minecraft-plugins/fancydialogs/tutorials/json-schema.mdx

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ Below is an example of a simple dialog defined using the FancyDialogs JSON schem
3535
"maxLength": 50,
3636
"maxLines": 1
3737
}
38-
]
38+
],
39+
"requirements": {
40+
"type": ""
41+
},
42+
"width": 200
3943
},
4044
"buttons": [
4145
{
@@ -46,9 +50,18 @@ Below is an example of a simple dialog defined using the FancyDialogs JSON schem
4650
"name": "message",
4751
"data": "Your favorite color is: <color:{fav_color}>{fav_color}</color>"
4852
}
49-
]
53+
],
54+
"requirements": {
55+
"type": ""
56+
},
57+
"width": 150
5058
}
51-
]
59+
],
60+
"exitAction": {
61+
"label": "Close",
62+
"actions": []
63+
},
64+
"columns": 2
5265
}
5366
```
5467

@@ -68,6 +81,8 @@ Below is an example of a simple dialog defined using the FancyDialogs JSON schem
6881

6982
`buttons`: The buttons of the dialog - see [Button Section](#button-fields) for details
7083

84+
`columns`: The amount of columns in the dialog (only works for multi action dialogs), default 2
85+
7186
### Body fields
7287

7388
`text`: The text to display in the body of the dialog (supports MiniMessage & PlaceholderAPI)
@@ -100,6 +115,8 @@ Items will be supported in the body section in a future release.
100115

101116
`maxLines`: The maximum number of lines for the input (greater than 1 will create a multiline text field)
102117

118+
`requirements`: A requirement for the input to display - see [Requirements](#requirements) for details
119+
103120
#### Select Fields
104121

105122
`key`: The key to use to store the input value (can be used as a placeholder in actions)
@@ -113,11 +130,16 @@ Items will be supported in the body section in a future release.
113130
- `display`: The text to display in the select field (supports MiniMessage & PlaceholderAPI)
114131
- `initial`: Whether this option is selected by default (default: false)
115132

133+
`requirements`: A requirement for the select field to display - see [Requirements](#requirements) for details
134+
116135
### Button fields
117136

137+
The "exitAction" field is a button that will display on the footer for applicable dialogs!
138+
118139
- `label`: The text to display on the button (supports MiniMessage & PlaceholderAPI)
119140
- `tooltip`: The tooltip to display when hovering over the button (supports MiniMessage & PlaceholderAPI)
120141
- `actions`: A list of actions that will be executed when the button is clicked - see [Actions](#actions) for details
142+
- `requirements`: A requirement for the button to display - see [Requirements](#requirements) for details
121143

122144
#### Actions
123145

@@ -130,4 +152,11 @@ Available actions include:
130152
- `player_command`: Executes a command as the player (set `data` to the command)
131153
- `open_dialog`: Opens another dialog (set `data` to the ID of the dialog to open)
132154
- `open_random_dialog`: Opens another dialog (set `data` to a list of dialog IDs separated by commas: 'dialog1,dialog2,dialog3')
133-
- `send_to_server`: Sends the player to another server (requires BungeeCord or Velocity) (set `data` to the server name)
155+
- `send_to_server`: Sends the player to another server (requires BungeeCord or Velocity) (set `data` to the server name)
156+
157+
#### Requirements
158+
159+
- `type`: Either `permission` or `stringMatch`.
160+
- `permission`: If type is `permission`, this is the permission to check for.
161+
- `input`: If type is `stringMatch`, this is the string being matched against `output`.
162+
- `output`: If type is `stringMatch`, this is the string being matched against `input`.

0 commit comments

Comments
 (0)