Some changes to charlist

This commit is contained in:
Henrique Santiago 2012-08-07 17:55:05 -03:00
parent 4919bdf1bc
commit 26c682c0dc
2 changed files with 11 additions and 9 deletions

View File

@ -191,17 +191,17 @@ function CharacterList.create(characters, premDays)
local focusLabel local focusLabel
for i,characterInfo in ipairs(characters) do for i,characterInfo in ipairs(characters) do
local characterName = characterInfo[1] local characterName = characterInfo.name
local worldName = characterInfo[2] local worldName = characterInfo.worldName
local worldHost = characterInfo[3] local worldHost = characterInfo.worldIp
local worldIp = characterInfo[4] local worldPort = characterInfo.worldPort
local label = g_ui.createWidget('CharacterListLabel', characterList) local label = g_ui.createWidget('CharacterListLabel', characterList)
label:setText(characterName .. ' (' .. worldName .. ')') label:setText(characterName .. ' (' .. worldName .. ')')
label:setPhantom(false) label:setPhantom(false)
label.characterName = characterName label.characterName = characterName
label.worldHost = worldHost label.worldHost = worldHost
label.worldPort = worldIp label.worldPort = worldPort
connect(label, { onDoubleClick = function () CharacterList.doLogin() return true end } ) connect(label, { onDoubleClick = function () CharacterList.doLogin() return true end } )
@ -214,6 +214,8 @@ function CharacterList.create(characters, premDays)
if premDays > 0 then if premDays > 0 then
accountStatusLabel:setText(tr("Account Status:\nPremium Account (%s) days left", premDays)) accountStatusLabel:setText(tr("Account Status:\nPremium Account (%s) days left", premDays))
else
accountStatusLabel:setText(tr('Account Status:\nFree Account'))
end end
end end

View File

@ -109,10 +109,10 @@ function ProtocolLogin:parseCharacterList(msg)
local charactersCount = msg:getU8() local charactersCount = msg:getU8()
for i=1,charactersCount do for i=1,charactersCount do
local character = {} local character = {}
character[1] = msg:getString() character.name = msg:getString()
character[2] = msg:getString() character.worldName = msg:getString()
character[3] = iptostring(msg:getU32()) character.worldIp = iptostring(msg:getU32())
character[4] = msg:getU16() character.worldPort = msg:getU16()
characters[i] = character characters[i] = character
end end
local premDays = msg:getU16() local premDays = msg:getU16()