private void OnClickReviveBtn(CUIEvent uiEvent) { stUIEventParams stUIEventParams = default(stUIEventParams); stUIEventParams.commonUInt32Param1 = (uint)PVEReviveHeros.m_iRemainReviveNum; CMallSystem.TryToPay(enPayPurpose.Relive, string.Empty, this.m_relivePayType, this.m_relivePayValue, enUIEventID.ReviveHero_OnConfirmRevive, ref stUIEventParams, enUIEventID.ReviveHero_OnReviveFailed, true, true, false); }
public void BuyShopProduct(ShopProduct shopProduct, uint count, bool needConfirm, CUIEvent uiEvent = null) { CUseable useable = CUseableManager.CreateUseable(shopProduct.Type, shopProduct.ID, 0); enPayType payType = CMallSystem.ResBuyTypeToPayType((int)shopProduct.CoinType); uint payValue = 0; if ((shopProduct != null) && shopProduct.m_bChangeGiftPrice) { payValue = shopProduct.m_newGiftPrice * count; } else { payValue = shopProduct.ConvertWithRealDiscount(useable.GetBuyPrice(shopProduct.CoinType) * count); } if (uiEvent == null) { uiEvent = Singleton <CUIEventManager> .GetInstance().GetUIEvent(); uiEvent.m_eventID = enUIEventID.Mall_Product_Confirm_Buy; uiEvent.m_eventParams.tag = (int)shopProduct.Key; uiEvent.m_eventParams.commonUInt32Param1 = count; } else { uiEvent.m_eventParams.commonUInt32Param1 = count; } CMallSystem.TryToPay(enPayPurpose.Buy, string.Format("{0}{1}", useable.m_name, (count <= 1) ? string.Empty : ("x" + count)), payType, payValue, uiEvent.m_eventID, ref uiEvent.m_eventParams, enUIEventID.None, needConfirm, true, false); }
private void OnClickReviveBtn(CUIEvent uiEvent) { stUIEventParams confirmEventParams = new stUIEventParams { commonUInt32Param1 = (uint)m_iRemainReviveNum }; CMallSystem.TryToPay(enPayPurpose.Relive, string.Empty, this.m_relivePayType, this.m_relivePayValue, enUIEventID.ReviveHero_OnConfirmRevive, ref confirmEventParams, enUIEventID.ReviveHero_OnReviveFailed, true, true); }
private void Talent_Buy_BtnSellClick(CUIEvent uiEvent) { enPayType payType = CMallSystem.ResBuyTypeToPayType(uiEvent.m_eventParams.tag); uint tagUInt = uiEvent.m_eventParams.tagUInt; string[] args = new string[] { uiEvent.m_eventParams.tagStr }; string text = Singleton <CTextManager> .instance.GetText("Talent_Buy_5", args); CMallSystem.TryToPay(enPayPurpose.Buy, text, payType, tagUInt, enUIEventID.Talent_Buy_ConfirmClick, ref uiEvent.m_eventParams, enUIEventID.None, true, true); }
private void OnBuyItem(CUIEvent uiEvent) { enPayType tag = (enPayType)uiEvent.m_eventParams.tag; uint payValue = uiEvent.m_eventParams.commonUInt32Param1; string goodName = string.Empty; COM_ITEM_TYPE com_item_type = COM_ITEM_TYPE.COM_OBJTYPE_NULL; uint uniSkinId = 0; long key = 0L; if (uiEvent.m_eventParams.heroSkinParam.skinId != 0) { com_item_type = COM_ITEM_TYPE.COM_OBJTYPE_HEROSKIN; uniSkinId = CSkinInfo.GetSkinCfgId(uiEvent.m_eventParams.heroSkinParam.heroId, uiEvent.m_eventParams.heroSkinParam.skinId); ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(uniSkinId); DebugHelper.Assert(heroSkin != null, string.Format("找不到皮肤{0}的配置信息", uniSkinId)); if (heroSkin == null) { return; } goodName = StringHelper.UTF8BytesToString(ref heroSkin.szSkinName); } else if (uiEvent.m_eventParams.heroId != 0) { com_item_type = COM_ITEM_TYPE.COM_OBJTYPE_HERO; uniSkinId = uiEvent.m_eventParams.heroId; ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(uniSkinId); DebugHelper.Assert(dataByKey != null, string.Format("找不到英雄{0}的配置信息", uniSkinId)); if (dataByKey == null) { return; } goodName = StringHelper.UTF8BytesToString(ref dataByKey.szName); } else { DebugHelper.Assert(false, "神秘商店购买不支持该物品类型"); return; } key = GameDataMgr.GetDoubleKey((uint)com_item_type, uniSkinId); CMallMysteryProduct product = new CMallMysteryProduct(); if (!this.m_ProductDic.TryGetValue(key, out product)) { DebugHelper.Assert(false, string.Format("神秘商店找不到该物品{0}/{1}", Enum.GetName(typeof(COM_ITEM_TYPE), com_item_type), uniSkinId)); } else { CUIEvent uIEvent = Singleton <CUIEventManager> .GetInstance().GetUIEvent(); uIEvent.m_eventID = enUIEventID.Mall_Mystery_On_Confirm_Buy_Item; uIEvent.m_eventParams.tag = (int)product.ID; CMallSystem.TryToPay(enPayPurpose.Buy, goodName, tag, payValue, uIEvent.m_eventID, ref uIEvent.m_eventParams, enUIEventID.None, false, true); } }
private void On_Chat_Text_Send(CUIEvent uiEvent) { if ((this.view != null) && this.view.bShow) { string inputText = this.view.GetInputText(); switch (this.CheckSend(this.view.CurTab, inputText, true)) { case enCheckChatResult.Success: Singleton <CChatController> .GetInstance().On_InputFiled_EndEdit(inputText); this.view.ClearInputText(); break; case enCheckChatResult.EmptyLimit: Singleton <CUIManager> .instance.OpenTips("Chat_Common_Tips_10", true, 1f, null, new object[0]); break; case enCheckChatResult.FunUnlockLimit: Singleton <CUIManager> .instance.OpenTips("Chat_Common_Tips_6", true, 1f, null, new object[0]); break; case enCheckChatResult.BanLimit: { DateTime banTime = MonoSingleton <IDIPSys> .GetInstance().GetBanTime(COM_ACNT_BANTIME_TYPE.COM_ACNT_BANTIME_DENYCHAT); object[] args = new object[] { banTime.Year, banTime.Month, banTime.Day, banTime.Hour, banTime.Minute }; string strContent = string.Format("您已被禁言!禁言截止时间为{0}年{1}月{2}日{3}时{4}分", args); Singleton <CUIManager> .GetInstance().OpenMessageBox(strContent, false); this.view.ClearInputText(); break; } case enCheckChatResult.CdLimit: { int num = this.model.channelMgr.GetChannel(this.view.CurTab).Get_Left_CDTime(); Singleton <CUIManager> .instance.OpenTips("chat_input_cd", true, 1f, null, new object[0]); this.view.ClearInputText(); break; } case enCheckChatResult.FreeCntLimit: uiEvent.m_eventParams.tagStr = inputText; CMallSystem.TryToPay(enPayPurpose.Chat, string.Empty, enPayType.DiamondAndDianQuan, (uint)Singleton <CChatController> .instance.model.sysData.chatCostNum, enUIEventID.Chat_Cost_Send, ref uiEvent.m_eventParams, enUIEventID.None, false, true); break; } } }
private void OnBuyItem(CUIEvent uiEvent) { enPayType tag = (enPayType)uiEvent.m_eventParams.tag; uint commonUInt32Param = uiEvent.m_eventParams.commonUInt32Param1; string goodName = string.Empty; COM_ITEM_TYPE cOM_ITEM_TYPE; uint num; if (uiEvent.m_eventParams.heroSkinParam.skinId != 0u) { cOM_ITEM_TYPE = COM_ITEM_TYPE.COM_OBJTYPE_HEROSKIN; num = CSkinInfo.GetSkinCfgId(uiEvent.m_eventParams.heroSkinParam.heroId, uiEvent.m_eventParams.heroSkinParam.skinId); ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(num); DebugHelper.Assert(heroSkin != null, string.Format("找不到皮肤{0}的配置信息", num)); if (heroSkin == null) { return; } goodName = StringHelper.UTF8BytesToString(ref heroSkin.szSkinName); } else { if (uiEvent.m_eventParams.heroId == 0u) { DebugHelper.Assert(false, "神秘商店购买不支持该物品类型"); return; } cOM_ITEM_TYPE = COM_ITEM_TYPE.COM_OBJTYPE_HERO; num = uiEvent.m_eventParams.heroId; ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(num); DebugHelper.Assert(dataByKey != null, string.Format("找不到英雄{0}的配置信息", num)); if (dataByKey == null) { return; } goodName = StringHelper.UTF8BytesToString(ref dataByKey.szName); } int productID = this.GetProductID(num); if (productID < 0) { DebugHelper.Assert(false, string.Format("神秘商店找不到该物品{0}/{1}", Enum.GetName(typeof(COM_ITEM_TYPE), cOM_ITEM_TYPE), num)); return; } CUIEvent uIEvent = Singleton <CUIEventManager> .GetInstance().GetUIEvent(); uIEvent.m_eventID = enUIEventID.Mall_Mystery_On_Confirm_Buy_Item; uIEvent.m_eventParams.tag = productID; CMallSystem.TryToPay(enPayPurpose.Buy, goodName, tag, commonUInt32Param, uIEvent.m_eventID, ref uIEvent.m_eventParams, enUIEventID.None, false, true, false); }
private void OnBuyPickDialogConfirm(CUIEvent uiEvent, uint count) { int bCount = (int)count; uint tagUInt = uiEvent.m_eventParams.tagUInt; int tag = uiEvent.m_eventParams.tag; CUseable useable = CUseableManager.CreateUseable(COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP, tagUInt, bCount); if (useable != null) { int num4 = (int)(useable.GetBuyPrice((RES_SHOPBUY_COINTYPE)tag) * bCount); enPayType payType = CMallSystem.ResBuyTypeToPayType(tag); stUIEventParams confirmEventParams = new stUIEventParams { tag = bCount }; string[] args = new string[] { bCount.ToString(), useable.m_name }; CMallSystem.TryToPay(enPayPurpose.Buy, Singleton <CTextManager> .GetInstance().GetText("Union_Battle_Tips5", args), payType, (uint)num4, enUIEventID.Union_Battle_ConfirmBuyItem, ref confirmEventParams, enUIEventID.None, true, true); } }
private void OnClickStartMatch(CUIEvent uiEvt) { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo(); if (masterRoleInfo != null) { CUseableContainer useableContainer = masterRoleInfo.GetUseableContainer(enCONTAINER_TYPE.ITEM); if (CUICommonSystem.IsMatchOpened(RES_BATTLE_MAP_TYPE.RES_BATTLE_MAP_TYPE_REWARDMATCH, this.m_selectMapID)) { int num = useableContainer.GetUseableStackCount(COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP, this.m_selectMapRes.dwConsumPayItemID) + useableContainer.GetUseableStackCount(COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP, this.m_selectMapRes.dwConsumFreeItemID); int dwCousumItemNum = (int)this.m_selectMapRes.dwCousumItemNum; if (num >= dwCousumItemNum) { this.SendBeginMatchReq(); } else { int bCount = dwCousumItemNum - num; CUseable useable = CUseableManager.CreateUseable(COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP, this.m_selectMapRes.dwConsumPayItemID, bCount); if (useable != null) { int num4 = (int)(useable.GetBuyPrice((RES_SHOPBUY_COINTYPE)this.m_selectMapRes.bCoinType) * bCount); enPayType payType = CMallSystem.ResBuyTypeToPayType(this.m_selectMapRes.bCoinType); stUIEventParams confirmEventParams = new stUIEventParams { tag = bCount }; string[] args = new string[] { bCount.ToString(), useable.m_name }; CMallSystem.TryToPay(enPayPurpose.Buy, Singleton <CTextManager> .GetInstance().GetText("Union_Battle_Tips5", args), payType, (uint)num4, enUIEventID.Union_Battle_ConfirmBuyItem, ref confirmEventParams, enUIEventID.None, true, true); } } } else { Singleton <CUIManager> .instance.OpenTips("Union_Battle_Tips4", true, 1f, null, new object[0]); } } }