Skip to content

Commit dcad0b2

Browse files
authored
feat(radial): add lib.showRadialMenu Docs
Updated code examples for showing a specific radial menu. Related pull request: overextended/ox_lib#812 Signed-off-by: URRP XC <122388423+XCal-Dev@users.noreply.github.com>
1 parent 1ca61ca commit dcad0b2

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

content/docs/ox_lib/Interface/Client/radial.mdx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,29 @@ Registers a radial sub menu with predefined options.
120120
- onSelect?: `function(currentMenu: string | nil, itemIndex: number)` | `string`
121121
- Function that's ran when a user clicks the item.
122122

123+
## lib.showRadialMenu
124+
125+
Opens a registered radial menu as the root radial menu.
126+
127+
<Tabs items={["Lua", "JS"]}>
128+
<Tab>
129+
```lua
130+
lib.showRadialMenu(id)
131+
```
132+
</Tab>
133+
<Tab>
134+
```ts
135+
import lib from '@overextended/ox_lib/client';
136+
137+
lib.showRadialMenu(id);
138+
```
139+
140+
</Tab>
141+
</Tabs>
142+
143+
- id: string
144+
- Unique menu id from registered radial menus.
145+
123146
## lib.hideRadial
124147

125148
Hides the radial menu if one is open.
@@ -268,6 +291,15 @@ Here's a use case example with some global options and an option utilising the l
268291
function point:onExit()
269292
lib.removeRadialItem('garage_access')
270293
end
294+
295+
lib.addKeybind({
296+
name = 'urrp_radialmenu_config_demo',
297+
description = 'Open Police menu',
298+
defaultKey = 'F6',
299+
onPressed = function()
300+
lib.showRadialMenu('police_menu')
301+
end,
302+
})
271303
```
272304

273305
</Tab>

0 commit comments

Comments
 (0)