scripting and UI improvements

This commit is contained in:
Eduardo Bart
2011-05-01 15:47:35 -03:00
parent 3960240b8e
commit 32a8ed3871
23 changed files with 424 additions and 293 deletions

View File

@@ -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

View File

@@ -3,7 +3,7 @@ window#messageBoxWindow:
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
label#messageBoxLabel:
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top