tibia-client/data/modules/messagebox/messagebox.lua

13 lines
637 B
Lua

function messageBox(title, text)
local messageBoxWindow = UI.load("modules/messagebox/messagebox.yml")
local messageBoxLabel = messageBoxWindow:getChildByID("messageBoxLabel")
local messageBoxOkButton = messageBoxWindow:getChildByID("messageBoxOkButton")
local uiRoot = UI.getRootContainer()
uiRoot:lock(messageBoxWindow)
messageBoxWindow:setTitle(title)
messageBoxLabel:setText(text)
--messageBoxWindow:setSize(messageBoxLabel:getSize() + Size{20, 20})
messageBoxWindow:setOnDestroy(function() uiRoot:unlock(self) end)
messageBoxOkButton:setOnClick(function() messageBoxWindow:destroy() end)
end