> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fzd-scripts.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Ox Lib compatibility

> Use existing Ox Lib radial-menu integrations with FzD Action Wheel.

FZD Action Wheel can receive radial items registered through Ox Lib without
replacing the rest of Ox Lib. Notifications, callbacks, context menus, input
dialogs, zones, points and other Ox features continue to use Ox normally.

Only the radial functions are redirected to FZD.

<Info>
  This integration is optional. Scripts written directly for FZD Action Wheel do
  not need to modify Ox Lib.
</Info>

## Choose an installation method

You can inspect every supplied file before using it. FZD does not run an
installer, modify Ox automatically or request permission to write into another
resource.

| Your Ox Lib installation                             | Recommended method                                       |
| ---------------------------------------------------- | -------------------------------------------------------- |
| Unmodified Ox Lib 3.39.0                             | [Drag and drop](#option-1-drag-and-drop)                 |
| Custom radial menu or a different compatible version | [Manual copy and paste](#option-2-manual-copy-and-paste) |
| Installation managed with Git                        | [Command-line patch](#option-3-command-line-patch)       |

<Warning>
  Do not use the drag-and-drop replacement if your
  `ox_lib/resource/interface/client/radial.lua` file has been customised. Replacing
  that file would remove those customisations. Use the manual method instead.
</Warning>

## Before you begin

Stop the FiveM server and make a copy of:

```text theme={null}
ox_lib/resource/interface/client/radial.lua
```

Keep the copy as `radial.lua.backup`. This is your own restoration file and
should be preferred over any stock copy supplied with FZD.

## Option 1: Drag and drop

This option does not run a command, program or executable. It replaces one
plain-text Lua file and is intended only for an unmodified Ox Lib 3.39.0
installation.

### Check your version

Open `ox_lib/fxmanifest.lua` in a text editor and look for:

```lua theme={null}
version '3.39.0'
```

If the version differs, use the manual method.

### Install

1. Stop the FiveM server.

2. Open the FZD folder shown below:

   ```text theme={null}
   integrations/ox_lib/drag-and-drop/3.39.0/install/resource/interface/client/
   ```

3. Copy the supplied `radial.lua`.

4. Open `ox_lib/resource/interface/client/`.

5. Rename the existing file to `radial.lua.backup`.

6. Paste the supplied `radial.lua` into the folder.

7. Start the server using the [required start order](#resource-start-order).

You can also inspect the prepared `radial.lua` in the supplied `integrations/ox_lib` files before copying it.

### Remove

1. Stop the server.
2. Delete the installed `radial.lua`.
3. Rename your retained `radial.lua.backup` to `radial.lua`.
4. Start the server again.

If your own backup is unavailable and the original installation was definitely
unmodified Ox Lib 3.39.0, a supplied stock restoration file is included.

### File checksums

```text theme={null}
FZD bridge radial.lua
092E162DD8DF7317C505E71FFA4FD2BFA3036E80A22DED623EA5EEA14D3DDE89

Stock Ox Lib 3.39.0 radial.lua
7FC09722EA4FBF7657216C48CC6B9EA9B135C04BA2A98FD79EAB08A9D680437B
```

These are SHA-256 checksums for customers who want to verify the supplied files.
The Ox source retains its LGPL-3.0-or-later notice. The matching Ox Lib licence file is supplied alongside it.

## Option 2: Manual copy and paste

Use this method when the Ox radial file has been customised or the supplied
version-specific replacement is unsuitable.

Open:

```text theme={null}
ox_lib/resource/interface/client/radial.lua
```

Find each function named below and paste its matching block immediately after
the function declaration. Do not replace the existing code beneath it.

### `registerRadial`

Paste below `function lib.registerRadial(radial)`:

```lua theme={null}
if GetResourceState('fzd_actionwheel') == 'started' then
    return exports.fzd_actionwheel:registerRadial(radial, GetInvokingResource())
end
```

### `getCurrentRadialId`

Paste below `function lib.getCurrentRadialId()`:

```lua theme={null}
if GetResourceState('fzd_actionwheel') == 'started' then
    return exports.fzd_actionwheel:getCurrentRadialId()
end
```

### `hideRadial`

Paste below `function lib.hideRadial()`:

```lua theme={null}
if GetResourceState('fzd_actionwheel') == 'started' then
    return exports.fzd_actionwheel:hideRadial()
end
```

### `addRadialItem`

Paste below `function lib.addRadialItem(items, parentMenuId)`:

```lua theme={null}
if GetResourceState('fzd_actionwheel') == 'started' then
    return exports.fzd_actionwheel:addRadialItem(items, parentMenuId, GetInvokingResource())
end
```

### `removeRadialItem`

Paste below `function lib.removeRadialItem(id, parentMenuId)`:

```lua theme={null}
if GetResourceState('fzd_actionwheel') == 'started' then
    return exports.fzd_actionwheel:removeRadialItem(id, parentMenuId)
end
```

### `clearRadialItems`

Paste below `function lib.clearRadialItems()`:

```lua theme={null}
if GetResourceState('fzd_actionwheel') == 'started' then
    return exports.fzd_actionwheel:clearRadialItems()
end
```

### `disableRadial`

Paste below `function lib.disableRadial(state)`:

```lua theme={null}
if GetResourceState('fzd_actionwheel') == 'started' then
    return exports.fzd_actionwheel:disableRadial(state)
end
```

### Optional `showRadialMenu`

Some Ox versions contain `function lib.showRadialMenu(id)`. If the function
already exists, paste this block immediately beneath its declaration:

```lua theme={null}
if GetResourceState('fzd_actionwheel') == 'started' then
    return exports.fzd_actionwheel:showRadialMenu(id)
end
```

Do not create a new Ox function solely to add this optional block.

### Remove manual changes

Remove only the three-line `if GetResourceState(...)` block added beneath each
function. Preserve the function declaration and all original or customised code.

## Option 3: Command-line patch

The repository includes the readable `integrations/ox_lib/ox_lib-3.39-radial.patch` text patch for developers who already manage their Ox installation with Git.

From the root of `ox_lib`, check the patch before applying it:

```powershell theme={null}
git apply --check "C:\path\to\ox_lib-3.39-radial.patch"
git apply "C:\path\to\ox_lib-3.39-radial.patch"
```

To remove it, check and then reverse it:

```powershell theme={null}
git apply --reverse --check "C:\path\to\ox_lib-3.39-radial.patch"
git apply --reverse "C:\path\to\ox_lib-3.39-radial.patch"
```

Never force the patch when its safety check fails; use the manual method instead.

## Resource start order

Place the resources in this order in `server.cfg`:

```cfg theme={null}
ensure ox_lib
ensure fzd_actionwheel
ensure qbx_radialmenu
```

Only include `qbx_radialmenu` when it is installed. Any resource that registers
radial items must start after Ox Lib and FZD Action Wheel.

After restarting FZD, restart those integrating resources so they can register
their radial items again.

## What changes in game?

Existing resources can continue using these Ox radial functions:

* `lib.registerRadial`
* `lib.getCurrentRadialId`
* `lib.hideRadial`
* `lib.addRadialItem`
* `lib.removeRadialItem`
* `lib.clearRadialItems`
* `lib.disableRadial`
* `lib.showRadialMenu` when present

While FZD is running, those calls are handled by FZD Action Wheel. If FZD is not
running, each bridge block falls through to the original Ox implementation.

Players open the combined menu using FZD's configured action-wheel binding. Ox's
original `Z` binding does not contain the forwarded items.

## Troubleshooting

### Ox items do not appear

* Confirm `ox_lib` starts before `fzd_actionwheel`.
* Restart the resource that registers the missing radial items.
* Confirm the FZD resource folder is named exactly `fzd_actionwheel`.
* Check the client console for an export or Lua error.

### Custom Ox styling no longer appears

Ox radial items are intentionally displayed using FZD's interface while FZD is
running. Other Ox interfaces retain their existing styling.

### The stock replacement removed custom behaviour

Stop the server and restore your retained `radial.lua.backup`. Reapply the bridge
using the manual method so the custom code remains in place.
