private void OnBag_SaleForm_ConfirSale(CUIEvent uiEvent) { ListView <CSDT_ITEM_DELINFO> itemList = new ListView <CSDT_ITEM_DELINFO>(); CSDT_ITEM_DELINFO item = new CSDT_ITEM_DELINFO { ullUniqueID = this.m_selectUseable.m_objID, iItemCnt = (ushort)this.m_saleCount }; itemList.Add(item); SendItemSaleMsg(itemList); }
public static void ReciveItemDel(CSPkg msg) { CSDT_ITEM_DELLIST stDelList = msg.stPkgData.stItemDel.stDelList; CUseableContainer useableContainer = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().GetUseableContainer(enCONTAINER_TYPE.ITEM); CSDT_ITEM_DELINFO csdt_item_delinfo = null; uint key = 0; for (int i = 0; i < stDelList.wItemCnt; i++) { csdt_item_delinfo = stDelList.astItemList[i]; if (csdt_item_delinfo != null) { CUseable useableByObjID = useableContainer.GetUseableByObjID(csdt_item_delinfo.ullUniqueID); if (useableByObjID != null) { key = useableByObjID.m_baseID; } useableContainer.Remove(csdt_item_delinfo.ullUniqueID, csdt_item_delinfo.iItemCnt); } } Debug.Log("itemDel"); switch (msg.stPkgData.stItemDel.bDelReason) { case 3: Singleton <CUIManager> .GetInstance().OpenTips(Singleton <CTextManager> .GetInstance().GetText("Shop_Sale_Success"), false, 1f, null, new object[0]); Singleton <CUIManager> .GetInstance().CloseForm(s_bagSaleFormPath); Singleton <EventRouter> .instance.BroadCastEvent <CSDT_ITEM_DELLIST>(EventID.BAG_ITEM_SALED, stDelList); Singleton <CSoundManager> .GetInstance().PostEvent("UI_backpack_sell", null); break; case 4: Singleton <CSoundManager> .GetInstance().PostEvent("UI_backpack_sell", null); if (csdt_item_delinfo != null) { ResPropInfo dataByKey = GameDataMgr.itemDatabin.GetDataByKey(key); if ((dataByKey != null) && (dataByKey.iUseShowTip != 0)) { Singleton <CUIManager> .GetInstance().OpenTips(string.Format(Singleton <CTextManager> .GetInstance().GetText("ItemTakeEffectTip"), StringHelper.UTF8BytesToString(ref dataByKey.szName)), false, 1f, null, new object[0]); } } break; case 7: Singleton <CHeroInfoSystem2> .GetInstance().RefreshHeroInfoForm(); break; } Singleton <CBagSystem> .GetInstance().RefreshBagForm(); Singleton <CSymbolSystem> .GetInstance().RefreshSymbolForm(); Singleton <CUIManager> .GetInstance().CloseSendMsgAlert(); Singleton <EventRouter> .instance.BroadCastEvent(EventID.BAG_ITEMS_UPDATE); }