mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 20:14:54 +02:00
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:
@@ -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
|
||||
|
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user