From 71ed758a3fc03f6501708eef3a46f03b2ebbd58d Mon Sep 17 00:00:00 2001 From: Henrique Santiago Date: Wed, 11 Jan 2012 02:43:10 -0200 Subject: [PATCH] fix party shield, inventory mouse release --- modules/game/creature.lua | 10 +++++----- modules/game_inventory/inventory.lua | 6 +++--- modules/game_inventory/inventory.otui | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/game/creature.lua b/modules/game/creature.lua index 4b0ea9b6..9df2601a 100644 --- a/modules/game/creature.lua +++ b/modules/game/creature.lua @@ -51,15 +51,15 @@ function Creature:onShieldChange(shieldId) elseif shieldId == ShieldBlueSharedExp then self:setShieldTexture(resolvepath('images/shield_blue_shared.png')) elseif shieldId == ShieldYellowSharedExp then - self:setSkullTexture(resolvepath('images/shield_yellow_shared.png')) + self:setShieldTexture(resolvepath('images/shield_yellow_shared.png')) elseif shieldId == ShieldBlueNoSharedExpBlink then - self:setSkullTexture(resolvepath('images/shield_blue_not_shared.png')) + self:setShieldTexture(resolvepath('images/shield_blue_not_shared.png')) elseif shieldId == ShieldYellowNoSharedExpBlink then - self:setSkullTexture(resolvepath('images/shield_yellow_not_shared.png')) + self:setShieldTexture(resolvepath('images/shield_yellow_not_shared.png')) elseif shieldId == ShieldBlueNoSharedExp then - self:setSkullTexture(resolvepath('images/shield_blue_not_shared.png')) + self:setShieldTexture(resolvepath('images/shield_blue_not_shared.png')) elseif shieldId == ShieldYellowNoSharedExp then - self:setSkullTexture(resolvepath('images/shield_yellow_not_shared.png')) + self:setShieldTexture(resolvepath('images/shield_yellow_not_shared.png')) end end diff --git a/modules/game_inventory/inventory.lua b/modules/game_inventory/inventory.lua index 9e0a106a..1b77e699 100644 --- a/modules/game_inventory/inventory.lua +++ b/modules/game_inventory/inventory.lua @@ -29,10 +29,10 @@ function Inventory.onSoulChange(soul) widget:setText("Soul:\n" .. soul) end -function Inventory.onInventoryItemMousePress(itemWidget, mousePosition, mouseButton) +function Inventory.onInventoryItemMouseRelease(itemWidget, mousePosition, mouseButton) local item = itemWidget:getItem() - if item and Game.processMouseAction(mousePosition, mouseButton, nil, item, item, nil, item) then return true end - return false + if not item or not itemWidget:containsPoint(mousePosition) then return false end + return Game.processMouseAction(mousePosition, mouseButton, nil, item, item, nil, item) end connect(Game, { onLogin = Inventory.create, diff --git a/modules/game_inventory/inventory.otui b/modules/game_inventory/inventory.otui index b2f94a06..f2e2d837 100644 --- a/modules/game_inventory/inventory.otui +++ b/modules/game_inventory/inventory.otui @@ -1,5 +1,5 @@ InvetoryItem < Item - &onMousePress: Inventory.onInventoryItemMousePress + &onMouseRelease: Inventory.onInventoryItemMouseRelease UIWindow width: 192