mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-02 14:38:50 +00:00
add onSelect for context menu
This commit is contained in:
1 parent
ce71231f6a
commit
60369b6115
1 file changed
+4
@@ -39,6 +39,7 @@ that will take you to the menu you defined.
|
|||||||
`options` - Contains all the clickable menu items.
|
`options` - Contains all the clickable menu items.
|
||||||
`item` - Defined as a key, can be empty if you don't want it to do anything.
|
`item` - Defined as a key, can be empty if you don't want it to do anything.
|
||||||
`item/title` - If not using keys then sets the title for the button.
|
`item/title` - If not using keys then sets the title for the button.
|
||||||
|
`item/onSelect` - Function that triggers when a button is pressed, returns it's args.
|
||||||
`item/image` - Image url, puts the image at the top of the metadata popover.
|
`item/image` - Image url, puts the image at the top of the metadata popover.
|
||||||
`item/icon` - FontAwesome icon that will be displayed on the left side, works the same as notification and textui icons.
|
`item/icon` - FontAwesome icon that will be displayed on the left side, works the same as notification and textui icons.
|
||||||
`item/iconColor` - Color of the displayed icon.
|
`item/iconColor` - Color of the displayed icon.
|
||||||
@@ -111,6 +112,9 @@ lib.registerContext({
|
|||||||
{
|
{
|
||||||
title = 'Example button',
|
title = 'Example button',
|
||||||
description = 'Example button description',
|
description = 'Example button description',
|
||||||
|
onSelect = function(args)
|
||||||
|
print('Pressed the button!')
|
||||||
|
end,
|
||||||
metadata = {
|
metadata = {
|
||||||
{label = 'Value 1', value = 'Some value'},
|
{label = 'Value 1', value = 'Some value'},
|
||||||
{label = 'Value 2', value = 300},
|
{label = 'Value 2', value = 300},
|
||||||
|
|||||||
Reference in new issue
Block a user