mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 19:44:54 +02:00
implement motd button
This commit is contained in:
@@ -16,6 +16,7 @@ end
|
||||
local function onMotd(protocol, motd)
|
||||
motdNumber = tonumber(string.sub(motd, 0, string.find(motd, "\n")))
|
||||
motdMessage = string.sub(motd, string.find(motd, "\n") + 1, string.len(motd))
|
||||
TopMenu.getButton('motdButton'):show()
|
||||
end
|
||||
|
||||
local function onCharacterList(protocol, characters, premDays)
|
||||
@@ -68,3 +69,7 @@ function EnterGame.doLogin()
|
||||
|
||||
protocolLogin:login(EnterGame.account, EnterGame.password)
|
||||
end
|
||||
|
||||
function EnterGame.displayMotd()
|
||||
displayInfoBox("Message of the day", motdMessage)
|
||||
end
|
||||
|
@@ -11,4 +11,8 @@ end
|
||||
function TopMenu.destroy()
|
||||
topMenu:destroy()
|
||||
topMenu = nil
|
||||
end
|
||||
|
||||
function TopMenu.getButton(id)
|
||||
return topMenu:getChildById(id)
|
||||
end
|
@@ -37,7 +37,8 @@ TopPanel
|
||||
margin.left: 6
|
||||
tooltip: Message of the day
|
||||
icon: /core_styles/icons/motd.png
|
||||
@onClick:
|
||||
visible: false
|
||||
@onClick: EnterGame.displayMotd()
|
||||
|
||||
TopButton
|
||||
anchors.top: parent.top
|
||||
|
Reference in New Issue
Block a user