public static void UpdateRankGodTitle(ResHeroCfgInfo heroCfgInfo) { if (heroCfgInfo == null) { return; } CUIFormScript form = Singleton <CUIManager> .get_instance().GetForm(RankingSystem.s_rankingForm); if (form == null) { return; } GameObject gameObject = form.m_formWidgets[19]; if (gameObject == null) { return; } GameObject item = Utility.FindChild(gameObject, "heroItemCell"); CUICommonSystem.SetHeroItemImage(form, item, heroCfgInfo.szImagePath, enHeroHeadType.enIcon, false, false); Utility.GetComponetInChild <Text>(gameObject, "PlayerName").text = Singleton <CTextManager> .get_instance().GetText("RankGodHeroName", new string[] { heroCfgInfo.szHeroTitle, heroCfgInfo.szName }); }
private void RefreshHeroImage() { CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CSymbolSystem.s_symbolFormPath); if (null != form) { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); DebugHelper.Assert(masterRoleInfo != null, "RefreshHeroImage role is null"); if (masterRoleInfo != null) { GameObject widget = form.GetWidget(12); ResHeroCfgInfo dataByKey = null; if (masterRoleInfo.m_symbolInfo.m_selSymbolRcmdHeroId == 0) { dataByKey = GameDataMgr.heroDatabin.GetDataByKey(masterRoleInfo.GetFirstHeroId()); } else { dataByKey = GameDataMgr.heroDatabin.GetDataByKey(masterRoleInfo.m_symbolInfo.m_selSymbolRcmdHeroId); } if (dataByKey != null) { masterRoleInfo.m_symbolInfo.m_selSymbolRcmdHeroId = dataByKey.dwCfgID; this.m_curHeroId = dataByKey.dwCfgID; CUICommonSystem.SetHeroItemImage(form, widget.gameObject, dataByKey.szImagePath, enHeroHeadType.enIcon, false); GameObject obj3 = form.GetWidget(13); if (obj3 != null) { obj3.GetComponent <Text>().text = dataByKey.szName; } } } } }
public static void SetPveHeroItemData(CUIFormScript formScript, GameObject listItem, IHeroData data) { if (listItem == null || data == null) { return; } bool bPlayerOwn = data.bPlayerOwn; Transform transform = listItem.transform; Transform transform2 = transform.Find("heroProficiencyImg"); Transform transform3 = transform.Find("heroProficiencyBgImg"); CUICommonSystem.SetHeroProficiencyIconImage(formScript, transform2.gameObject, (int)data.proficiencyLV); CUICommonSystem.SetHeroProficiencyBgImage(formScript, transform3.gameObject, (int)data.proficiencyLV, false); CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo != null) { transform3.GetComponent <Image>().color = ((!masterRoleInfo.IsHaveHero(data.cfgID, true)) ? CUIUtility.s_Color_GrayShader : Color.white); transform2.GetComponent <Image>().color = ((!masterRoleInfo.IsHaveHero(data.cfgID, true)) ? CUIUtility.s_Color_GrayShader : Color.white); } bool flag = false; bool flag2 = false; if (masterRoleInfo != null) { flag = masterRoleInfo.IsFreeHero(data.cfgID); flag2 = masterRoleInfo.IsCreditFreeHero(data.cfgID); bool flag3 = masterRoleInfo.IsValidExperienceHero(data.cfgID); CUICommonSystem.SetHeroItemImage(formScript, listItem, masterRoleInfo.GetHeroSkinPic(data.cfgID), enHeroHeadType.enBust, !bPlayerOwn && !flag && !flag3, true); } GameObject gameObject = transform.Find("profession").gameObject; CUICommonSystem.SetHeroJob(formScript, gameObject, (enHeroJobType)data.heroType); Text component = transform.Find("heroNameText").GetComponent <Text>(); component.text = data.heroName; Transform transform4 = transform.Find("TxtFree"); Transform transform5 = transform.Find("TxtCreditFree"); if (transform4 != null) { transform4.gameObject.CustomSetActive(flag && !flag2); } if (transform5 != null) { transform5.gameObject.CustomSetActive(flag2); } GameObject gameObject2 = transform.Find("imgExperienceMark").gameObject; gameObject2.CustomSetActive(data.IsValidExperienceHero()); CUIEventScript component2 = listItem.GetComponent <CUIEventScript>(); stUIEventParams eventParams = default(stUIEventParams); eventParams.openHeroFormPar.heroId = data.cfgID; eventParams.openHeroFormPar.openSrc = enHeroFormOpenSrc.HeroListClick; component2.SetUIEvent(enUIEventType.Click, enUIEventID.HeroInfo_OpenForm, eventParams); }
public static void UpdateRankGodTitle(ResHeroCfgInfo heroCfgInfo) { if (heroCfgInfo != null) { CUIFormScript form = Singleton <CUIManager> .instance.GetForm(RankingSystem.s_rankingForm); if (form != null) { GameObject p = form.m_formWidgets[0x13]; if (p != null) { GameObject item = Utility.FindChild(p, "heroItemCell"); CUICommonSystem.SetHeroItemImage(form, item, heroCfgInfo.szImagePath, enHeroHeadType.enIcon, false); string[] args = new string[] { heroCfgInfo.szHeroTitle, heroCfgInfo.szName }; Utility.GetComponetInChild <Text>(p, "PlayerName").text = Singleton <CTextManager> .instance.GetText("RankGodHeroName", args); } } } }
public static void OnHeroItemEnable(CUIEvent uiEvent, ResHeroCfgInfo heroCfgInfo) { if ((heroCfgInfo != null) && (uiEvent.m_srcWidget != null)) { GameObject item = Utility.FindChild(uiEvent.m_srcWidget, "heroItemCell"); if (item != null) { CUICommonSystem.SetHeroItemImage(uiEvent.m_srcFormScript, item, heroCfgInfo.szImagePath, enHeroHeadType.enIcon, false); CUIEventScript component = item.GetComponent <CUIEventScript>(); if (component != null) { stUIEventParams eventParams = new stUIEventParams { heroId = heroCfgInfo.dwCfgID }; component.SetUIEvent(enUIEventType.Click, enUIEventID.Ranking_HeroChg_Hero_Click, eventParams); } Utility.FindChild(item, "TxtFree").CustomSetActive(false); Utility.FindChild(item, "equipedPanel").CustomSetActive(false); } } }
private void RefreshHeroImage() { CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CSymbolSystem.s_symbolFormPath); if (null == form) { return; } CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); DebugHelper.Assert(masterRoleInfo != null, "RefreshHeroImage role is null"); if (masterRoleInfo == null) { return; } GameObject gameObject = Utility.FindChild(form.gameObject, "SymbolRecommend/Panel_SymbolRecommend/heroItemCell"); ResHeroCfgInfo dataByKey; if (masterRoleInfo.m_symbolInfo.m_selSymbolRcmdHeroId == 0u) { dataByKey = GameDataMgr.heroDatabin.GetDataByKey(masterRoleInfo.GetFirstHeroId()); } else { dataByKey = GameDataMgr.heroDatabin.GetDataByKey(masterRoleInfo.m_symbolInfo.m_selSymbolRcmdHeroId); } if (dataByKey == null) { return; } masterRoleInfo.m_symbolInfo.m_selSymbolRcmdHeroId = dataByKey.dwCfgID; this.m_curHeroId = dataByKey.dwCfgID; CUICommonSystem.SetHeroItemImage(form, gameObject.gameObject, dataByKey.szImagePath, enHeroHeadType.enIcon, false, false); GameObject gameObject2 = Utility.FindChild(form.gameObject, "SymbolRecommend/Panel_SymbolRecommend/heroNameText"); if (gameObject2 != null) { gameObject2.GetComponent <Text>().text = dataByKey.szName; } }
private void OnHeroListElementEnable(CUIEvent uiEvent) { int srcWidgetIndexInBelongedList = uiEvent.m_srcWidgetIndexInBelongedList; if (srcWidgetIndexInBelongedList < 0 || srcWidgetIndexInBelongedList >= this.m_heroList.get_Count()) { return; } CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); DebugHelper.Assert(masterRoleInfo != null, "CSymbolRcmdCtrl OnHeroListElementEnable role is null"); if (masterRoleInfo == null || masterRoleInfo.m_customRecommendEquipDictionary == null) { return; } ResHeroCfgInfo resHeroCfgInfo = this.m_heroList.get_Item(srcWidgetIndexInBelongedList); if (resHeroCfgInfo != null && uiEvent.m_srcWidget != null) { Transform transform = uiEvent.m_srcWidget.transform.Find("heroItemCell"); if (transform != null) { CUICommonSystem.SetHeroItemImage(uiEvent.m_srcFormScript, transform.gameObject, resHeroCfgInfo.szImagePath, enHeroHeadType.enIcon, !masterRoleInfo.IsHaveHero(resHeroCfgInfo.dwCfgID, false), false); CUIEventScript component = transform.GetComponent <CUIEventScript>(); if (component != null) { component.SetUIEvent(enUIEventType.Click, enUIEventID.SymbolRcmd_HeroListItemClick, new stUIEventParams { heroId = resHeroCfgInfo.dwCfgID }); } Transform transform2 = transform.Find("TxtFree"); if (transform2 != null) { transform2.gameObject.CustomSetActive(masterRoleInfo.IsFreeHero(resHeroCfgInfo.dwCfgID)); } } } }
public static void OnHeroItemEnable(CUIEvent uiEvent, ResHeroCfgInfo heroCfgInfo) { if (heroCfgInfo != null && uiEvent.m_srcWidget != null) { GameObject gameObject = Utility.FindChild(uiEvent.m_srcWidget, "heroItemCell"); if (gameObject != null) { CUICommonSystem.SetHeroItemImage(uiEvent.m_srcFormScript, gameObject, heroCfgInfo.szImagePath, enHeroHeadType.enIcon, false, false); CUIEventScript component = gameObject.GetComponent <CUIEventScript>(); if (component != null) { component.SetUIEvent(enUIEventType.Click, enUIEventID.Ranking_HeroChg_Hero_Click, new stUIEventParams { heroId = heroCfgInfo.dwCfgID }); } GameObject obj = Utility.FindChild(gameObject, "TxtFree"); obj.CustomSetActive(false); GameObject obj2 = Utility.FindChild(gameObject, "equipedPanel"); obj2.CustomSetActive(false); } } }
private void OnCommonHeroItemEnable(CUIEvent uiEvent) { CPlayerProfile profile = Singleton <CPlayerInfoSystem> .get_instance().GetProfile(); int srcWidgetIndexInBelongedList = uiEvent.m_srcWidgetIndexInBelongedList; GameObject srcWidget = uiEvent.m_srcWidget; GameObject gameObject = Utility.FindChild(srcWidget, "heroItem"); ListView <COMDT_MOST_USED_HERO_INFO> listView = profile.MostUsedHeroList(); if (listView == null || srcWidgetIndexInBelongedList >= listView.get_Count()) { return; } COMDT_MOST_USED_HERO_INFO cOMDT_MOST_USED_HERO_INFO = listView.get_Item(srcWidgetIndexInBelongedList); CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo == null) { return; } IHeroData heroData = CHeroDataFactory.CreateHeroData(cOMDT_MOST_USED_HERO_INFO.dwHeroID); GameObject proficiencyIcon = Utility.FindChild(gameObject, "heroProficiencyImg"); GameObject proficiencyBg = Utility.FindChild(gameObject, "heroProficiencyBgImg"); CUICommonSystem.SetHeroProficiencyIconImage(uiEvent.m_srcFormScript, proficiencyIcon, (int)cOMDT_MOST_USED_HERO_INFO.dwProficiencyLv); CUICommonSystem.SetHeroProficiencyBgImage(uiEvent.m_srcFormScript, proficiencyBg, (int)cOMDT_MOST_USED_HERO_INFO.dwProficiencyLv, false); if (!CPlayerInfoSystem.isSelf(profile.m_uuid)) { CUICommonSystem.SetHeroItemImage(uiEvent.m_srcFormScript, gameObject, CSkinInfo.GetHeroSkinPic(cOMDT_MOST_USED_HERO_INFO.dwHeroID, cOMDT_MOST_USED_HERO_INFO.dwSkinID), enHeroHeadType.enBust, false, true); } else { CUICommonSystem.SetHeroItemImage(uiEvent.m_srcFormScript, gameObject, masterRoleInfo.GetHeroSkinPic(cOMDT_MOST_USED_HERO_INFO.dwHeroID), enHeroHeadType.enBust, false, true); } GameObject root = Utility.FindChild(gameObject, "profession"); CUICommonSystem.SetHeroJob(uiEvent.m_srcFormScript, root, (enHeroJobType)heroData.heroType); Text componetInChild = Utility.GetComponetInChild <Text>(gameObject, "heroNameText"); componetInChild.text = heroData.heroName; Text componetInChild2 = Utility.GetComponetInChild <Text>(gameObject, "TotalCount"); componetInChild2.text = Singleton <CTextManager> .get_instance().GetText("Player_Info_PVP_Total_Count", new string[] { (cOMDT_MOST_USED_HERO_INFO.dwGameWinNum + cOMDT_MOST_USED_HERO_INFO.dwGameLoseNum).ToString() }); Text componetInChild3 = Utility.GetComponetInChild <Text>(gameObject, "WinRate"); componetInChild3.text = Singleton <CTextManager> .get_instance().GetText("Player_Info_PVP_Win_Rate", new string[] { CPlayerProfile.Round(CPlayerProfile.Divide(cOMDT_MOST_USED_HERO_INFO.dwGameWinNum, cOMDT_MOST_USED_HERO_INFO.dwGameWinNum + cOMDT_MOST_USED_HERO_INFO.dwGameLoseNum) * 100f) }); ulong num = 0uL; ulong num2 = 0uL; ulong num3 = 0uL; uint num4 = 0u; COMDT_HERO_STATISTIC_DETAIL stStatisticDetail = cOMDT_MOST_USED_HERO_INFO.stStatisticDetail; uint dwNum = stStatisticDetail.dwNum; int num5 = 0; while ((long)num5 < (long)((ulong)dwNum)) { COMDT_HERO_STATISTIC_INFO cOMDT_HERO_STATISTIC_INFO = stStatisticDetail.astTypeDetail[num5]; num += cOMDT_HERO_STATISTIC_INFO.ullKDAPct; num2 += cOMDT_HERO_STATISTIC_INFO.ullTotalHurtHero; num3 += cOMDT_HERO_STATISTIC_INFO.ullTotalBeHurt; num4 = num4 + cOMDT_HERO_STATISTIC_INFO.dwWinNum + cOMDT_HERO_STATISTIC_INFO.dwLoseNum; num5++; } num4 = ((num4 != 0u) ? num4 : 1u); Utility.GetComponetInChild <Text>(gameObject, "AverKDA").text = Singleton <CTextManager> .get_instance().GetText("Player_Info_PVP_AverKDA", new string[] { (num / (ulong)num4 / 100uL).ToString("0.0") }); Utility.GetComponetInChild <Text>(gameObject, "AverHurt").text = Singleton <CTextManager> .get_instance().GetText("Player_Info_PVP_AverHurt", new string[] { (num2 / (ulong)num4).ToString("d") }); Utility.GetComponetInChild <Text>(gameObject, "AverTakenHurt").text = Singleton <CTextManager> .get_instance().GetText("Player_Info_PVP_AverTakenHurt", new string[] { (num3 / (ulong)num4).ToString("d") }); }
private void UpdateItem(CUIEvent uiEvent, COMDT_AKALISHOP_GOODS productInfo) { if (productInfo == null) { return; } CUIFormScript srcFormScript = uiEvent.m_srcFormScript; GameObject srcWidget = uiEvent.m_srcWidget; if (srcFormScript == null || srcWidget == null) { return; } CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); DebugHelper.Assert(masterRoleInfo != null, "master roleInfo is null"); if (masterRoleInfo == null) { return; } GameObject gameObject = Utility.FindChild(srcWidget, "heroItem"); if (gameObject == null) { DebugHelper.Assert(gameObject != null, "hero item is null"); return; } GameObject gameObject2 = Utility.FindChild(srcWidget, "defualtItem"); if (gameObject2 != null) { gameObject2.CustomSetActive(false); } if (gameObject != null) { gameObject.CustomSetActive(true); } Text componetInChild = Utility.GetComponetInChild <Text>(gameObject, "heroDataPanel/heroNamePanel/heroNameText"); GameObject gameObject3 = Utility.FindChild(gameObject, "heroDataPanel/heroNamePanel/heroSkinText"); if (gameObject3 == null) { return; } Text component = gameObject3.GetComponent <Text>(); GameObject gameObject4 = Utility.FindChild(gameObject, "tag"); if (gameObject4 == null) { return; } GameObject gameObject5 = Utility.FindChild(gameObject, "profession"); if (gameObject5 == null) { return; } GameObject gameObject6 = Utility.FindChild(srcWidget, "imgExperienceMark"); if (gameObject6 == null) { return; } if (gameObject6) { gameObject6.CustomSetActive(true); } GameObject gameObject7 = Utility.FindChild(gameObject, "skinLabelImage"); if (gameObject7 == null) { return; } GameObject gameObject8 = Utility.FindChild(gameObject, "heroDataPanel/heroPricePanel"); if (gameObject8 == null) { return; } gameObject8.CustomSetActive(false); GameObject gameObject9 = Utility.FindChild(srcWidget, "ButtonGroup/BuyBtn"); if (gameObject9 == null) { return; } gameObject9.CustomSetActive(false); Text componetInChild2 = Utility.GetComponetInChild <Text>(gameObject9, "Text"); Button component2 = gameObject9.GetComponent <Button>(); if (component2 == null) { return; } CUIEventScript component3 = gameObject9.GetComponent <CUIEventScript>(); if (component3 == null) { return; } component3.enabled = false; component2.enabled = false; GameObject gameObject10 = Utility.FindChild(srcWidget, "ButtonGroup/LinkBtn"); if (gameObject10 == null) { return; } gameObject10.CustomSetActive(false); Text componetInChild3 = Utility.GetComponetInChild <Text>(gameObject10, "Text"); Button component4 = gameObject10.GetComponent <Button>(); if (component4 == null) { return; } CUIEventScript component5 = gameObject10.GetComponent <CUIEventScript>(); if (component5 == null) { return; } component5.enabled = false; component4.enabled = false; COM_ITEM_TYPE wItemType = (COM_ITEM_TYPE)productInfo.wItemType; uint dwItemID = productInfo.dwItemID; switch (wItemType) { case COM_ITEM_TYPE.COM_OBJTYPE_HERO: { ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(dwItemID); DebugHelper.Assert(dataByKey != null, "神秘商店配置的英雄ID有错,英雄表里不存在"); if (dataByKey == null) { return; } ResHeroShop resHeroShop = null; GameDataMgr.heroShopInfoDict.TryGetValue(dataByKey.dwCfgID, out resHeroShop); CUICommonSystem.SetHeroItemImage(uiEvent.m_srcFormScript, gameObject, StringHelper.UTF8BytesToString(ref dataByKey.szImagePath), enHeroHeadType.enBust, false, true); gameObject5.CustomSetActive(false); gameObject7.CustomSetActive(false); gameObject3.CustomSetActive(false); if (componetInChild != null) { componetInChild.set_text(StringHelper.UTF8BytesToString(ref dataByKey.szName)); } if (masterRoleInfo.IsHaveHero(dataByKey.dwCfgID, false)) { gameObject9.CustomSetActive(true); componetInChild2.set_text(Singleton <CTextManager> .GetInstance().GetText("Mall_Hero_State_Own")); gameObject4.CustomSetActive(false); gameObject6.CustomSetActive(false); } else { gameObject6.CustomSetActive(masterRoleInfo.IsValidExperienceHero(dataByKey.dwCfgID)); gameObject8.CustomSetActive(true); gameObject9.CustomSetActive(true); componetInChild2.set_text(Singleton <CTextManager> .GetInstance().GetText("Mall_Buy")); component3.enabled = true; component2.enabled = true; this.UpdateItemPricePnl(srcFormScript, gameObject8.transform, gameObject4.transform, productInfo); component3.SetUIEvent(enUIEventType.Click, enUIEventID.Mall_Mystery_On_Open_Buy_Form, new stUIEventParams { tag = uiEvent.m_srcWidgetIndexInBelongedList }); } break; } case COM_ITEM_TYPE.COM_OBJTYPE_HEROSKIN: { ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(dwItemID); DebugHelper.Assert(heroSkin != null, "神秘商店配置的皮肤ID有错,皮肤表里不存在"); if (heroSkin == null) { return; } ResHeroSkinShop resHeroSkinShop = null; GameDataMgr.skinShopInfoDict.TryGetValue(heroSkin.dwSkinID, out resHeroSkinShop); ResHeroCfgInfo dataByKey2 = GameDataMgr.heroDatabin.GetDataByKey(heroSkin.dwHeroID); DebugHelper.Assert(dataByKey2 != null, "神秘商店配置的皮肤ID有错,皮肤对应的英雄不存在"); if (dataByKey2 == null) { return; } CUICommonSystem.SetHeroItemImage(uiEvent.m_srcFormScript, gameObject.gameObject, heroSkin.szSkinPicID, enHeroHeadType.enBust, false, true); gameObject5.CustomSetActive(false); CUICommonSystem.SetHeroSkinLabelPic(uiEvent.m_srcFormScript, gameObject7, heroSkin.dwHeroID, heroSkin.dwSkinID); gameObject3.CustomSetActive(true); if (componetInChild != null) { componetInChild.set_text(StringHelper.UTF8BytesToString(ref dataByKey2.szName)); } if (component != null) { component.set_text(StringHelper.UTF8BytesToString(ref heroSkin.szSkinName)); } if (masterRoleInfo.IsHaveHeroSkin(heroSkin.dwHeroID, heroSkin.dwSkinID, false)) { gameObject9.CustomSetActive(true); componetInChild2.set_text(Singleton <CTextManager> .GetInstance().GetText("Mall_Skin_State_Own")); gameObject4.CustomSetActive(false); gameObject6.CustomSetActive(false); } else { gameObject6.CustomSetActive(masterRoleInfo.IsValidExperienceSkin(heroSkin.dwHeroID, heroSkin.dwSkinID)); gameObject8.CustomSetActive(true); gameObject10.CustomSetActive(false); this.UpdateItemPricePnl(srcFormScript, gameObject8.transform, gameObject4.transform, productInfo); if (masterRoleInfo.IsCanBuySkinButNotHaveHero(heroSkin.dwHeroID, heroSkin.dwSkinID)) { gameObject9.CustomSetActive(true); component3.enabled = true; componetInChild2.set_text(Singleton <CTextManager> .GetInstance().GetText("Mall_Skin_State_Buy_hero")); component2.enabled = true; stUIEventParams eventParams = default(stUIEventParams); eventParams.openHeroFormPar.heroId = heroSkin.dwHeroID; eventParams.openHeroFormPar.skinId = heroSkin.dwSkinID; eventParams.openHeroFormPar.openSrc = enHeroFormOpenSrc.SkinBuyClick; component3.SetUIEvent(enUIEventType.Click, enUIEventID.HeroInfo_OpenForm, eventParams); this.UpdateItemPricePnl(srcFormScript, gameObject8.transform, gameObject4.transform, productInfo); } else { gameObject10.CustomSetActive(false); gameObject9.CustomSetActive(true); componetInChild2.set_text(Singleton <CTextManager> .GetInstance().GetText("Mall_Buy")); component3.enabled = true; component2.enabled = true; component3.SetUIEvent(enUIEventType.Click, enUIEventID.Mall_Mystery_On_Open_Buy_Form, new stUIEventParams { tag = uiEvent.m_srcWidgetIndexInBelongedList }); } } break; } } }
public void UpdateView(CUIEvent uiEvent) { CUIFormScript srcFormScript = uiEvent.m_srcFormScript; GameObject srcWidget = uiEvent.m_srcWidget; if ((srcFormScript != null) && (srcWidget != null)) { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); DebugHelper.Assert(masterRoleInfo != null, "master roleInfo is null"); if (masterRoleInfo != null) { GameObject p = Utility.FindChild(srcWidget, "heroItem"); if (p == null) { DebugHelper.Assert(p != null, "hero item is null"); } else { Text componetInChild = Utility.GetComponetInChild <Text>(p, "heroDataPanel/heroNamePanel/heroNameText"); GameObject obj4 = Utility.FindChild(p, "heroDataPanel/heroNamePanel/heroSkinText"); if (obj4 != null) { Text component = obj4.GetComponent <Text>(); GameObject obj5 = Utility.FindChild(p, "tag"); if (obj5 != null) { GameObject obj6 = Utility.FindChild(p, "profession"); if (obj6 != null) { GameObject obj7 = Utility.FindChild(srcWidget, "imgExperienceMark"); if (obj7 != null) { GameObject obj8 = Utility.FindChild(p, "skinLabelImage"); if (obj8 != null) { GameObject obj9 = Utility.FindChild(p, "heroDataPanel/heroPricePanel"); if (obj9 != null) { obj9.CustomSetActive(false); GameObject obj10 = Utility.FindChild(srcWidget, "ButtonGroup/BuyBtn"); if (obj10 != null) { obj10.CustomSetActive(false); Text text3 = Utility.GetComponetInChild <Text>(obj10, "Text"); Button button = obj10.GetComponent <Button>(); if (button != null) { CUIEventScript script2 = obj10.GetComponent <CUIEventScript>(); if (script2 != null) { script2.enabled = false; button.enabled = false; GameObject obj11 = Utility.FindChild(srcWidget, "ButtonGroup/LinkBtn"); if (obj11 != null) { obj11.CustomSetActive(false); Text text4 = Utility.GetComponetInChild <Text>(obj11, "Text"); Button button2 = obj11.GetComponent <Button>(); if (button2 != null) { CUIEventScript script3 = obj11.GetComponent <CUIEventScript>(); if (script3 != null) { script3.enabled = false; button2.enabled = false; switch (this.m_ItemType) { case COM_ITEM_TYPE.COM_OBJTYPE_HERO: { ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(this.m_itemID); DebugHelper.Assert(dataByKey != null, "神秘商店配置的英雄ID有错,英雄表里不存在"); if (dataByKey != null) { CUICommonSystem.SetHeroItemImage(uiEvent.m_srcFormScript, p, StringHelper.UTF8BytesToString(ref dataByKey.szImagePath), enHeroHeadType.enBust, false); obj6.CustomSetActive(true); CUICommonSystem.SetHeroJob(srcFormScript, obj6, (enHeroJobType)dataByKey.bJob); obj8.CustomSetActive(false); obj4.CustomSetActive(false); if (componetInChild != null) { componetInChild.text = StringHelper.UTF8BytesToString(ref dataByKey.szName); } if (masterRoleInfo.IsHaveHero(dataByKey.dwCfgID, false)) { obj10.CustomSetActive(true); text3.text = Singleton <CTextManager> .GetInstance().GetText("Mall_Hero_State_Own"); obj5.CustomSetActive(false); obj7.CustomSetActive(false); } else { obj7.CustomSetActive(masterRoleInfo.IsValidExperienceHero(dataByKey.dwCfgID)); stPayInfoSet lowestPayInfoSetOfGood = CMallSystem.GetLowestPayInfoSetOfGood(dataByKey, CMallSystem.ResBuyTypeToPayType(this.Cfg.bMoneyType)); if (lowestPayInfoSetOfGood.m_payInfoCount == 0) { obj11.CustomSetActive(true); text4.text = StringHelper.UTF8BytesToString(ref dataByKey.szObtWay); if (dataByKey.bObtWayType > 0) { script3.enabled = true; button2.enabled = true; stUIEventParams eventParams = new stUIEventParams { tag = dataByKey.bObtWayType }; script3.SetUIEvent(enUIEventType.Click, enUIEventID.Mall_Jump_Form, eventParams); } else { script3.enabled = false; button2.enabled = false; } } else { obj9.CustomSetActive(true); obj10.CustomSetActive(true); text3.text = Singleton <CTextManager> .GetInstance().GetText("Mall_Buy"); script2.enabled = true; button.enabled = true; this.UpdateItemPricePnl(srcFormScript, obj9.transform, obj5.transform, ref lowestPayInfoSetOfGood); stUIEventParams params2 = new stUIEventParams { tag = uiEvent.m_srcWidgetIndexInBelongedList }; script2.SetUIEvent(enUIEventType.Click, enUIEventID.Mall_Mystery_On_Open_Buy_Form, params2); } } break; } return; } case COM_ITEM_TYPE.COM_OBJTYPE_HEROSKIN: { ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(this.m_itemID); DebugHelper.Assert(heroSkin != null, "神秘商店配置的皮肤ID有错,皮肤表里不存在"); if (heroSkin != null) { ResHeroCfgInfo info3 = GameDataMgr.heroDatabin.GetDataByKey(heroSkin.dwHeroID); DebugHelper.Assert(info3 != null, "神秘商店配置的皮肤ID有错,皮肤对应的英雄不存在"); if (info3 == null) { return; } CUICommonSystem.SetHeroItemImage(uiEvent.m_srcFormScript, p.gameObject, heroSkin.szSkinPicID, enHeroHeadType.enBust, false); obj6.CustomSetActive(false); CUICommonSystem.SetHeroSkinLabelPic(uiEvent.m_srcFormScript, obj8, heroSkin.dwHeroID, heroSkin.dwSkinID); obj4.CustomSetActive(true); if (componetInChild != null) { componetInChild.text = StringHelper.UTF8BytesToString(ref info3.szName); } if (component != null) { component.text = StringHelper.UTF8BytesToString(ref heroSkin.szSkinName); } if (masterRoleInfo.IsHaveHeroSkin(heroSkin.dwHeroID, heroSkin.dwSkinID, false)) { obj10.CustomSetActive(true); text3.text = Singleton <CTextManager> .GetInstance().GetText("Mall_Skin_State_Own"); obj5.CustomSetActive(false); obj7.CustomSetActive(false); } else { obj7.CustomSetActive(masterRoleInfo.IsValidExperienceSkin(heroSkin.dwHeroID, heroSkin.dwSkinID)); obj9.CustomSetActive(true); stPayInfoSet payInfoSet = CMallSystem.GetLowestPayInfoSetOfGood(heroSkin, CMallSystem.ResBuyTypeToPayType(this.Cfg.bMoneyType)); if (payInfoSet.m_payInfoCount == 0) { obj11.CustomSetActive(true); text4.text = StringHelper.UTF8BytesToString(ref heroSkin.szGetPath); } else { obj11.CustomSetActive(false); this.UpdateItemPricePnl(srcFormScript, obj9.transform, obj5.transform, ref payInfoSet); } if (masterRoleInfo.IsCanBuySkinButNotHaveHero(heroSkin.dwHeroID, heroSkin.dwSkinID)) { obj10.CustomSetActive(true); script2.enabled = true; text3.text = Singleton <CTextManager> .GetInstance().GetText("Mall_Skin_State_Buy_hero"); button.enabled = true; stUIEventParams params3 = new stUIEventParams(); params3.openHeroFormPar.heroId = heroSkin.dwHeroID; params3.openHeroFormPar.skinId = heroSkin.dwSkinID; params3.openHeroFormPar.openSrc = enHeroFormOpenSrc.SkinBuyClick; script2.SetUIEvent(enUIEventType.Click, enUIEventID.HeroInfo_OpenForm, params3); if (payInfoSet.m_payInfoCount > 0) { this.UpdateItemPricePnl(srcFormScript, obj9.transform, obj5.transform, ref payInfoSet); } } else { obj11.CustomSetActive(false); obj10.CustomSetActive(true); text3.text = Singleton <CTextManager> .GetInstance().GetText("Mall_Buy"); script2.enabled = true; button.enabled = true; stUIEventParams params4 = new stUIEventParams { tag = uiEvent.m_srcWidgetIndexInBelongedList }; script2.SetUIEvent(enUIEventType.Click, enUIEventID.Mall_Mystery_On_Open_Buy_Form, params4); } } break; } return; } } } } } } } } } } } } } } } } } }