parent
a98f1d67db
commit
3960240b8e
@ -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
|
@ -0,0 +1,18 @@
|
|||||||
|
window#messageBoxWindow:
|
||||||
|
size: [236, 78]
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
|
|
||||||
|
label#messageBoxLabel:
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
anchors.top: parent.top
|
||||||
|
margin.top: 27
|
||||||
|
|
||||||
|
button#messageBoxOkButton:
|
||||||
|
text: Ok
|
||||||
|
size: [43, 20]
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
margin.bottom: 10
|
||||||
|
margin.right: 10
|
Loading…
Reference in new issue