scripting rework

This commit is contained in:
Eduardo Bart
2011-05-02 19:48:41 -03:00
parent f290b4f89c
commit c052723477
24 changed files with 622 additions and 375 deletions

View File

@@ -16,6 +16,6 @@ end
-- here is where everything starts
if not initialStateLoaded then
onEnterMenuState()
App.setOnClose(onApplicationClose)
App.onClose = onApplicationClose
initialStateLoaded = true
end

View File

@@ -1,9 +1,11 @@
function messageBox(title, text)
local msgbox = UI.load("modules/messagebox/messagebox.yml")
local label = msgbox:getChildById("messageBoxLabel")
local okButton = msgbox:getChildById("messageBoxOkButton")
msgbox.locked = true
msgbox.title = title
label.text = text
okButton.onClick = function() msgbox:destroy() end
function autoDestroyParent()
self.parent:destroy()
end
function messageBox(title, text)
local msgBox = UI.load("modules/messagebox/messagebox.yml")
msgBox.locked = true
msgBox.title = title
msgBox:child("textLabel").text = text
msgBox:child("okButton").onClick = autoDestroyParent
end

View File

@@ -4,12 +4,12 @@ window#messageBoxWindow:
anchors.verticalCenter: parent.verticalCenter
label#messageBoxLabel:
label#textLabel:
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
margin.top: 27
button#messageBoxOkButton:
button#okButton:
text: Ok
size: [43, 20]
anchors.right: parent.right