mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 03:24:55 +02:00
messagebox (not working yet)
This commit is contained in:
@@ -15,14 +15,14 @@ window#infoWindow:
|
||||
margin.left: 18
|
||||
|
||||
label#infoLabel:
|
||||
size: [208, 84]
|
||||
align: center
|
||||
text: |-
|
||||
OTClient
|
||||
Version 0.2.0
|
||||
Created by edubart
|
||||
anchors.left: parent.left
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.top: parent.top
|
||||
margin.top: 20
|
||||
|
||||
lineDecoration#bottomSeparator:
|
||||
size: [190,2]
|
||||
|
@@ -28,6 +28,7 @@ panel#background:
|
||||
anchors.top: parent.top
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
margin.top: 46
|
||||
onClick: messageBox("Error", "Not implemented yet")
|
||||
|
||||
button#optionsButton:
|
||||
text: Options
|
||||
|
12
data/modules/messagebox/messagebox.lua
Normal file
12
data/modules/messagebox/messagebox.lua
Normal file
@@ -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
|
18
data/modules/messagebox/messagebox.yml
Normal file
18
data/modules/messagebox/messagebox.yml
Normal file
@@ -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
|
Reference in New Issue
Block a user