fix motd box issues

This commit is contained in:
Eduardo Bart
2011-10-31 15:56:00 -02:00
parent e9d69b7980
commit 841769cc7d
4 changed files with 16 additions and 8 deletions

View File

@@ -75,7 +75,7 @@ function CharacterList.create(characters, premDays)
label.worldHost = worldHost
label.worldPort = worldIp
if i == 0 or Configs.get('lastUsedCharacter') == characterName then
if i == 1 or Configs.get('lastUsedCharacter') == characterName then
characterList:focusChild(label, ActiveFocusReason)
end
end

View File

@@ -4,6 +4,7 @@ EnterGame = { }
local password
local loadBox
local enterGameWindow
local hideCharlist = false
-- private functions
local function onError(protocol, error)
@@ -14,16 +15,24 @@ end
local function onMotd(protocol, motd)
loadBox:destroy()
local motdNumber = string.sub(motd, 0, string.find(motd, "\n"))
local motdNumber = tonumber(string.sub(motd, 0, string.find(motd, "\n")))
local motdMessage = string.sub(motd, string.find(motd, "\n") + 1, string.len(motd))
if motdNumber ~= Configs.get("motd") then
displayInfoBox("Message of the day", motdMessage)
if motdNumber ~= tonumber(Configs.get("motd")) then
hideCharlist = true
local motdBox = displayInfoBox("Message of the day", motdMessage)
motdBox.onOk = function()
CharacterList.show()
end
Configs.set("motd", motdNumber)
end
end
local function onCharacterList(protocol, characters, premDays)
CharacterList.create(characters, premDays)
if hideCharlist then
CharacterList.hide()
hideCharlist = false
end
end
-- public functions

View File

@@ -34,7 +34,6 @@ MainWindow
Account Status:
Free Account
font: helvetica-11px-bold
color: #33cc66
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: next.top