rework and classic controls

This commit is contained in:
Henrique Santiago
2012-01-09 18:54:37 -02:00
parent 911584e816
commit 4de5e45d52
15 changed files with 94 additions and 90 deletions

View File

@@ -1,26 +1,5 @@
function UIMap:onMouseRelease(mousePos, mouseButton)
local tile = self:getTile(mousePos)
if not tile then return false end
local keyboardModifiers = g_window.getKeyboardModifiers()
if not Options.classicControl then
if keyboardModifiers == KeyboardNoModifier and mouseButton == MouseLeftButton then
-- auto walk
return true
elseif keyboardModifiers == KeyboardNoModifier and mouseButton == MouseRightButton then
Game.createThingMenu(mousePos, tile:getTopLookThing(), tile:getTopUseThing(), tile:getTopCreature())
return true
elseif keyboardModifiers == KeyboardShiftModifier and (mouseButton == MouseRightButton or mouseButton == MouseLeftButton) then
Game.look(tile:getTopLookThing())
return true
elseif keyboardModifiers == KeyboardCtrlModifier and (mouseButton == MouseRightButton or mouseButton == MouseLeftButton) then
Game.use(tile:getTopUseThing())
return true
elseif keyboardModifiers == KeyboardAltModifier and (mouseButton == MouseRightButton or mouseButton == MouseLeftButton) then
Game.attack(tile:getTopCreature())
return true
end
end
function UIMap:onMouseRelease(mousePosition, mouseButton)
local tile = self:getTile(mousePosition)
if tile and Game.processMouseAction(mousePosition, mouseButton, nil, tile:getTopLookThing(), tile:getTopUseThing(), tile:getTopCreature(), tile:getTopMultiUseThing()) then return true end
return false
end