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

13 lines
637 B
Lua
Raw Normal View History

2011-04-23 22:04:49 +02:00
function messageBox(title, text)
2011-05-01 20:47:35 +02:00
local messageBoxWindow = UI.load("modules/messagebox/messagebox.yml")
2011-04-23 22:04:49 +02:00
local messageBoxLabel = messageBoxWindow:getChildByID("messageBoxLabel")
local messageBoxOkButton = messageBoxWindow:getChildByID("messageBoxOkButton")
2011-05-01 20:47:35 +02:00
local uiRoot = UI.getRootContainer()
uiRoot:lock(messageBoxWindow)
messageBoxWindow:setTitle(title)
2011-04-23 22:04:49 +02:00
messageBoxLabel:setText(text)
2011-05-01 20:47:35 +02:00
--messageBoxWindow:setSize(messageBoxLabel:getSize() + Size{20, 20})
messageBoxWindow:setOnDestroy(function() uiRoot:unlock(self) end)
2011-04-23 22:04:49 +02:00
messageBoxOkButton:setOnClick(function() messageBoxWindow:destroy() end)
2011-05-01 20:47:35 +02:00
end