-
Notifications
You must be signed in to change notification settings - Fork 14
Adding Submenus
Kiminaze edited this page Apr 8, 2022
·
3 revisions
Adds a new submenu to the specified parent menu.
local menuId, itemId = ECM:AddSubmenu(parentMenuId, title)| Parameter | Type | Range | Description |
|---|---|---|---|
| parentMenuId | integer | 0 and above | The menu this submenu should be attached to. (always 0 for the default menu) |
| title | string | - | The name of the item of the submenu. |
| Returned value | Type | Range | Description |
|---|---|---|---|
| menuId | integer | 1 and above | The menu id of the submenu. |
| itemId | integer | 1 and above | The item id of the submenus item. |
Example:
-- create submenu
local playerMenu, playerMenuItem = ECM:AddSubmenu(0, "Player")
-- create submenu inside submenu
local animMenu, animMenuItem = ECM:AddSubmenu(playerMenu, "Animations")Adds a new scroll submenu to the specified parent menu. This type of menu allows scrolling through the options.
local menuId, itemId = ECM:AddScrollSubmenu(parentMenuId, title, maxItems)| Parameter | Type | Range | Description |
|---|---|---|---|
| parentMenuId | integer | 0 and above | The menu this submenu should be attached to. (always 0 for the default menu) |
| title | string | - | The name of the item of the submenu. |
| maxItems | integer | 1 and above | The maximum number of items shown at once. Defaults to 10 if nil. |
| Returned value | Type | Range | Description |
|---|---|---|---|
| menuId | integer | 1 and above | The menu id of the submenu. |
| itemId | integer | 1 and above | The item id of the submenus item. |
Adds a new page submenu to the specified parent menu. This type of menu allows flipping through the options.
local menuId, itemId = ECM:AddPageSubmenu(parentMenuId, title, maxItems)| Parameter | Type | Range | Description |
|---|---|---|---|
| parentMenuId | integer | 0 and above | The menu this submenu should be attached to. (always 0 for the default menu) |
| title | string | - | The name of the item of the submenu. |
| maxItems | integer | 1 and above | The maximum number of items shown at once. Defaults to 10 if nil. |
| Returned value | Type | Range | Description |
|---|---|---|---|
| menuId | integer | 1 and above | The menu id of the submenu. |
| itemId | integer | 1 and above | The item id of the submenus item. |