JCKSDocs
JCKS BridgeV2Reference

UI providers

Choose what shows notifications, progress bars, skill checks and text prompts for every JCKS script, and register your own provider.

JCKS scripts never call a notification or progress resource directly. They call the bridge, and the bridge sends the call to the provider chosen in /jcks, Providers. Each kind has its own choice, and every script can override it.

Kinds and values

Kind Values (resource that must run)
Notifications (notify) jcks_lib, ox_lib, esx (es_extended), qbx (qbx_core), qb (qb-core), lation_ui, okokNotify, wasabi_notify, brutal_notify, 17mov_Hud, qs-interface, t-notify, ps-ui, mythic_notify, pNotify, custom
Progress bar (progress) jcks_lib, ox_lib, lation_ui, esx (esx_progressbar), qb (progressbar), qs-interface, 17mov_Hud, mythic_progbar, custom
Skill check (skillcheck) jcks_lib, ox_lib, lation_ui, bl_ui, qb-minigames, ps-ui, boii_minigames, custom
Prompt (textui) jcks_lib, ox_lib, lation_ui, okokTextUI, brutal_textui, jg-textui, cd_drawtextui, ps-ui, 17mov_Hud, esx (esx_textui), qb (qb-core DrawText), custom
Context menu (context) jcks_lib, ox_lib, lation_ui, qb-menu
Input dialog (input) jcks_lib, ox_lib, lation_ui, qb-input
Confirm dialog (alert) jcks_lib, ox_lib, lation_ui
Radial menu (radial) jcks_lib, ox_lib, lation_ui

Every kind defaults to Automatic (auto): the first value in the list whose resource is running. When nothing in the list runs, custom is used, or jcks_lib for the menu and dialog kinds. A chosen provider whose resource is not running falls back to the automatic choice.

Per script overrides

Different provider per script sets another provider for one resource, for example jcks_jobs with the ox_lib skill check and ESX notifications. Anything left unset uses the server choice. The bridge reads the calling resource of every call, so the override applies to that resource only.

Placement

The same page holds the default notification position, progress style and prompt position. Starting values come from settings/config.lua:

Key Type Default Values
NotifyPosition string 'top-right' top-right, top-left, top, bottom, bottom-right, bottom-left, center-right, center-left
ProgressStyle string 'circle' circle or bar
TextUIPosition string 'left-center' left-center, right-center, top-center, bottom-center

Players can change their own look in /uisettings.

Custom provider in editable/client.lua

The value custom runs the functions of Editable.Custom in editable/client.lua. The default file uses the GTA feed and help text:

lua
function Editable.Custom.Notify(data)
    BeginTextCommandThefeedPost('STRING')
    AddTextComponentSubstringPlayerName(data.title and data.description and (data.title .. '~n~' .. data.description) or data.description or data.title or '')
    EndTextCommandThefeedPostTicker(false, true)
end

function Editable.Custom.Progress(opts)
    Wait(opts.duration or 3000)
    return true
end
Function Must do
Editable.Custom.Notify(data) Show data.title and data.description
Editable.Custom.Progress(opts) Block until done, return true when finished and false when cancelled
Editable.Custom.CancelProgress() Cancel the running progress
Editable.Custom.SkillCheck() Return true on success
Editable.Custom.ShowTextUI(text) / Editable.Custom.HideTextUI() Show and hide the prompt
Editable.Custom.Status(name) Return a status value (hunger, thirst ...) the bridge has no value for, or nil

Registering a provider from another resource

A resource can offer itself as a provider for notify, progress, skillcheck or textui with the client export RegisterProvider. It then shows in the Providers list as Registered by that resource with the value plugin:<name>, and disappears when the resource stops.

lua
exports.jcks_bridge:RegisterProvider('notify', 'my_notify', {
    label = 'My notify',
    notify = function(data)
        exports.my_notify:Show(data.title, data.description, data.type)
    end,
})
Kind Functions in the table
notify notify(data)
progress progress(opts) returning true or false, cancel()
skillcheck skillcheck(difficulty, inputs) returning true or false
textui show(text, icon), hide()

name takes letters, digits, _ and -. label is cut to 40 characters. exports.jcks_bridge:GetProvider(kind, resource?) returns the value that is used for a resource, the calling one by default.