mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 19:44:54 +02:00
more scripting features (dynamic fields)
This commit is contained in:
@@ -3,8 +3,7 @@ window#enterGameWindow:
|
||||
size: [236, 178]
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
onLoad: self:getParent():lock(self)
|
||||
onDestroy: self:getParent():unlock(self)
|
||||
onLoad: self.locked = true
|
||||
|
||||
label#accountNameLabel:
|
||||
text: Account name
|
||||
@@ -52,7 +51,7 @@ window#enterGameWindow:
|
||||
anchors.bottom: parent.bottom
|
||||
margin.bottom: 10
|
||||
margin.right: 13
|
||||
onClick: self:getParent():destroy()
|
||||
onClick: self.parent:destroy()
|
||||
|
||||
textEdit#accountNameTextEdit:
|
||||
anchors.right: parent.right
|
||||
|
@@ -3,8 +3,7 @@ window#infoWindow:
|
||||
size: [244, 221]
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
onLoad: self:getParent():lock(self)
|
||||
onDestroy: self:getParent():unlock(self)
|
||||
onLoad: self.locked = true
|
||||
|
||||
panel#infoPanel:
|
||||
skin: flatPanel
|
||||
@@ -60,4 +59,4 @@ window#infoWindow:
|
||||
anchors.top: parent.top
|
||||
margin.top: 191
|
||||
margin.left: 188
|
||||
onClick: self:getParent():destroy()
|
||||
onClick: self.parent:destroy()
|
||||
|
@@ -49,4 +49,4 @@ panel#background:
|
||||
anchors.top: parent.top
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
margin.top: 136
|
||||
onClick: App.exit()
|
||||
onClick: onApplicationClose()
|
||||
|
@@ -5,11 +5,12 @@ end
|
||||
|
||||
function onLeaveMenuState()
|
||||
mainMenu:destroy()
|
||||
mainMenu = nil
|
||||
end
|
||||
|
||||
function onApplicationClose()
|
||||
onLeaveMenuState()
|
||||
exitGame()
|
||||
App.exit()
|
||||
end
|
||||
|
||||
-- here is where everything starts
|
||||
|
@@ -3,8 +3,7 @@ window#optionsWindow:
|
||||
size: [286, 262]
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
onLoad: self:getParent():lock(self)
|
||||
onDestroy: self:getParent():unlock(self)
|
||||
onLoad: self.locked = true
|
||||
|
||||
# general
|
||||
button#generalButton:
|
||||
@@ -111,4 +110,4 @@ window#optionsWindow:
|
||||
anchors.bottom: parent.bottom
|
||||
margin.right: 10
|
||||
margin.bottom: 13
|
||||
onClick: self:getParent():destroy()
|
||||
onClick: self.parent:destroy()
|
||||
|
@@ -1,12 +1,11 @@
|
||||
function messageBox(title, text)
|
||||
local messageBoxWindow = UI.load("modules/messagebox/messagebox.yml")
|
||||
local messageBoxLabel = messageBoxWindow:getChildByID("messageBoxLabel")
|
||||
local messageBoxOkButton = messageBoxWindow:getChildByID("messageBoxOkButton")
|
||||
local uiRoot = UI.getRootContainer()
|
||||
uiRoot:lock(messageBoxWindow)
|
||||
messageBoxWindow:setTitle(title)
|
||||
messageBoxLabel:setText(text)
|
||||
local messageBoxLabel = messageBoxWindow:getChildById("messageBoxLabel")
|
||||
local messageBoxOkButton = messageBoxWindow:getChildById("messageBoxOkButton")
|
||||
messageBoxWindow.locked = true
|
||||
messageBoxWindow.title = title
|
||||
messageBoxLabel.text = text
|
||||
--messageBoxWindow:setSize(messageBoxLabel:getSize() + Size{20, 20})
|
||||
messageBoxWindow:setOnDestroy(function() uiRoot:unlock(self) end)
|
||||
messageBoxOkButton:setOnClick(function() messageBoxWindow:destroy() end)
|
||||
messageBoxWindow.onDestroy = function() self.locked = false end
|
||||
messageBoxOkButton.onClick = function() messageBoxWindow:destroy() end
|
||||
end
|
||||
|
Reference in New Issue
Block a user