@@ -56,11 +56,11 @@ Do not be afraid at first glance of a complex structure. As you read this lesson
...
@@ -56,11 +56,11 @@ Do not be afraid at first glance of a complex structure. As you read this lesson
#### <a name="multi"> Multiple menus in one file </a>
#### <a name="multi"> Multiple menus in one file </a>
---
---
If you are making a small menu, it may make sense to write it in one file with the menus adjacent to it. To do this, the plugin provides a design that allows you to describe several menus in one file at once. In this case, the menu name will be considered the name of the block in which it is described. Here is an example:
If you are making a small menu, it may make sense to write it in one file with the menus adjacent to it. To do this, the plugin provides tool that allows you to describe several menus in one file at once. In this case, the menu name will be considered the name of the block in which it is described. Here is an example:
```hocon
```hocon
menus{
menus{
my_awesome_menu{// Menu name (unique)
my_awesome_menu{// Unique menu name
title:"My menu"
title:"My menu"
size:6
size:6
items:[
items:[
...
@@ -68,7 +68,7 @@ menus {
...
@@ -68,7 +68,7 @@ menus {
]
]
}
}
my_another_menu{
my_another_menu{
title:"My other menu"
title:"My another menu"
size:1
size:1
items:[
items:[
...
...
...
@@ -79,24 +79,24 @@ menus {
...
@@ -79,24 +79,24 @@ menus {
In the root of the file, the `menus` block is created, in which separate menus are created. In this example, two separate menus are created with the names `my_awesome_menu` and `my_another_menu`.
In the root of the file, the `menus` block is created, in which separate menus are created. In this example, two separate menus are created with the names `my_awesome_menu` and `my_another_menu`.
## <a name="menuVar"> Menu Options </a>
## <a name="menuVar"> Menu options </a>
To create a menu, whether in a separate file, or in a single file with other menus, you need to set its parameters. The table below will introduce you to the parameters that can be specified in the menu:
To create a menu, whether in a separate file, or in a single file with other menus, you need to set its parameters. The table below will meet you with the parameters that can be specified in the menu:
| title | String | {+Yes+} | Sets the title of the menu |
| title | String | {+Yes+} | Sets the title of the menu |
| size | Number | {+Yes+} | Sets the vertical size of the menu, that is, the number of cells |
| size | Number | {+Yes+} | Sets the vertical size of the menu, that is, the number of cells |
| items | [List of objects](Data types#list) | {-No-} | Sets items in the menu |
| items | [List of objects](Data types#list) | {-No-} | Sets items (buttons) in the menu |
| activators | [Object](Data types#object) | {-No-} | [Actions](Actions) to open the menu |
| activators | [Object](Data types#object) | {-No-} | [Actions](Actions) to open the menu |
| rules | [Object](Data types#object) / [List of objects](Data types#list) | {-No-} | [Rules](Rules) to open the menu. If at least one of the rules is not executed, the menu will not open. | | |
| rules | [Object](Data types#object) / [List of objects](Data types#list) | {-No-} | [Rules](Rules) to open the menu. If at least one of the rules is not executed, the menu will not open. | | |
| openActions | [Object](Data types#object) | {-No-} | [Actions](Actions) that will be executed **until** the menu is opened. |
| openActions | [Object](Data types#object) | {-No-} | [Actions](Actions) that will be executed **until** the menu is opened. |
| denyActions | [Object](Data types#object) | {-No-} | [Actions](Actions) that will be executed if **any** of the rules is not executed. |
| denyActions | [Object](Data types#object) | {-No-} | [Actions](Actions) that will be executed if **any** of the rules is not executed. |
| closeActions | [Object(Data types#object) | {-No-} | [Actions](Actions) that will be executed after the menu is closed. |
| closeActions | [Object(Data types#object) | {-No-} | [Actions](Actions) that will be executed after the menu is closed. |
| updateInterval| Integer | {-No-} | Sets the period for updating the menu in seconds. If absent, the menu is not updated automatically. |
| updateInterval| Integer | {-No-} | Sets the period for updating the menu in seconds. If absent, the menu will not update automatically. |
## <a name="update"> Auto-update menu </a>
## <a name="update"> Auto-update menu </a>
A bit more detailed about the `updateInterval` parameter. If you want to create a menu that will be automatically updated, including items, placeholders and any other dynamic data, you can specify the interval for updating the menu.
A bit more detailed about the `updateInterval` parameter. If you want to create a menu that will be automatically updated with items, placeholders and any other dynamic data, you can specify the interval for updating the menu.
```hocon
```hocon
title:"Updated menu"
title:"Updated menu"
...
@@ -115,9 +115,9 @@ The menu above will be updated every 2 seconds. Along with this, the button that
...
@@ -115,9 +115,9 @@ The menu above will be updated every 2 seconds. Along with this, the button that
In this example, the standard [placeholder](Placeholders) plugin was used.
In this example, the standard [placeholder](Placeholders) plugin was used.
## <a name="buttons"> Menu Buttons </a>
## <a name="buttons"> Menu buttons </a>
The button in the menu is an ordinary [item](Item format) with advanced functionality. Below are all the parameters that can be specified in addition to the standard parameters of the subject.
The button in the menu is an ordinary [item](Item format) with advanced functionality. Below are all the parameters that can be specified in addition to the standard parameters of the item.