tibia-client/modules/game/map.lua

27 lines
1.1 KiB
Lua
Raw Normal View History

2012-01-09 19:51:11 +01:00
function UIMap:onMouseRelease(mousePos, mouseButton)
2012-01-09 19:06:16 +01:00
local tile = self:getTile(mousePos)
if not tile then return false end
2012-01-09 20:00:53 +01:00
2012-01-09 19:51:11 +01:00
local keyboardModifiers = g_window.getKeyboardModifiers()
2012-01-09 19:06:16 +01:00
if not Options.classicControl then
2012-01-09 19:51:11 +01:00
if keyboardModifiers == KeyboardNoModifier and mouseButton == MouseLeftButton then
-- auto walk
return true
elseif keyboardModifiers == KeyboardNoModifier and mouseButton == MouseRightButton then
2012-01-09 19:06:16 +01:00
Game.createThingMenu(mousePos, tile:getTopLookThing(), tile:getTopUseThing(), tile:getTopCreature())
return true
2012-01-09 19:51:11 +01:00
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
2012-01-09 19:06:16 +01:00
end
end
2012-01-09 20:00:53 +01:00
2012-01-09 19:06:16 +01:00
return false
end