GenZeeDocs

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.

ParameterType
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.

ParameterType
valuestring

Context menus

registerContext

-- client
exports.universal_ui:registerContext(context)

Register one menu or a list of menus. Menus without an id are ignored.

ParameterType
contexttable

unregisterContext

-- client
exports.universal_ui:unregisterContext(id)

Drop a registered menu (Universal UI extension: ox_lib registries only grow).

ParameterType
idstring

showContext

-- client
exports.universal_ui:showContext(id)
ParameterType
idstring

hideContext

-- client
exports.universal_ui:hideContext(onExit)

getOpenContextMenu

-- client
exports.universal_ui:getOpenContextMenu()

List menus

registerMenu

-- client
exports.universal_ui:registerMenu(data, cb)
ParameterTypeNotes
data{ id: string, title: string, position?: string, canClose?: boolean, options: table[], onSelected?: function, onSideScroll?: function, onClose?: function, onCheck?: function }
cbfunction|nilcalled with (selected, scrollIndex, args) on select

showMenu

-- client
exports.universal_ui:showMenu(id, startIndex)
ParameterType
idstring
startIndexnumber|nil

hideMenu

-- client
exports.universal_ui:hideMenu(onExit)
ParameterTypeNotes
onExitboolean|nilrun the menu's onClose handler

getOpenMenu

-- client
exports.universal_ui:getOpenMenu()

setMenuOptions

-- client
exports.universal_ui:setMenuOptions(id, options, index)
ParameterTypeNotes
idstring
optionstableoption or options array
indexnumber|nilreplace 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.

ParameterType
headingstring
rowstable
optionstable|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.

ParameterType
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)
ParameterType
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)
ParameterType
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.

ParameterTypeNotes
difficultystring|table|table[]'easy'|'medium'|'hard' or { areaSize, speedMultiplier }, or an array for multi-stage
inputsstring[]|nilkeys 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.

ParameterType
textstring
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.

ParameterType
idstring|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)
ParameterType
gameType'keyspam'|'memory'|'scramble'
optstable|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)
ParameterType
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.

ParameterTypeNotes
indexnumber1-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.

ParameterType
indexnumber|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.

ParameterType
patchtable

setLocale

-- client
exports.universal_ui:setLocale(patch)

Override player-facing UI strings at runtime. Keys mirror Config.Locale.

ParameterType
patchtable

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).

ParameterType
targetnumber
payloadtable

setTheme

-- server
exports.universal_ui:setTheme(patch)

Patch and persist the server theme, broadcasting to all players.

ParameterType
patchtable

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.

On this page