Modules
Dui
Lua
Client

Cliente

Criação simples e centralizada de DUIs, suportando envio de mensagens, alteração de URL e remoção.

lib.dui:new

Constrói uma instância de Dui.

lib.dui:new(data)
  • data: table
    • url: string
    • width: number
    • height: number
    • debug?: boolean

Retorna:

  • dui: Dui
    • url: string
    • duiObject: number
    • duiHandle: string
    • runtimeTxd: number
    • txdObject: number
    • dictName: string
    • txtName: string
    • setUrl: function(url: string)
    • sendMessage: function(data: table)
    • remove: function

Exemplo de Uso

local dui = lib.dui:new({
    url = ("nui://%s/web/index.html"):format(cache.resource),
    width = 1920,
    height = 1080,
    debug = true
})
 
-- Alterar URL
dui:setUrl("https://google.com")
 
-- Enviar mensagem
dui:sendMessage({
    action = "display",
    value = true
})
 
-- Remover
dui:remove()