/// <summary> /// 获取所有的收藏物品的信息 /// </summary> public void OnRecieveAllStarItemDatas(stStarItemListConsignmentUserCmd_S cmd) { if (cmd != null) { if (itemStarInfo == null) { itemStarInfo = new MyConsignStarInfo(); } itemStarInfo.consignmentItemList.Clear(); ItemSerialize itData = new ItemSerialize(); for (int i = 0; i < cmd.item_data.Count; i++) { itData = ItemSerialize.Deserialize(cmd.item_data[i]); if (i < cmd.item_list.Count) { ConsignmentItem consignment = new ConsignmentItem(cmd.item_list[i].market_id, cmd.item_list[i], itData); itemStarInfo.consignmentItemList.Add(consignment); } } itemStarInfo.consignmentItemList.Sort(CompareConsignment); AllPage = (uint)cmd.item_list.Count; } DispatchValueUpdateEvent(new ValueUpdateEventArgs(SaleItemDispatchEvents.GetAllStarItems.ToString(), null, null)); }
/// <summary> /// 寄售成功 /// </summary> /// <param name="cmd"></param> public void OnResponSellConsignItem(stSellItemConsignmentUserCmd_S cmd) { if (itemSellInfo == null) { itemSellInfo = new MyConsignItemInfo(); } ItemSerialize data = ItemSerialize.Deserialize(cmd.item_data); ConsignmentItem consignment = new ConsignmentItem(cmd.page_info.market_id, cmd.page_info, data, cmd.time_info); itemSellInfo.consignmentItemList.Add(consignment); itemSellInfo.consignmentItemList.Sort(CompareConsignment); DispatchValueUpdateEvent(new ValueUpdateEventArgs(SaleItemDispatchEvents.RefreshSellItemInfo.ToString(), null, null)); }
/// <summary> /// 返回寄售物品信息 /// </summary> /// <param name="cmd"></param> public void OnResponItemInfoConsignment(stResponItemInfoConsignmentUserCmd_S cmd) { ItemSerialize itemData = ItemSerialize.Deserialize(cmd.item_data); if (itemData != null) { BaseItem item = new BaseItem(itemData.dwObjectID, itemData); TipsManager.Instance.ShowItemTips(item); if (!m_itemInfoDic.ContainsKey(cmd.market_id)) { m_itemInfoDic.Add(cmd.market_id, item); } } }
public override void SetGridData(object data) { base.SetGridData(data); info = data as ItemPriceInfo; if (info != null) { if (money != null) { CurrencyIconData currency = CurrencyIconData.GetCurrencyIconByMoneyType((ClientMoneyType)info.money_type); if (currency != null) { money.spriteName = currency.smallIconName; } } itData = new ItemSerialize(); itData = ItemSerialize.Deserialize(info.item_data); price.text = info.price.ToString(); if (itData != null) { ResetInfoGrid(true); BaseItem baseItem = new BaseItem(itData.dwObjectID, itData); name.text = baseItem.Name; SetIcon(true, baseItem.Icon); bool enable = (info.num > 1) ? true : false; SetNum(enable, info.num.ToString()); SetBorder(true, baseItem.BorderIcon); if (baseItem.IsMuhon) { SetMuhonMask(true, Muhon.GetMuhonStarLevel(baseItem.BaseId)); } else if (baseItem.IsRuneStone) { SetRuneStoneMask(true, (uint)baseItem.Grade); } } } }
/// <summary> /// 收到个人寄售信息列表 /// </summary> /// <param name="cmd"></param> public void OnResponItemSellInfo(stItemSellInfoConsignmentUserCmd_S cmd) { if (cmd != null) { if (itemSellInfo == null) { itemSellInfo = new MyConsignItemInfo(); } itemSellInfo.consignmentItemList.Clear(); ItemSerialize itData = new ItemSerialize(); for (int i = 0; i < cmd.item_data.Count; i++) { itData = ItemSerialize.Deserialize(cmd.item_data[i]); if (i < cmd.item_time_list.Count && i < cmd.item_list.Count) { ConsignmentItem consignment = new ConsignmentItem(cmd.item_list[i].market_id, cmd.item_list[i], itData, cmd.item_time_list[i]); itemSellInfo.consignmentItemList.Add(consignment); } } itemSellInfo.consignmentItemList.Sort(CompareConsignment); ConsignTotalJinBi = cmd.gold; ConsignTotalYuanBao = cmd.coin; } }
/// <summary> /// 返回寄售列表 /// </summary> /// <param name="cmd"></param> public void OnResponItemListConsignment(stResponItemListConsignmentUserCmd_S cmd) { //处理页数 switch (ReqItemListState) { case ReqConsignListState.PreviousPage: CurPage = CurPage > 1 ? CurPage - 1 : 1; break; case ReqConsignListState.NextPage: CurPage += 1; break; default: CurPage = 1; break; } ReqItemListState = ReqConsignListState.None; BeginIndex = (int)cmd.begin_index; EndIndex = cmd.end_index; AllPage = cmd.all_item; if (cmd.init_page) { CurPage = 1; } pageConsignmentItemLists.Clear(); if (cmd.item_list.Count == cmd.item_data.Count) { ItemSerialize itemData = new ItemSerialize(); for (int i = 0; i < cmd.item_data.Count; i++) { if (cmd.item_data[i] != null) { itemData = ItemSerialize.Deserialize(cmd.item_data[i]); ConsignmentItem consignment = new ConsignmentItem(cmd.item_list[i].market_id, cmd.item_list[i], itemData); pageConsignmentItemLists.Add(consignment); } } } else { //堆叠物品 下发的itemList和ItemData不对等 需要自己赋值 ItemSerialize itemData = new ItemSerialize(); Dictionary <uint, ItemSerialize> tempDic = new Dictionary <uint, ItemSerialize>(); for (int i = 0; i < cmd.item_data.Count; i++) { if (cmd.item_data[i] != null) { itemData = ItemSerialize.Deserialize(cmd.item_data[i]); if (itemData != null) { if (!tempDic.ContainsKey(itemData.dwObjectID)) { tempDic.Add(itemData.dwObjectID, itemData); } } } } for (int i = 0; i < cmd.item_list.Count; i++) { if (cmd.item_list[i] != null) { if (tempDic.ContainsKey(cmd.item_list[i].item_base_id)) { ConsignmentItem consignment = new ConsignmentItem(cmd.item_list[i].market_id, cmd.item_list[i], tempDic[cmd.item_list[i].item_base_id]); pageConsignmentItemLists.Add(consignment); } } } } pageConsignmentItemLists.Sort(CompareConsignment); DispatchValueUpdateEvent(new ValueUpdateEventArgs(SaleItemDispatchEvents.RefreshSaleItemInfo.ToString(), null, null)); }