Exports
Every public export Universal UI 1.1.0 offers other resources.
Call these from your own resources with exports.universal_ui:name(...). Signatures and notes come straight from the code of version 1.1.0.
Notifications
notify
-- client
exports.universal_ui:notify(payload)Show a notification.
| Parameter | Type |
|---|---|
payload | { id?: string|number, title?: string, description?: string, type?: string, duration?: number, icon?: string|table, position?: string } |
setClipboard
-- client
exports.universal_ui:setClipboard(value)Copy a value to the player's clipboard.
| Parameter | Type |
|---|---|
value | string |
Context menus
registerContext
-- client
exports.universal_ui:registerContext(context)Register one menu or a list of menus. Menus without an id are ignored.
| Parameter | Type |
|---|---|
context | table |
unregisterContext
-- client
exports.universal_ui:unregisterContext(id)Drop a registered menu (Universal UI extension: ox_lib registries only grow).
| Parameter | Type |
|---|---|
id | string |
showContext
-- client
exports.universal_ui:showContext(id)| Parameter | Type |
|---|---|
id | string |
hideContext
-- client
exports.universal_ui:hideContext(onExit)getOpenContextMenu
-- client
exports.universal_ui:getOpenContextMenu()List menus
registerMenu
-- client
exports.universal_ui:registerMenu(data, cb)| Parameter | Type | Notes |
|---|---|---|
data | { id: string, title: string, position?: string, canClose?: boolean, options: table[], onSelected?: function, onSideScroll?: function, onClose?: function, onCheck?: function } | |
cb | function|nil | called with (selected, scrollIndex, args) on select |
showMenu
-- client
exports.universal_ui:showMenu(id, startIndex)| Parameter | Type |
|---|---|
id | string |
startIndex | number|nil |
hideMenu
-- client
exports.universal_ui:hideMenu(onExit)| Parameter | Type | Notes |
|---|---|---|
onExit | boolean|nil | run the menu's onClose handler |
getOpenMenu
-- client
exports.universal_ui:getOpenMenu()setMenuOptions
-- client
exports.universal_ui:setMenuOptions(id, options, index)| Parameter | Type | Notes |
|---|---|---|
id | string | |
options | table | option or options array |
index | number|nil | replace a single option at index |
Input and alert dialogs
inputDialog
-- client
exports.universal_ui:inputDialog(heading, rows, options)Open an input dialog and block until submitted or cancelled.
| Parameter | Type |
|---|---|
heading | string |
rows | table |
options | table|nil |
Returns table\|nil: values nil when cancelled.
closeInputDialog
-- client
exports.universal_ui:closeInputDialog()Force-close the active input dialog; its return value becomes nil.
alertDialog
-- client
exports.universal_ui:alertDialog(data)Open an alert dialog and block until answered.
| Parameter | Type |
|---|---|
data | { header: string, content: string, centered?: boolean, cancel?: boolean, size?: string, labels?: table } |
Returns 'confirm'\|'cancel'\|nil.
closeAlertDialog
-- client
exports.universal_ui:closeAlertDialog()Progress bar and circle
progressBar
-- client
exports.universal_ui:progressBar(data)| Parameter | Type |
|---|---|
data | { duration: number, label?: string, useWhileDead?: boolean, canCancel?: boolean, position?: string, disable?: table, anim?: table, prop?: table } |
Returns boolean: success false when cancelled.
progressCircle
-- client
exports.universal_ui:progressCircle(data)| Parameter | Type |
|---|---|
data | { duration: number, label?: string, useWhileDead?: boolean, canCancel?: boolean, position?: string, disable?: table, anim?: table, prop?: table } |
Returns boolean: success false when cancelled.
progressActive
-- client
exports.universal_ui:progressActive()cancelProgress
-- client
exports.universal_ui:cancelProgress()Skill checks
skillCheck
-- client
exports.universal_ui:skillCheck(difficulty, inputs)Run a skill check and block until finished.
| Parameter | Type | Notes |
|---|---|---|
difficulty | string|table|table[] | 'easy'|'medium'|'hard' or { areaSize, speedMultiplier }, or an array for multi-stage |
inputs | string[]|nil | keys the player may be asked to press (default { 'e' }) |
Returns boolean: success.
cancelSkillCheck
-- client
exports.universal_ui:cancelSkillCheck()skillCheckActive
-- client
exports.universal_ui:skillCheckActive()Text UI
showTextUI
-- client
exports.universal_ui:showTextUI(text, options)Show (or update) a text UI entry. id is a Universal UI extension: entries with different ids render simultaneously. kicker is a Universal UI extension: the micro-label above the action text.
| Parameter | Type |
|---|---|
text | string |
options | { id?: string, position?: string, icon?: string|table, iconColor?: string, kicker?: string }|nil |
hideTextUI
-- client
exports.universal_ui:hideTextUI(id)Hide a text UI entry. No id hides the default entry (ox_lib parity); pass an id for a specific entry.
| Parameter | Type |
|---|---|
id | string|nil |
clearTextUI
-- client
exports.universal_ui:clearTextUI()Hide every text UI entry.
isTextUIOpen
-- client
exports.universal_ui:isTextUIOpen()ox_lib parity: reports the DEFAULT entry (bridged scripts never pass ids).
getTextUIs
-- client
exports.universal_ui:getTextUIs()Universal UI extension: every open entry as { id = text } pairs.
Minigames
minigame
-- client
exports.universal_ui:minigame(gameType, opts)| Parameter | Type |
|---|---|
gameType | 'keyspam'|'memory'|'scramble' |
opts | table|nil |
Returns boolean: success.
cancelMinigame
-- client
exports.universal_ui:cancelMinigame()minigameActive
-- client
exports.universal_ui:minigameActive()Circle
-- client
exports.universal_ui:Circle(cb, circles, time)ps-ui: Circle(callback, circles, time) - time is seconds of ring travel.
Scrambler
-- client
exports.universal_ui:Scrambler(cb, scrambleType, time)ps-ui: Scrambler(callback, type, time) - time in seconds.
Task guides
startGuide
-- client
exports.universal_ui:startGuide(data)| Parameter | Type |
|---|---|
data | { title?: string, stages: { label: string, description?: string }[] } |
setGuideStage
-- client
exports.universal_ui:setGuideStage(index)Mark every stage below index complete and make index the active stage.
| Parameter | Type | Notes |
|---|---|---|
index | number | 1-based |
completeGuideStage
-- client
exports.universal_ui:completeGuideStage(index)Complete a stage (default: the active one). Advances to the next incomplete stage; completing the last stage ends the guide.
| Parameter | Type |
|---|---|
index | number|nil |
endGuide
-- client
exports.universal_ui:endGuide()guideActive
-- client
exports.universal_ui:guideActive()Theme and locale
setTheme
-- client
exports.universal_ui:setTheme(patch)Patch the live theme locally. Keys mirror Config.Theme.
| Parameter | Type |
|---|---|
patch | table |
setLocale
-- client
exports.universal_ui:setLocale(patch)Override player-facing UI strings at runtime. Keys mirror Config.Locale.
| Parameter | Type |
|---|---|
patch | table |
Server
Server-side exports. Call them from a server script.
notify
-- server
exports.universal_ui:notify(target, payload)Send a notification to a specific player (-1 for everyone).
| Parameter | Type |
|---|---|
target | number |
payload | table |
setTheme
-- server
exports.universal_ui:setTheme(patch)Patch and persist the server theme, broadcasting to all players.
| Parameter | Type |
|---|---|
patch | table |
Returns boolean: applied false when nothing in the patch was valid.
clearTheme
-- server
exports.universal_ui:clearTheme()Wipe the saved theme; clients fall back to Config.Theme defaults.
