From 6b020b94a4020cf1c7a7c9cb02d5101f6be110e7 Mon Sep 17 00:00:00 2001 From: Eduardo Bart Date: Wed, 4 Apr 2012 20:04:42 -0300 Subject: [PATCH] left+right look for UIItem --- modules/game/widgets/uiitem.lua | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/modules/game/widgets/uiitem.lua b/modules/game/widgets/uiitem.lua index 17d8eff9..d1065d2d 100644 --- a/modules/game/widgets/uiitem.lua +++ b/modules/game/widgets/uiitem.lua @@ -51,10 +51,25 @@ function UIItem:onHoverChange(hovered) end function UIItem:onMouseRelease(mousePosition, mouseButton) + if self.cancelNextRelease then + self.cancelNextRelease = false + return true + end + if self:isVirtual() then return false end local item = self:getItem() if not item or not self:containsPoint(mousePosition) then return false end - return GameInterface.processMouseAction(mousePosition, mouseButton, nil, item, item, nil, item) + + if Options.getOption('classicControl') and + ((Mouse.isPressed(MouseLeftButton) and mouseButton == MouseRightButton) or + (Mouse.isPressed(MouseRightButton) and mouseButton == MouseLeftButton)) then + g_game.look(item) + self.cancelNextRelease = true + return true + elseif GameInterface.processMouseAction(mousePosition, mouseButton, nil, item, item, nil, item) then + return true + end + return false end