Skip to content

tweak(radial) add new methods for sub menu management #259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions pages/ox_lib/Modules/Interface/Client/radial.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,64 @@ Id of an item to be removed from the global menu.

- id: `string`

## lib.addRadialSubItem

Add an item or array of items to a specific radial sub menu.

<Tabs items={["Lua", "JS"]}>
<Tab>
```lua
lib.addRadialSubItem(parentMenuId, items)
```
</Tab>
<Tab>
```ts
import lib from '@overextended/ox_lib/client';

lib.addRadialSubItem(parentMenuId, items);
```
</Tab>
</Tabs>

- parentMenuId: `string`
- items: `table` (`object` or `array`)
- id: `string`
- Id that is used for removing options.
- icon: `string`
- Either a font awesome or a custom URI.1
- iconWidth?: `number`
- iconHeight?: `number`
- In the case of a custom URI, adjust the size of the icon.
- label: `string`
- Label uses ` \n` to insert a newline
- menu?: `string`
- Id of a menu to open.
- onSelect: `function(currentMenu: string | nil, itemIndex: number)` | `string`
- Function that's ran when a user clicks the item.
- keepOpen?: `boolean`

## lib.removeRadialSubItem

Remove an item from a specific radial sub menu.

<Tabs items={["Lua", "JS"]}>
<Tab>
```lua
lib.removeRadialSubItem(parentMenuId, item)
```
</Tab>
<Tab>
```ts
import lib from '@overextended/ox_lib/client';

lib.removeRadialSubItem(parentMenuId, item);
```
</Tab>
</Tabs>

- parentMenuId: `string`
- id: `string`

## lib.clearRadialItems

Removes all items from the radial menu.
Expand Down