function HandleTradeAddItem( string param )
{
local string strDest;
local ItemInfo itemInfo, tempInfo;
local int index;
local int tmpInt;
ParseString( param, "destination", strDest );
ParamToItemInfo( param, itemInfo );
if ( strDest == "inventoryList" )
strDest = "TradeWnd.InventoryList";
else if ( strDest == "myList" )
{
strDest = "TradeWnd.MyList";
class'UIAPI_INVENWEIGHT'.static.ReduceWeight( "TradeWnd.InvenWeight", itemInfo.ItemNum * itemInfo.Weight );
}
else if ( strDest == "otherList" )
{
strDest = "TradeWnd.OtherList";
class'UIAPI_INVENWEIGHT'.static.AddWeight( "TradeWnd.InvenWeight", itemInfo.ItemNum * itemInfo.Weight );
}
if ( ParseInt( param, "equipped", tmpInt ) )
itemInfo.RefineryOp1 = tmpInt;
else
itemInfo.RefineryOp1 = itemInfo.Blessed;
itemInfo.RefineryOp2 = itemInfo.Damaged;
index = class'UIAPI_ITEMWINDOW'.static.FindItemWithServerID( strDest, itemInfo.ServerID );
if ( index >= 0 )
{
if ( IsStackableItem( ItemInfo.ConsumeType ) )
{
class'UIAPI_ITEMWINDOW'.static.GetItem( strDest, index, tempInfo );
itemInfo.ItemNum += tempInfo.ItemNum;
class'UIAPI_ITEMWINDOW'.static.SetItem( strDest, index, itemInfo );
}
}
else
class'UIAPI_ITEMWINDOW'.static.AddItem( strDest, itemInfo );
}