From 7526315d123c4fc57e7badaca0bb95844c4c43ac Mon Sep 17 00:00:00 2001 From: Eduardo Bart Date: Tue, 24 Apr 2012 09:14:03 -0300 Subject: [PATCH] new shortcuts * Ctrl+Q logout from game * Ctrl+Shift+R reload scripts, instead of Ctrl+R that is now reserved for rule report * Ctrl+A clean the chat text box * Ctrl+F toggles fullscreen mode --- modules/client_options/options.lua | 5 +++++ modules/game/gameinterface.lua | 1 + modules/game_console/console.lua | 1 + modules/otclientrc.lua | 2 +- 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/client_options/options.lua b/modules/client_options/options.lua index 0219fd91..866ed752 100644 --- a/modules/client_options/options.lua +++ b/modules/client_options/options.lua @@ -24,6 +24,7 @@ function Options.init() end Keyboard.bindKeyDown('Ctrl+P', Options.toggle) + Keyboard.bindKeyDown('Ctrl+F', function() Options.toggleOption('fullscreen') end) optionsWindow = displayUI('options.otui') optionsWindow:hide() @@ -66,6 +67,10 @@ function Options.openWebpage() displayErrorBox("Error", "Not implemented yet") end +function Options.toggleOption(key) + Options.setOption(key, not Options.getOption(key)) +end + function Options.setOption(key, value) if key == 'vsync' then g_window.setVerticalSync(value) diff --git a/modules/game/gameinterface.lua b/modules/game/gameinterface.lua index b1dc4ae7..a6a16439 100644 --- a/modules/game/gameinterface.lua +++ b/modules/game/gameinterface.lua @@ -51,6 +51,7 @@ function GameInterface.init() Keyboard.bindKeyPress('Escape', function() g_game.cancelAttackAndFollow() end, gameRootPanel, WALK_AUTO_REPEAT_DELAY) Keyboard.bindKeyPress('Ctrl+=', function() gameMapPanel:zoomIn() end, gameRootPanel, 250) Keyboard.bindKeyPress('Ctrl+-', function() gameMapPanel:zoomOut() end, gameRootPanel, 250) + Keyboard.bindKeyDown('Ctrl+Q', GameInterface.tryLogout, gameRootPanel) if g_game.isOnline() then GameInterface.show() diff --git a/modules/game_console/console.lua b/modules/game_console/console.lua index 58233bfa..c61ec458 100644 --- a/modules/game_console/console.lua +++ b/modules/game_console/console.lua @@ -202,6 +202,7 @@ function Console.init() Keyboard.bindKeyPress('Tab', function() consoleTabBar:selectNextTab() end, consolePanel) Keyboard.bindKeyPress('Shift+Tab', function() consoleTabBar:selectPrevTab() end, consolePanel) Keyboard.bindKeyDown('Enter', Console.sendCurrentMessage, consolePanel) + Keyboard.bindKeyPress('Ctrl+A', function() consoleTextEdit:clearText() end, consolePanel) -- apply buttom functions after loaded consolePanel:getChildById('nextChannelButton').onClick = function() consoleTabBar:selectNextTab() end diff --git a/modules/otclientrc.lua b/modules/otclientrc.lua index b34c2855..fa1b37dd 100644 --- a/modules/otclientrc.lua +++ b/modules/otclientrc.lua @@ -1,4 +1,4 @@ -- this file is loaded after all modules are loaded and initialized -- you can place any custom user code here -Keyboard.bindKeyDown('Ctrl+R', Client.reloadScripts) \ No newline at end of file +Keyboard.bindKeyDown('Ctrl+Shift+R', Client.reloadScripts) \ No newline at end of file