ox_lib Integration
Flux UI Pack can replace ox_lib’s default UI components. When connected, all resources using ox_lib will automatically use Flux UI instead.
Setup
Method 1: Modify ox_lib init.lua (Recommended)
Add the following code at the end of ox_lib/init.lua:
local FLUX_RESOURCE <const> = "flux-ui-pack"
if GetResourceState(FLUX_RESOURCE) == "missing" then return end
local success, err = pcall(function()
local code = LoadResourceFile(FLUX_RESOURCE, "init.lua")
if code then
load(code)()
end
end)
if not success then
error(("Failed to load flux-ui-pack. Error: %s"):format(err))
endThis automatically loads Flux UI for all resources using ox_lib. No need to modify every resource’s fxmanifest.lua.
Method 2: Per-Resource fxmanifest (Legacy)
If you prefer not to modify ox_lib, add the following to each resource’s fxmanifest.lua that uses ox_lib:
shared_scripts {
'@ox_lib/init.lua',
'@flux-ui-pack/init.lua'
}Note: Do NOT add this into ox_lib itself. It must be added to every resource that uses ox_lib UI functions.
Ensure Order
Make sure ox_lib starts before flux-ui-pack in your server.cfg:
ensure ox_lib
ensure flux-ui-packCalling Styles
When ox_lib is present, all three calling methods work:
-- ox_lib global function
lib.showContext('menuId')
-- ox_lib export
exports['ox_lib']:showContext('menuId')
-- Direct flux-ui-pack export
exports['flux-ui-pack']:ShowContext('menuId')All three methods produce the same result — use whichever style you prefer.
Selective Replacement
You can keep ox_lib’s original UI for specific components and only override the rest. This is useful if you already have a notification style you like and only want Flux UI to take over menus, dialogs, progress, etc.
Set the flux:disabledComponents convar in your server.cfg with a JSON object listing the components you want to exclude from replacement:
ensure ox_lib
ensure flux-ui-pack
setr flux:disabledComponents "{\"notify\":true}"Anything listed here keeps ox_lib’s original behavior; everything else is replaced by Flux UI.
Available Component Keys
| Key | Affects |
|---|---|
notify | lib.notify (client and server) |
textUI | lib.showTextUI, lib.hideTextUI, lib.isTextUIOpen |
progressBar | lib.progressBar, lib.progressCircle, lib.progressActive, lib.cancelProgress |
radial | lib.addRadialItem, lib.removeRadialItem, lib.clearRadialItems, lib.registerRadial, lib.hideRadial, lib.disableRadial, lib.getCurrentRadialId |
skillCheck | lib.skillCheck, lib.skillCheckActive, lib.cancelSkillCheck |
inputDialog | lib.inputDialog, lib.closeInputDialog |
contextMenu | lib.registerContext, lib.showContext, lib.hideContext, lib.getOpenContextMenu |
alertDialog | lib.alertDialog, lib.closeAlertDialog |
listMenu | lib.registerMenu, lib.showMenu, lib.hideMenu, lib.getOpenMenu, lib.setMenuOptions |
Examples
Keep ox_lib notifications, replace everything else:
setr flux:disabledComponents "{\"notify\":true}"Keep ox_lib notifications and skillchecks:
setr flux:disabledComponents "{\"notify\":true,\"skillCheck\":true}"Replace everything (default — convar omitted or set to {}):
setr flux:disabledComponents "{}"Note: The convar value is a JSON object, so the inner double quotes must be escaped with backslashes in
server.cfg. Restart the server after changing the value.