Jump to content

[TEXT-UI] Změna text-ui z esx na ox


Freezysek

Recommended Posts

1) Verze
Půjdeme do esx_textui/TextUI.lua najdeme si  :

    exports['esx_textui']:showTextUI(message)


Následně esx_textui nahradíme ox_lib :

 

    exports['ox_lib']:showTextUI(message)
Taktéž by to mělo vypadat i u hideTextUI :

 

   exports['ox_lib']:hideTextUI()

2) Verze

Půjdeme do esx_textui/TextUI.lua najdeme si :

    SendNUIMessage({
        action = 'show',
        message = message and message or 'ESX-TextUI',
        type = type(typ) == "string" and typ or 'info'
    })


Následně toto celé vymažeme a nahradíme :
 

    exports['ox_lib']:showTextUI(message)

 

Taktéž by to mělo vypadat i u hideTextUI :
 

   exports['ox_lib']:hideTextUI()

 

  • Like 1
Link to comment
Share on other sites

  • 2 months later...

Debug = ESX.GetConfig().EnableDebug
local isShowing = false
---@param message string
---@param typ string
local function TextUI(message, typ)
    isShowing = true
    exports['ox_lib']:showTextUI(message)
end

local function HideUI()
   if not isShowing then return end
   isShowing = false
    exports['ox_lib']:hideTextUI()
end

exports['ox_lib']:showTextUI(message)
exports['ox_lib']:hideTextUI()
RegisterNetEvent('esx:showTextUI', TextUI)
RegisterNetEvent('esx:hideTextUI', HideUI)

if Debug then
    RegisterCommand("textui:error", function()
        ESX.TextUI("i ~r~love~s~ donuts", "error")
    end)

    RegisterCommand("textui:success", function()
        ESX.TextUI("i ~g~love~s~ donuts", "success")
    end)

    RegisterCommand("textui:info", function()
        ESX.TextUI("i ~b~love~s~ donuts", "info")
    end)

    RegisterCommand("textui:hide", function()
        ESX.HideUI()
    end)
end



Mám to takhle ale nejde to bejku

Link to comment
Share on other sites

  • 7 months later...
Debug = ESX.GetConfig().EnableDebug
local isShowing = false
---@param message string
---@param typ string
local function TextUI(message, typ)
    isShowing = true
    exports['ox_lib']:showTextUI(message)
end
 
local function HideUI()
    if not isShowing then return end
    isShowing = false
    exports['ox_lib']:hideTextUI()
end
 
exports('TextUI', TextUI)
exports('HideUI', HideUI)
RegisterNetEvent('ESX:TextUI', TextUI)
RegisterNetEvent('ESX:HideUI', HideUI)
 
if Debug then
    RegisterCommand("textui:error", function()
        ESX.TextUI("i ~r~love~s~ donuts", "error")
    end)
 
    RegisterCommand("textui:success", function()
        ESX.TextUI("i ~g~love~s~ donuts", "success")
    end)
 
    RegisterCommand("textui:info", function()
        ESX.TextUI("i ~b~love~s~ donuts", "info")
    end)
 
    RegisterCommand("textui:hide", function()
        ESX.HideUI()
    end)
end
 
Quote

Takhle to nádherně funguje

 

Edited by Logerys
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...