implement motd button

This commit is contained in:
Eduardo Bart
2011-11-16 16:08:42 -02:00
parent c584426f24
commit 4341bf91a6
4 changed files with 32 additions and 49 deletions

View File

@@ -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

View File

@@ -11,4 +11,8 @@ end
function TopMenu.destroy()
topMenu:destroy()
topMenu = nil
end
function TopMenu.getButton(id)
return topMenu:getChildById(id)
end

View File

@@ -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