private int CompareCoupons(ResHeroCfgInfo l, ResHeroCfgInfo r) { ResHeroPromotion resPromotion = CHeroDataFactory.CreateHeroData(l.dwCfgID).promotion(); ResHeroPromotion resPromotion2 = CHeroDataFactory.CreateHeroData(r.dwCfgID).promotion(); stPayInfoSet payInfoSetOfGood = CMallSystem.GetPayInfoSetOfGood(l, resPromotion); stPayInfoSet payInfoSetOfGood2 = CMallSystem.GetPayInfoSetOfGood(r, resPromotion2); uint num = 4294967295u; uint num2 = 4294967295u; for (int i = 0; i < payInfoSetOfGood.m_payInfoCount; i++) { if ((payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.Diamond || payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.DianQuan || payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.DiamondAndDianQuan) && payInfoSetOfGood.m_payInfos[i].m_payValue < num) { num = payInfoSetOfGood.m_payInfos[i].m_payValue; } } for (int j = 0; j < payInfoSetOfGood2.m_payInfoCount; j++) { if ((payInfoSetOfGood2.m_payInfos[j].m_payType == enPayType.Diamond || payInfoSetOfGood2.m_payInfos[j].m_payType == enPayType.DianQuan || payInfoSetOfGood2.m_payInfos[j].m_payType == enPayType.DiamondAndDianQuan) && payInfoSetOfGood2.m_payInfos[j].m_payValue < num2) { num2 = payInfoSetOfGood2.m_payInfos[j].m_payValue; } } if (num == 4294967295u && this.IsDesc()) { num = 0u; } if (num2 == 4294967295u && this.IsDesc()) { num2 = 0u; } return(num.CompareTo(num2)); }
public static bool IsCanBuy(uint heroId, uint skinId) { ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(heroId, skinId); if (heroSkin == null) { return(false); } if (!GameDataMgr.IsSkinAvailableAtShop(heroSkin.dwID)) { return(false); } ResSkinPromotion resSkinPromotion = new ResSkinPromotion(); stPayInfoSet stPayInfoSet = default(stPayInfoSet); resSkinPromotion = CSkinInfo.GetSkinPromotion(heroSkin.dwID); if (resSkinPromotion != null) { stPayInfoSet = CMallSystem.GetPayInfoSetOfGood(false, 0u, resSkinPromotion.bIsBuyCoupons > 0, resSkinPromotion.dwBuyCoupons, resSkinPromotion.bIsBuyDiamond > 0, resSkinPromotion.dwBuyDiamond, 10000u); } else { stPayInfoSet = CMallSystem.GetPayInfoSetOfGood(heroSkin); } return(stPayInfoSet.m_payInfoCount > 0); }
private void SetSkinItem(CMallItemWidget mallWidget, ResHeroSkin skinInfo, CUIFormScript form) { Image component = mallWidget.m_icon.GetComponent <Image>(); component.color = CUIUtility.s_Color_White; string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_BustHero_Dir, skinInfo.szSkinPicID); component.SetSprite(prefabPath, form, false, true, true); mallWidget.m_skinLabel.CustomSetActive(true); CUICommonSystem.SetHeroSkinLabelPic(form, mallWidget.m_skinLabel, skinInfo.dwHeroID, skinInfo.dwSkinID); mallWidget.m_topNameLeftText.GetComponent <Text>().text = skinInfo.szHeroName; mallWidget.m_topNameRightText.CustomSetActive(true); mallWidget.m_topNameRightText.GetComponent <Text>().text = skinInfo.szSkinName; ResSkinPromotion skinPromotion = CSkinInfo.GetSkinPromotion(skinInfo.dwHeroID, skinInfo.dwSkinID); this._payInfoTemp = CMallSystem.GetPayInfoSetOfGood(skinInfo, skinPromotion); uint num = this.SetItemPriceInfo(mallWidget, ref this._payInfoTemp); this.SetItemTag(mallWidget, null, skinPromotion, form); stUIEventParams eventParams = new stUIEventParams(); eventParams.openHeroFormPar.heroId = skinInfo.dwHeroID; eventParams.openHeroFormPar.skinId = skinInfo.dwSkinID; eventParams.commonUInt32Param1 = num; mallWidget.m_item.GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.Mall_GiftShowDetail, eventParams); stUIEventParams params2 = new stUIEventParams(); params2.heroSkinParam.heroId = skinInfo.dwHeroID; params2.heroSkinParam.skinId = skinInfo.dwSkinID; params2.heroSkinParam.isCanCharge = true; params2.commonUInt64Param1 = this._curFriendUid; params2.commonBool = this._curFriendIsSns; params2.commonUInt32Param1 = this._curWorldId; mallWidget.m_buyBtn.GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.HeroSkin_OpenBuyHeroSkinForFriend, params2); }
private int CompareCoupons(ResHeroCfgInfo l, ResHeroCfgInfo r) { ResHeroPromotion resPromotion = CHeroDataFactory.CreateHeroData(l.dwCfgID).promotion(); ResHeroPromotion promotion2 = CHeroDataFactory.CreateHeroData(r.dwCfgID).promotion(); stPayInfoSet payInfoSetOfGood = CMallSystem.GetPayInfoSetOfGood(l, resPromotion); stPayInfoSet set2 = CMallSystem.GetPayInfoSetOfGood(r, promotion2); uint maxValue = uint.MaxValue; uint payValue = uint.MaxValue; for (int i = 0; i < payInfoSetOfGood.m_payInfoCount; i++) { if ((((payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.Diamond) || (payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.DianQuan)) || (payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.DiamondAndDianQuan)) && (payInfoSetOfGood.m_payInfos[i].m_payValue < maxValue)) { maxValue = payInfoSetOfGood.m_payInfos[i].m_payValue; } } for (int j = 0; j < set2.m_payInfoCount; j++) { if ((((set2.m_payInfos[j].m_payType == enPayType.Diamond) || (set2.m_payInfos[j].m_payType == enPayType.DianQuan)) || (set2.m_payInfos[j].m_payType == enPayType.DiamondAndDianQuan)) && (set2.m_payInfos[j].m_payValue < payValue)) { payValue = set2.m_payInfos[j].m_payValue; } } if ((maxValue == uint.MaxValue) && this.IsDesc()) { maxValue = 0; } if ((payValue == uint.MaxValue) && this.IsDesc()) { payValue = 0; } return(maxValue.CompareTo(payValue)); }
private void SetHeroItem(CMallItemWidget mallWidget, ResHeroCfgInfo heroInfo, CUIFormScript form) { Image component = mallWidget.m_icon.GetComponent <Image>(); component.color = CUIUtility.s_Color_White; string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_BustHero_Dir, heroInfo.szImagePath); component.SetSprite(prefabPath, form, false, true, true); mallWidget.m_skinLabel.CustomSetActive(false); mallWidget.m_topNameLeftText.GetComponent <Text>().text = heroInfo.szName; mallWidget.m_topNameRightText.CustomSetActive(false); IHeroData data = CHeroDataFactory.CreateHeroData(heroInfo.dwCfgID); if (data != null) { ResHeroPromotion resPromotion = data.promotion(); this._payInfoTemp = CMallSystem.GetPayInfoSetOfGood(heroInfo, resPromotion); uint num = this.SetItemPriceInfo(mallWidget, ref this._payInfoTemp); this.SetItemTag(mallWidget, resPromotion, null, form); stUIEventParams eventParams = new stUIEventParams { heroId = heroInfo.dwCfgID, commonUInt64Param1 = this._curFriendUid, commonBool = this._curFriendIsSns, commonUInt32Param1 = this._curWorldId }; mallWidget.m_buyBtn.GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.HeroView_OpenBuyHeroForFriend, eventParams); mallWidget.m_item.GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.None, eventParams); } }
public static bool IsCanBuy(uint heroId, uint skinId) { ResHeroSkin heroSkin = GetHeroSkin(heroId, skinId); if (heroSkin == null) { return(false); } if (!GameDataMgr.IsSkinAvailableAtShop(heroSkin.dwID)) { return(false); } ResSkinPromotion skinPromotion = new ResSkinPromotion(); stPayInfoSet payInfoSetOfGood = new stPayInfoSet(); skinPromotion = GetSkinPromotion(heroSkin.dwID); if (skinPromotion != null) { payInfoSetOfGood = CMallSystem.GetPayInfoSetOfGood(false, 0, skinPromotion.bIsBuyCoupons > 0, skinPromotion.dwBuyCoupons, skinPromotion.bIsBuyDiamond > 0, skinPromotion.dwBuyDiamond, 0x2710); } else { payInfoSetOfGood = CMallSystem.GetPayInfoSetOfGood(heroSkin); } return(payInfoSetOfGood.m_payInfoCount > 0); }
private int CompareCoupons(ResHeroSkin l, ResHeroSkin r) { ResSkinPromotion skinPromotion = CSkinInfo.GetSkinPromotion(l.dwHeroID, l.dwSkinID); ResSkinPromotion resPromotion = CSkinInfo.GetSkinPromotion(r.dwHeroID, r.dwSkinID); stPayInfoSet payInfoSetOfGood = CMallSystem.GetPayInfoSetOfGood(l, skinPromotion); stPayInfoSet set2 = CMallSystem.GetPayInfoSetOfGood(r, resPromotion); uint maxValue = uint.MaxValue; uint payValue = uint.MaxValue; for (int i = 0; i < payInfoSetOfGood.m_payInfoCount; i++) { if ((((payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.Diamond) || (payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.DianQuan)) || (payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.DiamondAndDianQuan)) && (payInfoSetOfGood.m_payInfos[i].m_payValue < maxValue)) { maxValue = payInfoSetOfGood.m_payInfos[i].m_payValue; } } for (int j = 0; j < set2.m_payInfoCount; j++) { if ((((set2.m_payInfos[j].m_payType == enPayType.Diamond) || (set2.m_payInfos[j].m_payType == enPayType.DianQuan)) || (set2.m_payInfos[j].m_payType == enPayType.DiamondAndDianQuan)) && (set2.m_payInfos[j].m_payValue < payValue)) { payValue = set2.m_payInfos[j].m_payValue; } } if ((maxValue == uint.MaxValue) && this.IsDesc()) { maxValue = 0; } if ((payValue == uint.MaxValue) && this.IsDesc()) { payValue = 0; } return(maxValue.CompareTo(payValue)); }
private int CompareCoupons(ResHeroSkin l, ResHeroSkin r) { ResSkinPromotion skinPromotion = CSkinInfo.GetSkinPromotion(l.dwHeroID, l.dwSkinID); ResSkinPromotion skinPromotion2 = CSkinInfo.GetSkinPromotion(r.dwHeroID, r.dwSkinID); stPayInfoSet payInfoSetOfGood = CMallSystem.GetPayInfoSetOfGood(l, skinPromotion); stPayInfoSet payInfoSetOfGood2 = CMallSystem.GetPayInfoSetOfGood(r, skinPromotion2); uint num = 4294967295u; uint num2 = 4294967295u; for (int i = 0; i < payInfoSetOfGood.m_payInfoCount; i++) { if ((payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.Diamond || payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.DianQuan || payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.DiamondAndDianQuan) && payInfoSetOfGood.m_payInfos[i].m_payValue < num) { num = payInfoSetOfGood.m_payInfos[i].m_payValue; } } for (int j = 0; j < payInfoSetOfGood2.m_payInfoCount; j++) { if ((payInfoSetOfGood2.m_payInfos[j].m_payType == enPayType.Diamond || payInfoSetOfGood2.m_payInfos[j].m_payType == enPayType.DianQuan || payInfoSetOfGood2.m_payInfos[j].m_payType == enPayType.DiamondAndDianQuan) && payInfoSetOfGood2.m_payInfos[j].m_payValue < num2) { num2 = payInfoSetOfGood2.m_payInfos[j].m_payValue; } } if (num == 4294967295u && this.IsDesc()) { num = 0u; } if (num2 == 4294967295u && this.IsDesc()) { num2 = 0u; } return(num.CompareTo(num2)); }
public static stPayInfoSet GetSkinPayInfoSet(uint heroId, uint skinId) { ResSkinPromotion resPromotion = new ResSkinPromotion(); stPayInfoSet set = new stPayInfoSet(); resPromotion = GetSkinPromotion(heroId, skinId); return(CMallSystem.GetPayInfoSetOfGood(GetHeroSkin(heroId, skinId), resPromotion)); }
public static stPayInfoSet GetSkinPayInfoSet(uint heroId, uint skinId) { ResSkinPromotion resPromotion = new ResSkinPromotion(); stPayInfoSet stPayInfoSet = default(stPayInfoSet); resPromotion = CSkinInfo.GetSkinPromotion(heroId, skinId); ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(heroId, skinId); return(CMallSystem.GetPayInfoSetOfGood(heroSkin, resPromotion)); }
public CMallItem(uint heroID, CMallItem.IconType iconType = CMallItem.IconType.Normal) { this.m_type = CMallItem.ItemType.Hero; this.m_iconType = iconType; this.m_heroData = CHeroDataFactory.CreateHeroData(heroID); if (this.m_heroData != null) { this.m_firstName = this.m_heroData.heroName; this.m_secondName = null; string s_Sprite_Dynamic_Icon_Dir = CUIUtility.s_Sprite_Dynamic_Icon_Dir; if (iconType == CMallItem.IconType.Small) { this.m_useable = CUseableManager.CreateUseable(4, heroID, 1); if (this.m_useable != null) { this.m_iconPath = this.m_useable.GetIconPath(); } else { this.m_iconPath = null; } } else if (this.m_heroData.heroCfgInfo != null) { this.m_iconPath = CUIUtility.s_Sprite_Dynamic_BustHero_Dir + this.m_heroData.heroCfgInfo.szImagePath; } else { this.m_iconPath = null; } ResHeroPromotion resPromotion = this.m_heroData.promotion(); this.m_payInfoSet = CMallSystem.GetPayInfoSetOfGood(this.m_heroData.heroCfgInfo, resPromotion); } else { this.m_useable = null; this.m_firstName = null; this.m_secondName = null; this.m_iconPath = null; this.m_payInfoSet = default(stPayInfoSet); } }
public CMallItem(uint heroID, uint skinID, IconType iconType = 0) { this.m_type = ItemType.Skin; this.m_iconType = iconType; this.m_heroData = CHeroDataFactory.CreateHeroData(heroID); this.m_skinData = CSkinInfo.GetHeroSkin(heroID, skinID); if ((this.m_heroData != null) && (this.m_skinData != null)) { this.m_firstName = this.m_heroData.heroName; this.m_secondName = this.m_skinData.szSkinName; if (iconType == IconType.Small) { this.m_useable = CUseableManager.CreateUseable(COM_ITEM_TYPE.COM_OBJTYPE_HEROSKIN, this.m_skinData.dwID, 1); if (this.m_useable != null) { this.m_iconPath = this.m_useable.GetIconPath(); } else { this.m_iconPath = null; } } else { this.m_iconPath = CUIUtility.s_Sprite_Dynamic_BustHero_Dir + this.m_skinData.szSkinPicID; } ResSkinPromotion skinPromotion = CSkinInfo.GetSkinPromotion(heroID, skinID); this.m_payInfoSet = CMallSystem.GetPayInfoSetOfGood(this.m_skinData, skinPromotion); } else { this.m_useable = null; this.m_firstName = null; this.m_secondName = null; this.m_iconPath = null; this.m_payInfoSet = new stPayInfoSet(); } }
public CMallItem(uint heroID, IconType iconType = 0) { this.m_type = ItemType.Hero; this.m_iconType = iconType; this.m_heroData = CHeroDataFactory.CreateHeroData(heroID); if (this.m_heroData != null) { this.m_firstName = this.m_heroData.heroName; this.m_secondName = null; string str = CUIUtility.s_Sprite_Dynamic_Icon_Dir; if (iconType == IconType.Small) { this.m_useable = CUseableManager.CreateUseable(COM_ITEM_TYPE.COM_OBJTYPE_HERO, heroID, 1); if (this.m_useable != null) { this.m_iconPath = this.m_useable.GetIconPath(); } else { this.m_iconPath = null; } } else { this.m_iconPath = CUIUtility.s_Sprite_Dynamic_BustHero_Dir + this.m_heroData.imagePath; } ResHeroPromotion resPromotion = this.m_heroData.promotion(); this.m_payInfoSet = CMallSystem.GetPayInfoSetOfGood(this.m_heroData.heroCfgInfo, resPromotion); } else { this.m_useable = null; this.m_firstName = null; this.m_secondName = null; this.m_iconPath = null; this.m_payInfoSet = new stPayInfoSet(); } }
public CMallItem(uint heroID, uint skinID, CMallItem.IconType iconType = CMallItem.IconType.Normal) { this.m_type = CMallItem.ItemType.Skin; this.m_iconType = iconType; this.m_heroData = CHeroDataFactory.CreateHeroData(heroID); this.m_skinData = CSkinInfo.GetHeroSkin(heroID, skinID); if (this.m_heroData != null && this.m_skinData != null) { this.m_firstName = this.m_heroData.heroName; this.m_secondName = this.m_skinData.szSkinName; if (iconType == CMallItem.IconType.Small) { this.m_useable = CUseableManager.CreateUseable(7, this.m_skinData.dwID, 1); if (this.m_useable != null) { this.m_iconPath = this.m_useable.GetIconPath(); } else { this.m_iconPath = null; } } else { this.m_iconPath = CUIUtility.s_Sprite_Dynamic_BustHero_Dir + this.m_skinData.szSkinPicID; } ResSkinPromotion skinPromotion = CSkinInfo.GetSkinPromotion(heroID, skinID); this.m_payInfoSet = CMallSystem.GetPayInfoSetOfGood(this.m_skinData, skinPromotion); } else { this.m_useable = null; this.m_firstName = null; this.m_secondName = null; this.m_iconPath = null; this.m_payInfoSet = default(stPayInfoSet); } }
private int CompareCoin(ResHeroCfgInfo l, ResHeroCfgInfo r) { ResHeroPromotion resPromotion = CHeroDataFactory.CreateHeroData(l.dwCfgID).promotion(); ResHeroPromotion promotion2 = CHeroDataFactory.CreateHeroData(r.dwCfgID).promotion(); ResHeroShop shop = null; ResHeroShop shop2 = null; GameDataMgr.heroShopInfoDict.TryGetValue(l.dwCfgID, out shop); GameDataMgr.heroShopInfoDict.TryGetValue(r.dwCfgID, out shop2); stPayInfoSet payInfoSetOfGood = CMallSystem.GetPayInfoSetOfGood(l, resPromotion); stPayInfoSet set2 = CMallSystem.GetPayInfoSetOfGood(r, promotion2); uint maxValue = uint.MaxValue; uint payValue = uint.MaxValue; for (int i = 0; i < payInfoSetOfGood.m_payInfoCount; i++) { if ((payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.GoldCoin) && (payInfoSetOfGood.m_payInfos[i].m_payValue <= maxValue)) { maxValue = payInfoSetOfGood.m_payInfos[i].m_payValue; } } for (int j = 0; j < set2.m_payInfoCount; j++) { if ((set2.m_payInfos[j].m_payType == enPayType.GoldCoin) && (set2.m_payInfos[j].m_payValue <= payValue)) { payValue = set2.m_payInfos[j].m_payValue; } } if ((maxValue == uint.MaxValue) && this.IsDesc()) { maxValue = 0; } if ((payValue == uint.MaxValue) && this.IsDesc()) { payValue = 0; } return(maxValue.CompareTo(payValue)); }
private int CompareCoin(ResHeroCfgInfo l, ResHeroCfgInfo r) { ResHeroPromotion resPromotion = CHeroDataFactory.CreateHeroData(l.dwCfgID).promotion(); ResHeroPromotion resPromotion2 = CHeroDataFactory.CreateHeroData(r.dwCfgID).promotion(); ResHeroShop resHeroShop = null; ResHeroShop resHeroShop2 = null; GameDataMgr.heroShopInfoDict.TryGetValue(l.dwCfgID, out resHeroShop); GameDataMgr.heroShopInfoDict.TryGetValue(r.dwCfgID, out resHeroShop2); stPayInfoSet payInfoSetOfGood = CMallSystem.GetPayInfoSetOfGood(l, resPromotion); stPayInfoSet payInfoSetOfGood2 = CMallSystem.GetPayInfoSetOfGood(r, resPromotion2); uint num = 4294967295u; uint num2 = 4294967295u; for (int i = 0; i < payInfoSetOfGood.m_payInfoCount; i++) { if (payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.GoldCoin && payInfoSetOfGood.m_payInfos[i].m_payValue <= num) { num = payInfoSetOfGood.m_payInfos[i].m_payValue; } } for (int j = 0; j < payInfoSetOfGood2.m_payInfoCount; j++) { if (payInfoSetOfGood2.m_payInfos[j].m_payType == enPayType.GoldCoin && payInfoSetOfGood2.m_payInfos[j].m_payValue <= num2) { num2 = payInfoSetOfGood2.m_payInfos[j].m_payValue; } } if (num == 4294967295u && this.IsDesc()) { num = 0u; } if (num2 == 4294967295u && this.IsDesc()) { num2 = 0u; } return(num.CompareTo(num2)); }
private void SetSkinItem(CMallItemWidget mallWidget, ResHeroSkin skinInfo, CUIFormScript form) { Image component = mallWidget.m_icon.GetComponent <Image>(); component.set_color(CUIUtility.s_Color_White); string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_BustHero_Dir, skinInfo.szSkinPicID); component.SetSprite(prefabPath, form, false, true, true, true); mallWidget.m_skinLabel.CustomSetActive(true); CUICommonSystem.SetHeroSkinLabelPic(form, mallWidget.m_skinLabel, skinInfo.dwHeroID, skinInfo.dwSkinID); mallWidget.m_topNameLeftText.GetComponent <Text>().set_text(skinInfo.szHeroName); mallWidget.m_topNameRightText.CustomSetActive(true); mallWidget.m_topNameRightText.GetComponent <Text>().set_text(skinInfo.szSkinName); ResSkinPromotion skinPromotion = CSkinInfo.GetSkinPromotion(skinInfo.dwHeroID, skinInfo.dwSkinID); this._payInfoTemp = CMallSystem.GetPayInfoSetOfGood(skinInfo, skinPromotion); uint commonUInt32Param = this.SetItemPriceInfo(mallWidget, ref this._payInfoTemp); this.SetItemTag(mallWidget, null, skinPromotion, form); stUIEventParams eventParams = default(stUIEventParams); eventParams.openHeroFormPar.heroId = skinInfo.dwHeroID; eventParams.openHeroFormPar.skinId = skinInfo.dwSkinID; eventParams.commonUInt32Param1 = commonUInt32Param; mallWidget.m_item.GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.Mall_GiftShowDetail, eventParams); stUIEventParams eventParams2 = default(stUIEventParams); eventParams2.heroSkinParam.heroId = skinInfo.dwHeroID; eventParams2.heroSkinParam.skinId = skinInfo.dwSkinID; eventParams2.heroSkinParam.isCanCharge = true; eventParams2.commonUInt64Param1 = this._curFriendUid; eventParams2.commonBool = this._curFriendIsSns; eventParams2.commonUInt32Param1 = this._curWorldId; mallWidget.m_buyBtn.GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.HeroSkin_OpenBuyHeroSkinForFriend, eventParams2); CMallItem cMallItem = new CMallItem(skinInfo.dwHeroID, skinInfo.dwSkinID, CMallItem.IconType.Normal); Text componetInChild = Utility.GetComponetInChild <Text>(mallWidget.m_askForBtn, "Text"); Button component2 = mallWidget.m_askForBtn.GetComponent <Button>(); CUIEventScript component3 = mallWidget.m_askForBtn.GetComponent <CUIEventScript>(); if (!cMallItem.CanBeAskFor()) { if (cMallItem.Owned(false) && componetInChild != null) { componetInChild.set_text(Singleton <CTextManager> .GetInstance().GetText("Mall_Skin_State_Own")); } if (component2 != null) { component2.enabled = false; } if (component3 != null) { component3.enabled = false; } } else { if (componetInChild != null) { componetInChild.set_text(Singleton <CTextManager> .GetInstance().GetText("Ask_For_Friend_Op")); } if (component2 != null) { component2.enabled = true; } if (component3 != null) { component3.enabled = true; } mallWidget.m_askForBtn.GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.HeroSkin_OpenAskForFriend, eventParams2); } }
private void SetHeroItem(CMallItemWidget mallWidget, ResHeroCfgInfo heroInfo, CUIFormScript form) { Image component = mallWidget.m_icon.GetComponent <Image>(); component.set_color(CUIUtility.s_Color_White); string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_BustHero_Dir, heroInfo.szImagePath); component.SetSprite(prefabPath, form, false, true, true, true); mallWidget.m_skinLabel.CustomSetActive(false); mallWidget.m_topNameLeftText.GetComponent <Text>().set_text(heroInfo.szName); mallWidget.m_topNameRightText.CustomSetActive(false); IHeroData heroData = CHeroDataFactory.CreateHeroData(heroInfo.dwCfgID); if (heroData != null) { ResHeroPromotion resHeroPromotion = heroData.promotion(); this._payInfoTemp = CMallSystem.GetPayInfoSetOfGood(heroInfo, resHeroPromotion); uint num = this.SetItemPriceInfo(mallWidget, ref this._payInfoTemp); this.SetItemTag(mallWidget, resHeroPromotion, null, form); stUIEventParams eventParams = default(stUIEventParams); eventParams.heroId = heroInfo.dwCfgID; eventParams.commonUInt64Param1 = this._curFriendUid; eventParams.commonBool = this._curFriendIsSns; eventParams.commonUInt32Param1 = this._curWorldId; mallWidget.m_buyBtn.GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.HeroView_OpenBuyHeroForFriend, eventParams); mallWidget.m_item.GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.None, eventParams); CMallItem cMallItem = new CMallItem(heroData.cfgID, CMallItem.IconType.Normal); Text componetInChild = Utility.GetComponetInChild <Text>(mallWidget.m_askForBtn, "Text"); Button component2 = mallWidget.m_askForBtn.GetComponent <Button>(); CUIEventScript component3 = mallWidget.m_askForBtn.GetComponent <CUIEventScript>(); if (!cMallItem.CanBeAskFor()) { if (cMallItem.Owned(false) && componetInChild != null) { componetInChild.set_text(Singleton <CTextManager> .GetInstance().GetText("Mall_Hero_State_Own")); } if (component2 != null) { component2.enabled = false; } if (component3 != null) { component3.enabled = false; } } else { if (componetInChild != null) { componetInChild.set_text(Singleton <CTextManager> .GetInstance().GetText("Ask_For_Friend_Op")); } if (component2 != null) { component2.enabled = true; } if (component3 != null) { component3.enabled = true; } mallWidget.m_askForBtn.GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.HeroView_OpenAskForFriend, eventParams); } } }
private void Draw(CMail mail) { if (this.form != null) { Text componetInChild = Utility.GetComponetInChild <Text>(this.form.gameObject, "Panel/msgContainer/name"); Text componetInChild2 = Utility.GetComponetInChild <Text>(this.form.gameObject, "Panel/msgContainer/msg"); Text componetInChild3 = Utility.GetComponetInChild <Text>(this.form.gameObject, "Panel/msgContainer/from"); if (componetInChild == null || componetInChild2 == null || componetInChild3 == null) { return; } CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo == null) { DebugHelper.Assert(false, "Master Role Info is null"); return; } componetInChild.set_text(string.Format(Singleton <CTextManager> .GetInstance().GetText("Mail_Ask_For_Myself"), masterRoleInfo.Name)); componetInChild2.set_text(mail.mailContent); componetInChild3.set_text(string.Format(Singleton <CTextManager> .GetInstance().GetText("Mail_Ask_For_From", new string[] { mail.from }), new object[0])); if (mail.accessUseable == null || mail.accessUseable.Count == 0) { return; } CUseable cUseable = mail.accessUseable[0]; switch (cUseable.m_type) { case COM_ITEM_TYPE.COM_OBJTYPE_HERO: { ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(cUseable.m_baseID); DebugHelper.Assert(dataByKey != null); if (dataByKey != null) { Text component = this.form.transform.Find("Panel/Title/titleText").GetComponent <Text>(); component.set_text(Singleton <CTextManager> .GetInstance().GetText("Ask_For_Hero_Friend_Title")); Text component2 = this.form.transform.Find("Panel/skinBgImage/skinNameText").GetComponent <Text>(); component2.set_text(StringHelper.UTF8BytesToString(ref dataByKey.szName)); Image component3 = this.form.transform.Find("Panel/skinBgImage/skinIconImage").GetComponent <Image>(); component3.SetSprite(CUIUtility.s_Sprite_Dynamic_BustHero_Dir + StringHelper.UTF8BytesToString(ref dataByKey.szImagePath), this.form, false, true, true, true); this.form.transform.Find("Panel/Panel_Prop").gameObject.CustomSetActive(false); Transform transform = this.form.transform.Find("Panel/skinPricePanel"); Transform costIcon = transform.Find("costImage"); CHeroSkinBuyManager.SetPayCostIcon(this.form, costIcon, enPayType.DianQuan); Transform costTypeText = transform.Find("costTypeText"); CHeroSkinBuyManager.SetPayCostTypeText(costTypeText, enPayType.DianQuan); uint payValue = 0u; IHeroData heroData = CHeroDataFactory.CreateHeroData(cUseable.m_baseID); ResHeroPromotion resPromotion = heroData.promotion(); stPayInfoSet payInfoSetOfGood = CMallSystem.GetPayInfoSetOfGood(dataByKey, resPromotion); for (int i = 0; i < payInfoSetOfGood.m_payInfoCount; i++) { if (payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.Diamond || payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.DianQuan || payInfoSetOfGood.m_payInfos[i].m_payType == enPayType.DiamondAndDianQuan) { payValue = payInfoSetOfGood.m_payInfos[i].m_payValue; break; } } Transform transform2 = transform.Find("costPanel"); if (transform2) { Transform currentPrice = transform2.Find("costText"); CHeroSkinBuyManager.SetPayCurrentPrice(currentPrice, payValue); } } break; } case COM_ITEM_TYPE.COM_OBJTYPE_HEROSKIN: { uint heroId = 0u; uint skinId = 0u; CSkinInfo.ResolveHeroSkin(cUseable.m_baseID, out heroId, out skinId); ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(cUseable.m_baseID); DebugHelper.Assert(heroSkin != null, "heroSkin is null"); if (heroSkin != null) { Text component4 = this.form.transform.Find("Panel/Title/titleText").GetComponent <Text>(); component4.set_text(Singleton <CTextManager> .GetInstance().GetText("Ask_For_Skin_Friend_Title")); Image component5 = this.form.transform.Find("Panel/skinBgImage/skinIconImage").GetComponent <Image>(); string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_BustHero_Dir, StringHelper.UTF8BytesToString(ref heroSkin.szSkinPicID)); component5.SetSprite(prefabPath, this.form, false, true, true, true); Text component6 = this.form.transform.Find("Panel/skinBgImage/skinNameText").GetComponent <Text>(); component6.set_text(StringHelper.UTF8BytesToString(ref heroSkin.szSkinName)); this.form.transform.Find("Panel/Panel_Prop").gameObject.CustomSetActive(true); GameObject gameObject = this.form.transform.Find("Panel/Panel_Prop/List_Prop").gameObject; CSkinInfo.GetHeroSkinProp(heroId, skinId, ref CHeroInfoSystem2.s_propArr, ref CHeroInfoSystem2.s_propPctArr, ref CHeroInfoSystem2.s_propImgArr); CUICommonSystem.SetListProp(gameObject, ref CHeroInfoSystem2.s_propArr, ref CHeroInfoSystem2.s_propPctArr); Transform transform3 = this.form.transform.Find("Panel/skinPricePanel"); Transform costIcon2 = transform3.Find("costImage"); CHeroSkinBuyManager.SetPayCostIcon(this.form, costIcon2, enPayType.DianQuan); Transform costTypeText2 = transform3.Find("costTypeText"); CHeroSkinBuyManager.SetPayCostTypeText(costTypeText2, enPayType.DianQuan); uint payValue2 = 0u; stPayInfoSet skinPayInfoSet = CSkinInfo.GetSkinPayInfoSet(heroId, skinId); for (int j = 0; j < skinPayInfoSet.m_payInfoCount; j++) { if (skinPayInfoSet.m_payInfos[j].m_payType == enPayType.Diamond || skinPayInfoSet.m_payInfos[j].m_payType == enPayType.DianQuan || skinPayInfoSet.m_payInfos[j].m_payType == enPayType.DiamondAndDianQuan) { payValue2 = skinPayInfoSet.m_payInfos[j].m_payValue; break; } } Transform transform4 = transform3.Find("costPanel"); if (transform4 != null) { Transform currentPrice2 = transform4.Find("costText"); CHeroSkinBuyManager.SetPayCurrentPrice(currentPrice2, payValue2); } } break; } } } }