> For the complete documentation index, see [llms.txt](https://docs.brutalscripts.com/site/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.brutalscripts.com/site/scripts/text-ui/integrations.md).

# Integrations

## QBCore DrawText to Brutal TextUI

Change the following code in **qb-core/client/drawtext.lua**:

```lua
local function hideText()
    exports['brutal_textui']:Close()
end

local function drawText(text, _)
    exports['brutal_textui']:Open(text, "blue")
end

-- local function changeText(text, position) -- Can't use
--     if type(position) ~= "string" then position = "left" end

--     SendNUIMessage({
--         action = 'CHANGE_TEXT',
--         data = {
--             text = text,
--             position = position
--         }
--     })
-- end

local function keyPressed()
    CreateThread(function() -- Can't use
        --[[ SendNUIMessage({
            action = 'KEY_PRESSED',
        }) ]]
        --Wait(500)
        hideText()
    end)
end

RegisterNetEvent('qb-core:client:DrawText', function(text, position)
    drawText(text, position)
end)

-- RegisterNetEvent('qb-core:client:ChangeText', function(text, position) -- Can't use
--     changeText(text, position)
-- end)

RegisterNetEvent('qb-core:client:HideText', function()
    hideText()
end)

-- RegisterNetEvent('qb-core:client:KeyPressed', function() -- Can't use
--     keyPressed()
-- end)

exports('DrawText', drawText)
--exports('ChangeText', changeText) -- Can't use
exports('HideText', hideText)
exports('KeyPressed', keyPressed) -- Can't use
```

## ESX.TextUI to Brutal TextUI

Navigate to es\_extended/client/functions.lua and edit the following functions:

```lua
function ESX.TextUI(message, type)
    if type == 'info' then
        type = "blue"
    elseif type == 'success' then
        type = "green"
    elseif type == 'error' then
        type = "red"
    else 
        type = 'gray'
    end

    exports['brutal_textui']:Open(message, type)
end

function ESX.HideUI()
    exports['brutal_textui']:Close()
end
```

## Ox\_lib to Brutal TextUI

Navigate to ox\_lib/resource/interface/client/textui.lua and edit the following functions:

```lua
function lib.showTextUI(text, options)
    if currentText == text then return end

    if not options then options = {} end

    options.text = text
    currentText = text

    exports['brutal_textui']:Open(text, "blue")

    --SendNUIMessage({
        --action = 'textUi',
       -- data = options
   -- })

    isOpen = true
end

function lib.hideTextUI()
    --SendNUIMessage({
       -- action = 'textUiHide'
    --})

    exports['brutal_textui']:Close()

    isOpen = false
    currentText = nil
end
```
