You can add additional resources to cover also if required.
Shows chosen drawtext UI on screen.
local function show_drawtext(options)
if not options or not options.message then debug_log('err', 'Invalid drawtext data provided') return end
if DRAWTEXT == 'boii_ui' then
exports.boii_ui:show_drawtext(options.header, options.message, options.icon)
elseif DRAWTEXT == 'ox_lib' then
lib.showTextUI(options.message, { icon = options.icon })
elseif DRAWTEXT == 'qb-core' then
exports['qb-core']:DrawText(options.message)
elseif DRAWTEXT == 'es_extended' then
exports.es_extended:TextUI(options.message)
elseif DRAWTEXT == 'okokTextUI' then
exports['okokTextUI']:Open(options.message, 'lightgrey', 'left', true)
elseif DRAWTEXT == 'custom' then
--- Add custom implementation here
else
exports.boii_ui:show_drawtext(options.header, options.message, options.icon)
end
end
exports('ui_show_drawtext', show_drawtext)
utils.ui.show_drawtext = show_drawtext
--- Show drawtext.
utils.ui.show_drawtext({
header = 'Test Drawtext',
message = 'Test message..',
icon = 'fa-solid fa-gear'
})
Hides chosen drawtext UI on screen.
local function hide_drawtext()
if DRAWTEXT == 'boii_ui' then
exports.boii_ui:hide_drawtext()
elseif DRAWTEXT == 'ox_lib' then
lib.hideTextUI()
elseif DRAWTEXT == 'qb-core' then
exports['qb-core']:HideText()
elseif DRAWTEXT == 'es_extended' then
exports.es_extended:HideUI()
elseif DRAWTEXT == 'okokTextUI' then
exports['okokTextUI']:Close()
elseif DRAWTEXT == 'custom' then
--- Add custom implementation here
else
exports.boii_ui:hide_drawtext()
end
end
exports('ui_hide_drawtext', hide_drawtext)
utils.ui.hide_drawtext = hide_drawtext
--- Hide drawtext.
utils.ui.hide_drawtext()