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

@@ -29,13 +29,10 @@ function Inventory.onSoulChange(soul)
widget:setText("Soul:\n" .. soul)
end
function Inventory.onInventoryItemMousePress(itemWidget, mousePos, mouseButton)
if mouseButton ~= MouseRightButton then return end
function Inventory.onInventoryItemMousePress(itemWidget, mousePosition, mouseButton)
local item = itemWidget:getItem()
if not item then return end
Game.createThingMenu(mousePos, item, item, nil)
if item and Game.processMouseAction(mousePosition, mouseButton, nil, item, item, nil, item) then return true end
return false
end
connect(Game, { onLogin = Inventory.create,
@@ -43,3 +40,4 @@ connect(Game, { onLogin = Inventory.create,
onInventoryChange = Inventory.onInventoryChange,
onFreeCapacityChange = Inventory.onFreeCapacityChange,
onSoulChange = Inventory.onSoulChange })