Some fixes in hotkeys and other improvements

* Save last logged character and world instead of character name
* Make focused label always visible in character list and hotkeys
* Other fixes in hotkeys
This commit is contained in:
Eduardo Bart
2013-01-28 16:33:10 -02:00
parent 197a379933
commit d6e8e92a45
9 changed files with 64 additions and 34 deletions

View File

@@ -38,7 +38,8 @@ local function tryLogin(charInfo, tries)
end })
-- save last used character
g_settings.set('lastUsedCharacter', charInfo.characterName)
g_settings.set('last-used-character', charInfo.characterName)
g_settings.set('last-used-world', charInfo.worldName)
end
local function updateWait(timeStart, timeEnd)
@@ -224,12 +225,15 @@ function CharacterList.create(characters, account, otui)
connect(widget, { onDoubleClick = function () CharacterList.doLogin() return true end } )
if i == 1 or g_settings.get('lastUsedCharacter') == widget.characterName then
if i == 1 or (g_settings.get('last-used-character') == widget.characterName and g_settings.get('last-used-world') == widget.worldName) then
focusLabel = widget
end
end
characterList:focusChild(focusLabel, ActiveFocusReason)
if focusLabel then
characterList:focusChild(focusLabel, KeyboardFocusReason)
addEvent(function() characterList:ensureChildVisible(focusLabel) end)
end
-- account
if account.premDays > 0 and account.premDays < 65535 then

View File

@@ -62,10 +62,13 @@ local function onUpdateNeeded(protocol, signature)
loadBox:destroy()
loadBox = nil
if updateFunc then
if EnterGame.updateFunc then
local continueFunc = EnterGame.show
local cancelFunc = EnterGame.show
updateFunc(signature, continueFunc, cancelFunc)
EnterGame.updateFunc(signature, continueFunc, cancelFunc)
else
local errorBox = displayErrorBox(tr('Update needed'), tr('Your client needs update, try redownloading it.'))
connect(errorBox, { onOk = EnterGame.show })
end
end