more fixes

* add default key combos to Hotkeys
* impement moving countable items holding Ctrl or Shift
* fix messagebox incorrent size
* implement API in Keyboard to get modifiers key states
* minor UI layout fixes
* add Ctrl+L logout hotkey
This commit is contained in:
Eduardo Bart
2012-06-07 09:25:41 -03:00
parent 486837a61d
commit 066ffead08
7 changed files with 39 additions and 6 deletions

View File

@@ -52,6 +52,7 @@ function GameInterface.init()
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)
Keyboard.bindKeyDown('Ctrl+L', GameInterface.tryLogout, gameRootPanel)
if g_game.isOnline() then
GameInterface.show()
@@ -280,7 +281,7 @@ function GameInterface.createThingMenu(menuPosition, lookThing, useThing, creatu
end
function GameInterface.processMouseAction(menuPosition, mouseButton, autoWalk, lookThing, useThing, creatureThing, multiUseThing)
local keyboardModifiers = g_window.getKeyboardModifiers()
local keyboardModifiers = Keyboard.getModifiers()
if autoWalk and keyboardModifiers == KeyboardNoModifier and mouseButton == MouseLeftButton then
-- todo auto walk
@@ -351,8 +352,15 @@ function GameInterface.processMouseAction(menuPosition, mouseButton, autoWalk, l
end
function GameInterface.moveStackableItem(item, toPos)
local count = item:getCount()
if Keyboard.isCtrlPressed() then
g_game.move(item, toPos, item:getCount())
return
elseif Keyboard.isShiftPressed() then
g_game.move(item, toPos, 1)
return
end
local count = item:getCount()
local countWindow = createWidget('CountWindow', rootWidget)
local spinbox = countWindow:getChildById('countSpinBox')
local scrollbar = countWindow:getChildById('countScrollBar')