Skip to content

Commit

Permalink
Update client.md
Browse files Browse the repository at this point in the history
  • Loading branch information
KadDarem committed Jun 20, 2024
1 parent 447d8f7 commit ae7c8ea
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions docs/jo_libs/modules/menu/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ local data = {
title = 'Menu', --The big title of the menu
subtitle = 'Elements', --The subtitle of the menu
numberOnScreen = 8, --The number of item display before add a scroll
onEnter = function()
onEnter = function(currentData)
print('Enter in menu '..id)
end,
onBack = function()
onBack = function(currentData)
print('Backspace/Esc pressed in menu '..id)
end,
onExit = function()
onExit = function(currentData)
print('Exit menu '..id)
end,
}
Expand Down Expand Up @@ -139,32 +139,32 @@ local menu = jo.menu.create('menu',{})
menu:addItem({
title = "Item 1",
price = {money = 10.2},
onActive = function()
onActive = function(currentData)
print('Item 1 active')
end,
onClick = function()
onClick = function(currentData)
print('Clicked on item 1')
end,
onChange = function()
onChange = function(currentData)
print('Something change in the item 1')
end,
onExit = function()
onExit = function(currentData)
print('Exit the item 1')
end
})
menu:addItem({
title = "Item 2",
price = {money = 10.2},
onActive = function()
onActive = function(currentData)
print('Item 2 active')
end,
onClick = function()
onClick = function(currentData)
print('Clicked on item 2')
end,
onChange = function()
onChange = function(currentData)
print('Something change in the item 2')
end,
onExit = function()
onExit = function(currentData)
print('Exit the item 2')
end
})
Expand Down Expand Up @@ -327,6 +327,17 @@ local hideRadar = true
jo.menu.show(visible,keepInput,hideRadar)
```

# Variables

## CurrentData
The argument pass on each function
#### keys
`CurrentData.menu` : *string*
> The unique ID of the menu
`CurrentData.item` : *table*
> The item active in the menu
# Replace your old menu

By default, the library is released with resource to replace the old framework menu.
Expand Down

0 comments on commit ae7c8ea

Please sign in to comment.