steed/stead/click.lua
2010-06-09 10:19:11 +00:00

21 lines
441 B
Lua

input.click = function(s, press, mb, x, y, px, py)
if press and px then
return "click "..px..','..py;
end
end
game.action = hook(game.action,
function(f, s, cmd, x, y, ...)
if cmd == 'click' then
if here().click then
return call(here(), 'click', x, y, unpack(arg));
end
if game.click then
return call(game, 'click', x, y, unpack(arg));
end
return nil,true
end
if f then return f(s, cmd, x, y, unpack(arg)) end
end)