Refactored window clicking code to use different click actions
First part of solving FS #371; should fix #370. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1459 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
@@ -1381,7 +1381,47 @@ int cProtocol125::ParseWindowClick(void)
|
||||
{
|
||||
return res;
|
||||
}
|
||||
m_Client->HandleWindowClick(WindowID, SlotNum, IsRightClick, IsShiftPressed, HeldItem);
|
||||
|
||||
// Convert IsShiftPressed, IsRightClick, SlotNum and HeldItem into eClickAction used in the newer protocols:
|
||||
eClickAction Action;
|
||||
if (IsRightClick)
|
||||
{
|
||||
if (IsShiftPressed)
|
||||
{
|
||||
Action = caShiftRightClick;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (SlotNum == -999)
|
||||
{
|
||||
Action = (HeldItem.IsEmpty()) ? caRightClickOutsideHoldNothing : caRightClickOutside;
|
||||
}
|
||||
else
|
||||
{
|
||||
Action = caRightClick;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// IsLeftClick
|
||||
if (IsShiftPressed)
|
||||
{
|
||||
Action = caShiftLeftClick;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (SlotNum == -999)
|
||||
{
|
||||
Action = (HeldItem.IsEmpty()) ? caLeftClickOutsideHoldNothing : caRightClickOutside;
|
||||
}
|
||||
else
|
||||
{
|
||||
Action = caLeftClick;
|
||||
}
|
||||
}
|
||||
}
|
||||
m_Client->HandleWindowClick(WindowID, SlotNum, Action, HeldItem);
|
||||
return PARSE_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user