mirror of
https://github.com/edubart/otclient.git
synced 2025-10-24 00:05:02 +02:00
messagebox (not working yet)
This commit is contained in:
12
data/modules/messagebox/messagebox.lua
Normal file
12
data/modules/messagebox/messagebox.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
function messageBox(title, text)
|
||||
local messageBoxWindow = loadUI("modules/messagebox/messagebox.yml")
|
||||
local messageBoxLabel = messageBoxWindow:getChildByID("messageBoxLabel")
|
||||
local messageBoxOkButton = messageBoxWindow:getChildByID("messageBoxOkButton")
|
||||
local uiRoot = messageBoxWindow:getParent()
|
||||
uiRoot:lock(messageBox)
|
||||
messageBoxWindow:setTitle(text)
|
||||
messageBoxLabel:setText(text)
|
||||
messageBoxWindow:setSize(messageBoxLabel:getSize() + Size{20, 20})
|
||||
messageBox:setOnDestroy(function() uiRoot:unlock() end)
|
||||
messageBoxOkButton:setOnClick(function() messageBoxWindow:destroy() end)
|
||||
end
|
||||
Reference in New Issue
Block a user