mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 03:24:55 +02:00
scripting rework
This commit is contained in:
@@ -16,6 +16,6 @@ end
|
||||
-- here is where everything starts
|
||||
if not initialStateLoaded then
|
||||
onEnterMenuState()
|
||||
App.setOnClose(onApplicationClose)
|
||||
App.onClose = onApplicationClose
|
||||
initialStateLoaded = true
|
||||
end
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user