@ -104,8 +104,8 @@ function bindKeys()
g_keyboard.bindKeyPress ( ' Escape ' , function ( ) g_game.cancelAttackAndFollow ( ) end , gameRootPanel )
g_keyboard.bindKeyPress ( ' Escape ' , function ( ) g_game.cancelAttackAndFollow ( ) end , gameRootPanel )
g_keyboard.bindKeyPress ( ' Ctrl+= ' , function ( ) gameMapPanel : zoomIn ( ) end , gameRootPanel )
g_keyboard.bindKeyPress ( ' Ctrl+= ' , function ( ) gameMapPanel : zoomIn ( ) end , gameRootPanel )
g_keyboard.bindKeyPress ( ' Ctrl+- ' , function ( ) gameMapPanel : zoomOut ( ) end , gameRootPanel )
g_keyboard.bindKeyPress ( ' Ctrl+- ' , function ( ) gameMapPanel : zoomOut ( ) end , gameRootPanel )
g_keyboard.bindKeyDown ( ' Ctrl+Q ' , l ogout, gameRootPanel )
g_keyboard.bindKeyDown ( ' Ctrl+Q ' , tryL ogout, gameRootPanel )
g_keyboard.bindKeyDown ( ' Ctrl+L ' , l ogout, gameRootPanel )
g_keyboard.bindKeyDown ( ' Ctrl+L ' , tryL ogout, gameRootPanel )
g_keyboard.bindKeyDown ( ' Ctrl+W ' , function ( ) g_map.cleanTexts ( ) modules.game_textmessage . clearMessages ( ) end , gameRootPanel )
g_keyboard.bindKeyDown ( ' Ctrl+W ' , function ( ) g_map.cleanTexts ( ) modules.game_textmessage . clearMessages ( ) end , gameRootPanel )
g_keyboard.bindKeyDown ( ' Ctrl+. ' , nextViewMode , gameRootPanel )
g_keyboard.bindKeyDown ( ' Ctrl+. ' , nextViewMode , gameRootPanel )
end
end
@ -215,8 +215,8 @@ function tryExit()
return true
return true
end
end
local exitFunc = function ( ) l ogout( ) forceExit ( ) end
local exitFunc = function ( ) g_game.safeL ogout( ) forceExit ( ) end
local logoutFunc = function ( ) l ogout( ) exitWindow : destroy ( ) exitWindow = nil end
local logoutFunc = function ( ) g_game.safeL ogout( ) exitWindow : destroy ( ) exitWindow = nil end
local cancelFunc = function ( ) exitWindow : destroy ( ) exitWindow = nil end
local cancelFunc = function ( ) exitWindow : destroy ( ) exitWindow = nil end
exitWindow = displayGeneralBox ( tr ( ' Exit ' ) , tr ( " If you shut down the program, your character might stay in the game. \n Click on 'Logout' to ensure that you character leaves the game properly. \n Click on 'Exit' if you want to exit the program without logging out your character. " ) ,
exitWindow = displayGeneralBox ( tr ( ' Exit ' ) , tr ( " If you shut down the program, your character might stay in the game. \n Click on 'Logout' to ensure that you character leaves the game properly. \n Click on 'Exit' if you want to exit the program without logging out your character. " ) ,
@ -228,13 +228,6 @@ function tryExit()
return true
return true
end
end
function logout ( )
if g_game.isOnline ( ) then
g_game.safeLogout ( )
return true
end
end
function tryLogout ( )
function tryLogout ( )
if not g_game.isOnline ( ) then
if not g_game.isOnline ( ) then
exit ( )
exit ( )
@ -245,13 +238,33 @@ function tryLogout()
return
return
end
end
local yesCallback = function ( ) logout ( ) logoutWindow : destroy ( ) logoutWindow = nil end
if not g_game.isConnectionOk ( ) then
local noCallback = function ( ) logoutWindow : destroy ( ) logoutWindow = nil end
local yesCallback = function ( )
g_game.forceLogout ( )
logoutWindow = nil
end
local noCallback = function ( )
logoutWindow = nil
end
logoutWindow = displayGeneralBox ( tr ( ' Logout ' ) , tr ( ' Your connection is failing, if you logout now your character will be still online, do you want to force logout? ' ) , {
{ text = tr ( ' Yes ' ) , callback = yesCallback } ,
{ text = tr ( ' No ' ) , callback = noCallback } ,
anchor = AnchorHorizontalCenter } , yesCallback , noCallback )
else
local yesCallback = function ( )
g_game.safeLogout ( )
logoutWindow = nil
end
local noCallback = function ( )
logoutWindow = nil
end
logoutWindow = displayGeneralBox ( tr ( ' Logout ' ) , tr ( ' Are you sure you want to logout? ' ) , {
logoutWindow = displayGeneralBox ( tr ( ' Logout ' ) , tr ( ' Are you sure you want to logout? ' ) , {
{ text = tr ( ' Yes ' ) , callback = yesCallback } ,
{ text = tr ( ' Yes ' ) , callback = yesCallback } ,
{ text = tr ( ' No ' ) , callback = noCallback } ,
{ text = tr ( ' No ' ) , callback = noCallback } ,
anchor = AnchorHorizontalCenter } , yesCallback , noCallback )
anchor = AnchorHorizontalCenter } , yesCallback , noCallback )
end
end
end
function stopSmartWalk ( )
function stopSmartWalk ( )