mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 12:04:55 +02:00
scripting and UI improvements
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
function messageBox(title, text)
|
||||
local messageBoxWindow = loadUI("modules/messagebox/messagebox.yml")
|
||||
local messageBoxWindow = UI.load("modules/messagebox/messagebox.yml")
|
||||
local messageBoxLabel = messageBoxWindow:getChildByID("messageBoxLabel")
|
||||
local messageBoxOkButton = messageBoxWindow:getChildByID("messageBoxOkButton")
|
||||
local uiRoot = messageBoxWindow:getParent()
|
||||
uiRoot:lock(messageBox)
|
||||
messageBoxWindow:setTitle(text)
|
||||
local uiRoot = UI.getRootContainer()
|
||||
uiRoot:lock(messageBoxWindow)
|
||||
messageBoxWindow:setTitle(title)
|
||||
messageBoxLabel:setText(text)
|
||||
messageBoxWindow:setSize(messageBoxLabel:getSize() + Size{20, 20})
|
||||
messageBox:setOnDestroy(function() uiRoot:unlock() end)
|
||||
--messageBoxWindow:setSize(messageBoxLabel:getSize() + Size{20, 20})
|
||||
messageBoxWindow:setOnDestroy(function() uiRoot:unlock(self) end)
|
||||
messageBoxOkButton:setOnClick(function() messageBoxWindow:destroy() end)
|
||||
end
|
||||
end
|
||||
|
@@ -3,7 +3,7 @@ window#messageBoxWindow:
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
|
||||
|
||||
label#messageBoxLabel:
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.top: parent.top
|
||||
|
Reference in New Issue
Block a user