fix messagebox and rename some stuff

This commit is contained in:
Eduardo Bart
2012-02-08 00:11:57 -02:00
parent 619f751371
commit 1013ae279b
11 changed files with 39 additions and 26 deletions

View File

@@ -29,7 +29,7 @@ local function tryLogin(charInfo, tries)
end
if Game.isOnline() then
Game.logout(false)
Game.safeLogout()
if tries == 1 then
loadBox = displayCancelBox('Please wait', 'Loggin out...')
end

View File

@@ -9,7 +9,7 @@ local gameButtonsPanel
-- private functions
local function onLogout()
if Game.isOnline() then
Game.logout(false)
Game.safeLogout()
else
exit()
end

View File

@@ -3,3 +3,6 @@ Creature < UICreature
padding: 1
image-source: /core_styles/images/panel_flat.png
image-border: 1
UIWidget
id: lala

View File

@@ -26,14 +26,15 @@ function UIMessageBox.display(title, message, flags)
if flags == MessageBoxOk then
buttonRight:setText('Ok')
connect(buttonRight, { onClick = function(self) self:getParent():ok() end })
connect(messagebox, { onEnter = function(self) self:ok() end })
connect(messagebox, { onEscape = function(self) self:ok() end })
elseif flags == MessageBoxCancel then
buttonRight:setText('Cancel')
connect(buttonRight, { onClick = function(self) self:getParent():cancel() end })
connect(messagebox, { onEnter = function(self) self:cancel() end })
connect(messagebox, { onEscape = function(self) self:cancel() end })
end
connect(messagebox, { onEnter = function(self) self:destroy() end })
connect(messagebox, { onEscape = function(self) self:destroy() end })
messagebox:lock()
return messagebox

View File

@@ -8,7 +8,7 @@ local function onGameKeyPress(self, keyCode, keyboardModifiers)
CharacterList.show()
return true
elseif keyCode == KeyQ then
Game.logout(false)
Game.safeLogout()
return true
end
end
@@ -101,7 +101,7 @@ end
local function onApplicationClose()
if Game.isOnline() then
Game.logout(true)
Game.forceLogout()
else
exit()
end