mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 03:24:55 +02:00
fix messagebox and rename some stuff
This commit is contained in:
@@ -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
|
||||
|
@@ -9,7 +9,7 @@ local gameButtonsPanel
|
||||
-- private functions
|
||||
local function onLogout()
|
||||
if Game.isOnline() then
|
||||
Game.logout(false)
|
||||
Game.safeLogout()
|
||||
else
|
||||
exit()
|
||||
end
|
||||
|
@@ -3,3 +3,6 @@ Creature < UICreature
|
||||
padding: 1
|
||||
image-source: /core_styles/images/panel_flat.png
|
||||
image-border: 1
|
||||
|
||||
UIWidget
|
||||
id: lala
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user