private static void ShowMultiLoading() { CUIFormScript cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm(CUILoadingSystem.PVP_PATH_LOADING, false, false); if (cUIFormScript == null) { return; } if (!Singleton <CUIEventManager> .GetInstance().HasUIEventListener(enUIEventID.IntimacyRela_LoadingClick)) { Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.IntimacyRela_LoadingClick, new CUIEventManager.OnUIEventHandler(CUILoadingSystem.On_IntimacyRela_LoadingClick)); } SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext(); IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.StaticBattleDataProvider); IGameActorDataProvider actorDataProvider2 = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.ServerDataProvider); ActorStaticData actorStaticData = default(ActorStaticData); ActorMeta actorMeta = default(ActorMeta); ActorMeta actorMeta2 = default(ActorMeta); ActorServerData actorServerData = default(ActorServerData); actorMeta.ActorType = ActorTypeDef.Actor_Type_Hero; for (int i = 1; i <= 2; i++) { List <Player> allCampPlayers = Singleton <GamePlayerCenter> .GetInstance().GetAllCampPlayers((COM_PLAYERCAMP)i); if (allCampPlayers == null) { DebugHelper.Assert(false, "Loading Players is Null"); } else { Transform transform = (i == 1) ? cUIFormScript.transform.FindChild("UpPanel") : cUIFormScript.transform.FindChild("DownPanel"); int num = 1; while ((long)num <= 5L) { string name = (i == 1) ? string.Format("Up_Player{0}", num) : string.Format("Down_Player{0}", num); GameObject gameObject = transform.FindChild(name).gameObject; gameObject.CustomSetActive(false); num++; } List <Player> .Enumerator enumerator = allCampPlayers.GetEnumerator(); Player hostPlayer = Singleton <GamePlayerCenter> .instance.GetHostPlayer(); COM_PLAYERCAMP playerCamp = hostPlayer.PlayerCamp; while (enumerator.MoveNext()) { Player current = enumerator.get_Current(); if (current != null) { bool flag = current.PlayerId == hostPlayer.PlayerId; string name2 = (i == 1) ? string.Format("Up_Player{0}", current.CampPos + 1) : string.Format("Down_Player{0}", current.CampPos + 1); GameObject gameObject2 = transform.FindChild(name2).gameObject; gameObject2.CustomSetActive(true); GameObject gameObject3 = gameObject2.transform.Find("RankFrame").gameObject; bool flag2 = current.PlayerCamp == playerCamp && (!Singleton <WatchController> .GetInstance().IsWatching || !Singleton <WatchController> .GetInstance().IsReplaying); if (gameObject3 != null) { if (flag2) { string rankFrameIconPath = CLadderView.GetRankFrameIconPath((byte)current.GradeOfRank, current.ClassOfRank); if (string.IsNullOrEmpty(rankFrameIconPath)) { gameObject3.CustomSetActive(false); } else { Image component = gameObject3.GetComponent <Image>(); if (component != null) { component.SetSprite(rankFrameIconPath, cUIFormScript, true, false, false, false); } gameObject3.CustomSetActive(true); } } else { gameObject3.CustomSetActive(false); } } Transform transform2 = gameObject2.transform.Find("RankClassText"); if (transform2 != null) { GameObject gameObject4 = transform2.gameObject; if (flag2 && CLadderView.IsSuperKing((byte)current.GradeOfRank, current.ClassOfRank)) { gameObject4.CustomSetActive(true); gameObject4.GetComponent <Text>().set_text(current.ClassOfRank.ToString()); } else { gameObject4.CustomSetActive(false); } } Text component2 = gameObject2.transform.Find("Txt_PlayerName/Name").gameObject.GetComponent <Text>(); component2.set_text(current.Name); Image component3 = gameObject2.transform.Find("Txt_PlayerName/NobeIcon").gameObject.GetComponent <Image>(); if (component3) { MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(component3, (int)current.VipLv, true, flag, current.privacyBits); } Text component4 = gameObject2.transform.Find("Txt_HeroName").gameObject.GetComponent <Text>(); actorMeta.ConfigId = (int)current.CaptainId; component4.set_text(actorDataProvider.GetActorStaticData(ref actorMeta, ref actorStaticData) ? actorStaticData.TheResInfo.Name : null); GameObject gameObject5 = gameObject2.transform.Find("Txt_Qinmidu").gameObject; if (gameObject5 != null) { if (current.IntimacyData != null) { gameObject5.CustomSetActive(true); Text component5 = gameObject5.transform.Find("Text").gameObject.GetComponent <Text>(); if (component5 != null) { component5.set_text(current.IntimacyData.title); } GameObject gameObject6 = gameObject5.transform.Find("BlueBg").gameObject; GameObject gameObject7 = gameObject5.transform.Find("RedBg").gameObject; if (current.IntimacyData.state == COM_INTIMACY_STATE.COM_INTIMACY_STATE_GAY || current.IntimacyData.state == COM_INTIMACY_STATE.COM_INTIMACY_STATE_SIDEKICK) { gameObject6.CustomSetActive(true); gameObject7.CustomSetActive(false); } else if (current.IntimacyData.state == COM_INTIMACY_STATE.COM_INTIMACY_STATE_LOVER || current.IntimacyData.state == COM_INTIMACY_STATE.COM_INTIMACY_STATE_BESTIE) { gameObject6.CustomSetActive(false); gameObject7.CustomSetActive(true); } } else { gameObject5.CustomSetActive(false); } } GameObject gameObject8 = gameObject2.transform.Find("btns").gameObject; if (gameObject8 != null) { if (current.IntimacyData != null && IntimacyRelationViewUT.IsRelaState(current.IntimacyData.state)) { int relaLevel = IntimacyRelationViewUT.CalcRelaLevel(current.IntimacyData.intimacyValue); string relaIconByRelaLevel = IntimacyRelationViewUT.GetRelaIconByRelaLevel(relaLevel, current.IntimacyData.state); if (!string.IsNullOrEmpty(relaIconByRelaLevel)) { Image componetInChild = Utility.GetComponetInChild <Image>(gameObject8, "btnRela"); if (componetInChild != null) { componetInChild.gameObject.CustomSetActive(true); componetInChild.SetSprite(relaIconByRelaLevel, cUIFormScript, true, false, false, false); } } } else { gameObject8.CustomSetActive(false); } } component2.set_color(Color.white); GameObject gameObject9 = gameObject2.transform.Find("Txt_PlayerName_Mine").gameObject; if (flag) { gameObject9.CustomSetActive(true); } else { gameObject9.CustomSetActive(false); } GameObject gameObject10 = gameObject2.transform.Find("Txt_LoadingPct").gameObject; if (gameObject10) { Text component6 = gameObject10.GetComponent <Text>(); if (current.Computer) { component6.set_text(curLvelContext.m_isWarmBattle ? "1%" : "100%"); } else { component6.set_text((MonoSingleton <Reconnection> .instance.isProcessingRelayRecover || Singleton <WatchController> .GetInstance().IsWatching) ? "100%" : "1%"); } } ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(current.CaptainId); if (dataByKey != null) { actorMeta2.PlayerId = current.PlayerId; actorMeta2.ActorCamp = (COM_PLAYERCAMP)i; actorMeta2.ConfigId = (int)dataByKey.dwCfgID; actorMeta2.ActorType = ActorTypeDef.Actor_Type_Hero; Image component7 = gameObject2.transform.Find("Hero").gameObject.GetComponent <Image>(); if (actorDataProvider2.GetActorServerData(ref actorMeta2, ref actorServerData)) { ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin((uint)actorServerData.TheActorMeta.ConfigId, actorServerData.SkinId); if (heroSkin != null) { component7.SetSprite(CUIUtility.s_Sprite_Dynamic_BustHero_Dir + StringHelper.UTF8BytesToString(ref heroSkin.szSkinPicID), cUIFormScript, true, false, false, true); if (heroSkin.dwSkinID > 0u) { component4.set_text(string.Format(Singleton <CTextManager> .GetInstance().GetText("LoadingSkinNameTxt"), heroSkin.szSkinName, heroSkin.szHeroName)); } if (flag) { component4.set_color(CUIUtility.s_Text_Color_MyHeroName); Outline component8 = component4.gameObject.GetComponent <Outline>(); if (component8 != null) { component8.set_effectColor(CUIUtility.s_Text_OutLineColor_MyHeroName); } } } bool flag3 = current.PlayerCamp == playerCamp && (!Singleton <WatchController> .GetInstance().IsWatching || !Singleton <WatchController> .GetInstance().IsReplaying) && (curLvelContext.m_isWarmBattle || !current.Computer); Transform transform3 = gameObject2.transform.Find("heroProficiencyBgImg"); if (transform3 != null) { transform3.gameObject.CustomSetActive(flag3); if (flag3) { CUICommonSystem.SetHeroProficiencyBgImage(cUIFormScript, transform3.gameObject, (int)actorServerData.TheProficiencyInfo.Level, true); } } Transform transform4 = gameObject2.transform.Find("heroProficiencyImg"); if (transform4 != null) { transform4.gameObject.CustomSetActive(flag3); if (flag3) { CUICommonSystem.SetHeroProficiencyIconImage(cUIFormScript, transform4.gameObject, (int)actorServerData.TheProficiencyInfo.Level); } } } else { component7.SetSprite(CUIUtility.s_Sprite_Dynamic_BustHero_Dir + StringHelper.UTF8BytesToString(ref dataByKey.szImagePath), cUIFormScript, true, false, false, true); } uint num2 = 0u; if (actorDataProvider2.GetActorServerCommonSkillData(ref actorMeta2, out num2) && num2 != 0u) { ResSkillCfgInfo dataByKey2 = GameDataMgr.skillDatabin.GetDataByKey(num2); if (dataByKey2 != null) { gameObject2.transform.Find("SelSkill").gameObject.CustomSetActive(true); string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Skill_Dir, Utility.UTF8Convert(dataByKey2.szIconPath)); Image component9 = gameObject2.transform.Find("SelSkill/Icon").GetComponent <Image>(); component9.SetSprite(prefabPath, cUIFormScript.GetComponent <CUIFormScript>(), true, false, false, false); } else { gameObject2.transform.Find("SelSkill").gameObject.CustomSetActive(false); } } else { gameObject2.transform.Find("SelSkill").gameObject.CustomSetActive(false); } Transform transform5 = gameObject2.transform.Find("skinLabelImage"); if (transform5 != null) { CUICommonSystem.SetHeroSkinLabelPic(cUIFormScript, transform5.gameObject, dataByKey.dwCfgID, actorServerData.SkinId); } } } else { DebugHelper.Assert(false, "Loading Player is Null"); } } } } GameObject widget = cUIFormScript.GetWidget(0); GameObject widget2 = cUIFormScript.GetWidget(1); GameObject widget3 = cUIFormScript.GetWidget(2); if (curLvelContext.IsGameTypeGuildMatch()) { widget.CustomSetActive(false); widget2.CustomSetActive(false); widget3.CustomSetActive(true); CSDT_CAMP_EXT_GUILDMATCH[] campExtGuildMatchInfo = curLvelContext.GetCampExtGuildMatchInfo(); if (campExtGuildMatchInfo != null && campExtGuildMatchInfo.Length == 2) { Image component10 = cUIFormScript.GetWidget(3).GetComponent <Image>(); Text component11 = cUIFormScript.GetWidget(4).GetComponent <Text>(); Image component12 = cUIFormScript.GetWidget(5).GetComponent <Image>(); Text component13 = cUIFormScript.GetWidget(6).GetComponent <Text>(); component10.SetSprite(CUIUtility.s_Sprite_Dynamic_GuildHead_Dir + campExtGuildMatchInfo[0].dwGuildHeadID, cUIFormScript, true, false, false, false); component11.set_text(StringHelper.UTF8BytesToString(ref campExtGuildMatchInfo[0].szGuildName)); component12.SetSprite(CUIUtility.s_Sprite_Dynamic_GuildHead_Dir + campExtGuildMatchInfo[1].dwGuildHeadID, cUIFormScript, true, false, false, false); component13.set_text(StringHelper.UTF8BytesToString(ref campExtGuildMatchInfo[1].szGuildName)); } } else { widget.CustomSetActive(true); widget2.CustomSetActive(true); widget3.CustomSetActive(false); Text component14 = cUIFormScript.GetWidget(7).GetComponent <Text>(); component14.set_text(CUILoadingSystem.GenerateRandomPvpLoadingTips(CUILoadingSystem.GenerateMultiRandomNum())); widget2.CustomSetActive(MonoSingleton <Reconnection> .instance.isProcessingRelayRecover); } }
public static void OnReceiveDianQuanReward(CSPkg msg) { Singleton <CUIManager> .GetInstance().CloseSendMsgAlert(); SCPKG_CMD_COUPONS_REWARDINFO stCouponsRewardRsp = msg.stPkgData.stCouponsRewardRsp; bool flag = true; CPaySystem instance = Singleton <CPaySystem> .GetInstance(); instance.rewardItems.Clear(); int num = Mathf.Min((int)stCouponsRewardRsp.stRewardInfo.bNum, stCouponsRewardRsp.stRewardInfo.astRewardDetail.Length); for (int i = 0; i < num; i++) { if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bType == 5) { CUICommonSystem.ShowNewHeroOrSkin(stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stRewardInfo.stHero.dwHeroID, 0u, enUIEventID.Pay_ClickGetNewHeroPanel, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_HERO, false, null, enFormPriority.Priority1, 0u, 0); flag = false; break; } if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bType == 10) { uint heroId; uint skinId; CSkinInfo.ResolveHeroSkin(stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stRewardInfo.stSkin.dwSkinID, out heroId, out skinId); CUICommonSystem.ShowNewHeroOrSkin(heroId, skinId, enUIEventID.Pay_ClickGetNewHeroPanel, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_SKIN, false, null, enFormPriority.Priority1, 0u, 0); flag = false; break; } if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bType == 1) { if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bFromType == 1) { uint dwHeroID = stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stFromInfo.stHeroInfo.dwHeroID; ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(dwHeroID); if (dataByKey != null) { ResHeroShop resHeroShop = null; GameDataMgr.heroShopInfoDict.TryGetValue(dataByKey.dwCfgID, out resHeroShop); CUICommonSystem.ShowNewHeroOrSkin(dwHeroID, 0u, enUIEventID.Pay_ClickGetNewHeroPanel, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_HERO, true, null, enFormPriority.Priority1, (resHeroShop != null) ? resHeroShop.dwChgItemCnt : 1u, 0); } } else if (stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].bFromType == 2) { uint dwSkinID = stCouponsRewardRsp.stRewardInfo.astRewardDetail[i].stFromInfo.stSkinInfo.dwSkinID; uint heroId2 = 0u; uint skinId2 = 0u; CSkinInfo.ResolveHeroSkin(dwSkinID, out heroId2, out skinId2); ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(heroId2, skinId2); if (heroSkin != null) { ResHeroSkinShop resHeroSkinShop = null; GameDataMgr.skinShopInfoDict.TryGetValue(heroSkin.dwID, out resHeroSkinShop); CUICommonSystem.ShowNewHeroOrSkin(heroId2, skinId2, enUIEventID.Pay_ClickGetNewHeroPanel, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_HERO, true, null, enFormPriority.Priority1, (resHeroSkinShop != null) ? resHeroSkinShop.dwChgItemCnt : 1u, 0); } } } } instance.rewardItems = CUseableManager.GetUseableListFromReward(stCouponsRewardRsp.stRewardInfo); if (flag) { Singleton <CUIManager> .GetInstance().OpenAwardTip(LinqS.ToArray <CUseable>(instance.rewardItems), null, false, enUIEventID.None, false, false, "Form_Award"); } }
public void OpenBuy(CUIFormScript form, ref COMDT_AKALISHOP_GOODS productInfo) { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); DebugHelper.Assert(masterRoleInfo != null, "master roleInfo is null"); if (masterRoleInfo == null) { return; } switch (productInfo.wItemType) { case 4: { ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(productInfo.dwItemID); DebugHelper.Assert(dataByKey != null, "神秘商店配置的英雄ID有错,英雄表里不存在"); if (dataByKey == null) { return; } if (masterRoleInfo.IsHaveHero(dataByKey.dwCfgID, false)) { stUIEventParams par = default(stUIEventParams); par.openHeroFormPar.heroId = dataByKey.dwCfgID; Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.HeroInfo_OpenForm, par); return; } stPayInfoSet payInfoSet = default(stPayInfoSet); payInfoSet.m_payInfoCount = 1; payInfoSet.m_payInfos = new stPayInfo[1]; stPayInfo stPayInfo = default(stPayInfo); stPayInfo.m_oriValue = productInfo.dwOrigPrice; stPayInfo.m_payValue = productInfo.dwRealPrice; stPayInfo.m_payType = enPayType.DianQuan; payInfoSet.m_payInfos[0] = stPayInfo; CHeroSkinBuyManager.OpenBuyHeroForm(form, dataByKey.dwCfgID, payInfoSet, enUIEventID.Mall_Mystery_On_Buy_Item); break; } case 7: { ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(productInfo.dwItemID); DebugHelper.Assert(heroSkin != null, "神秘商店配置的皮肤ID有错,皮肤表里不存在"); if (heroSkin == null) { return; } ResHeroCfgInfo dataByKey2 = GameDataMgr.heroDatabin.GetDataByKey(heroSkin.dwHeroID); DebugHelper.Assert(dataByKey2 != null, "神秘商店配置的皮肤ID有错,皮肤对应的英雄不存在"); if (dataByKey2 == null) { return; } if (masterRoleInfo.IsHaveHeroSkin(heroSkin.dwHeroID, heroSkin.dwSkinID, false)) { stUIEventParams par2 = default(stUIEventParams); par2.openHeroFormPar.heroId = heroSkin.dwHeroID; par2.openHeroFormPar.skinId = heroSkin.dwSkinID; par2.openHeroFormPar.openSrc = enHeroFormOpenSrc.SkinBuyClick; Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.HeroInfo_OpenForm, par2); return; } if (masterRoleInfo.IsCanBuySkinButNotHaveHero(heroSkin.dwHeroID, heroSkin.dwSkinID)) { stUIEventParams par3 = default(stUIEventParams); par3.heroId = heroSkin.dwHeroID; Singleton <CUIManager> .GetInstance().OpenMessageBoxWithCancel(string.Format("暂未拥有英雄{0},是否购买", StringHelper.UTF8BytesToString(ref dataByKey2.szName)), enUIEventID.Mall_Mystery_On_Buy_Hero_Not_Own, enUIEventID.None, par3, false); return; } stPayInfoSet payInfoSet2 = default(stPayInfoSet); payInfoSet2.m_payInfoCount = 1; payInfoSet2.m_payInfos = new stPayInfo[1]; stPayInfo stPayInfo2 = default(stPayInfo); stPayInfo2.m_oriValue = productInfo.dwOrigPrice; stPayInfo2.m_payValue = productInfo.dwRealPrice; stPayInfo2.m_payType = enPayType.DianQuan; payInfoSet2.m_payInfos[0] = stPayInfo2; CHeroSkinBuyManager.OpenBuyHeroSkinForm(heroSkin.dwHeroID, heroSkin.dwSkinID, true, payInfoSet2, enUIEventID.Mall_Mystery_On_Buy_Item); break; } } }
private static void ShowMultiLoading() { CUIFormScript formScript = Singleton <CUIManager> .GetInstance().OpenForm(PVP_PATH_LOADING, false, false); if (formScript != null) { SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext(); GameObject widget = formScript.GetWidget(0); if (widget != null) { if (MonoSingleton <Reconnection> .instance.isProcessingRelayRecover) { widget.CustomSetActive(true); } else { widget.CustomSetActive(false); } } IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.StaticBattleDataProvider); IGameActorDataProvider provider2 = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.ServerDataProvider); ActorStaticData actorData = new ActorStaticData(); ActorMeta actorMeta = new ActorMeta(); ActorMeta meta2 = new ActorMeta(); ActorServerData data2 = new ActorServerData(); actorMeta.ActorType = ActorTypeDef.Actor_Type_Hero; string name = null; for (int i = 1; i <= 2; i++) { List <Player> allCampPlayers = Singleton <GamePlayerCenter> .GetInstance().GetAllCampPlayers((COM_PLAYERCAMP)i); if (allCampPlayers != null) { Transform transform = (i != 1) ? formScript.transform.FindChild("DownPanel") : formScript.transform.FindChild("UpPanel"); for (int j = 1; j <= 5L; j++) { name = (i != 1) ? string.Format("Down_Player{0}", j) : string.Format("Up_Player{0}", j); transform.FindChild(name).gameObject.CustomSetActive(false); } List <Player> .Enumerator enumerator = allCampPlayers.GetEnumerator(); while (enumerator.MoveNext()) { Player current = enumerator.Current; if (current != null) { name = (i != 1) ? string.Format("Down_Player{0}", current.CampPos + 1) : string.Format("Up_Player{0}", current.CampPos + 1); GameObject gameObject = transform.FindChild(name).gameObject; gameObject.CustomSetActive(true); GameObject obj5 = gameObject.transform.Find("RankFrame").gameObject; if (obj5 != null) { if ((curLvelContext != null) && (curLvelContext.GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_LADDER)) { string rankFrameIconPath = CLadderView.GetRankFrameIconPath((byte)current.GradeOfRank); if (string.IsNullOrEmpty(rankFrameIconPath)) { obj5.CustomSetActive(false); } else { Image image = obj5.GetComponent <Image>(); if (image != null) { image.SetSprite(rankFrameIconPath, formScript, true, false, false); } obj5.CustomSetActive(true); } } else { obj5.CustomSetActive(false); } } Text component = gameObject.transform.Find("Txt_PlayerName/Name").gameObject.GetComponent <Text>(); component.text = current.Name; Image image2 = gameObject.transform.Find("Txt_PlayerName/NobeIcon").gameObject.GetComponent <Image>(); if (image2 != null) { MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(image2, (int)current.VipLv, true); } Text text2 = gameObject.transform.Find("Txt_HeroName").gameObject.GetComponent <Text>(); actorMeta.ConfigId = (int)current.CaptainId; text2.text = !actorDataProvider.GetActorStaticData(ref actorMeta, ref actorData) ? null : actorData.TheResInfo.Name; if (current.PlayerId == Singleton <GamePlayerCenter> .instance.GetHostPlayer().PlayerId) { component.color = CUIUtility.s_Text_Color_Self; } else { component.color = CUIUtility.s_Text_Color_CommonGray; } GameObject obj6 = gameObject.transform.Find("Txt_LoadingPct").gameObject; if (obj6 != null) { Text text3 = obj6.GetComponent <Text>(); if (current.Computer) { text3.text = !curLvelContext.isWarmBattle ? "100%" : "1%"; } else { text3.text = !MonoSingleton <Reconnection> .instance.isProcessingRelayRecover ? "1%" : "100%"; } } ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(current.CaptainId); if (dataByKey != null) { meta2.PlayerId = current.PlayerId; meta2.ActorCamp = (COM_PLAYERCAMP)i; meta2.ConfigId = (int)dataByKey.dwCfgID; meta2.ActorType = ActorTypeDef.Actor_Type_Hero; Image image3 = gameObject.transform.Find("Hero").gameObject.GetComponent <Image>(); if (provider2.GetActorServerData(ref meta2, ref data2)) { ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin((uint)data2.TheActorMeta.ConfigId, data2.SkinId); if (heroSkin != null) { image3.SetSprite(CUIUtility.s_Sprite_Dynamic_BustHero_Dir + StringHelper.UTF8BytesToString(ref heroSkin.szSkinPicID), formScript, true, false, false); } bool bActive = curLvelContext.isWarmBattle || !current.Computer; Transform transform2 = gameObject.transform.Find("heroProficiencyBgImg"); if (transform2 != null) { transform2.gameObject.CustomSetActive(bActive); if (bActive) { CUICommonSystem.SetHeroProficiencyBgImage(formScript, transform2.gameObject, (int)data2.TheProficiencyInfo.Level, true); } } Transform transform3 = gameObject.transform.Find("heroProficiencyImg"); if (transform3 != null) { transform3.gameObject.CustomSetActive(bActive); if (bActive) { CUICommonSystem.SetHeroProficiencyIconImage(formScript, transform3.gameObject, (int)data2.TheProficiencyInfo.Level); } } } else { image3.SetSprite(CUIUtility.s_Sprite_Dynamic_BustHero_Dir + StringHelper.UTF8BytesToString(ref dataByKey.szImagePath), formScript, true, false, false); } uint skillID = 0; if (provider2.GetActorServerCommonSkillData(ref meta2, out skillID) && (skillID != 0)) { ResSkillCfgInfo info2 = GameDataMgr.skillDatabin.GetDataByKey(skillID); if (info2 != null) { gameObject.transform.Find("SelSkill").gameObject.CustomSetActive(true); string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Skill_Dir, Utility.UTF8Convert(info2.szIconPath)); gameObject.transform.Find("SelSkill/Icon").GetComponent <Image>().SetSprite(prefabPath, formScript.GetComponent <CUIFormScript>(), true, false, false); } else { gameObject.transform.Find("SelSkill").gameObject.CustomSetActive(false); } } else { gameObject.transform.Find("SelSkill").gameObject.CustomSetActive(false); } Transform transform4 = gameObject.transform.Find("skinLabelImage"); if (transform4 != null) { CUICommonSystem.SetHeroSkinLabelPic(formScript, transform4.gameObject, dataByKey.dwCfgID, data2.SkinId); } } } } } } formScript.gameObject.transform.FindChild("Img_Tiao").FindChild("Tips").gameObject.GetComponent <Text>().text = GenerateRandomPvpLoadingTips(GenerateMultiRandomNum()); } }
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 OpenBuy(CUIFormScript form, Transform srcTrans) { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); DebugHelper.Assert(masterRoleInfo != null, "master roleInfo is null"); if (masterRoleInfo != null) { 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) { if (masterRoleInfo.IsHaveHero(dataByKey.dwCfgID, false)) { stUIEventParams par = new stUIEventParams(); par.openHeroFormPar.heroId = dataByKey.dwCfgID; Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.HeroInfo_OpenForm, par); return; } stPayInfoSet lowestPayInfoSetOfGood = CMallSystem.GetLowestPayInfoSetOfGood(dataByKey, CMallSystem.ResBuyTypeToPayType(this.Cfg.bMoneyType)); CHeroSkinBuyManager.OpenBuyHeroForm(form, dataByKey.dwCfgID, lowestPayInfoSetOfGood, enUIEventID.Mall_Mystery_On_Buy_Item); 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; } if (masterRoleInfo.IsHaveHeroSkin(heroSkin.dwHeroID, heroSkin.dwSkinID, false)) { stUIEventParams params2 = new stUIEventParams(); params2.openHeroFormPar.heroId = heroSkin.dwHeroID; params2.openHeroFormPar.skinId = heroSkin.dwSkinID; params2.openHeroFormPar.openSrc = enHeroFormOpenSrc.SkinBuyClick; Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.HeroInfo_OpenForm, params2); return; } if (masterRoleInfo.IsCanBuySkinButNotHaveHero(heroSkin.dwHeroID, heroSkin.dwSkinID)) { stUIEventParams params3 = new stUIEventParams { heroId = heroSkin.dwHeroID }; Singleton <CUIManager> .GetInstance().OpenMessageBoxWithCancel(string.Format("暂未拥有英雄{0},是否购买", StringHelper.UTF8BytesToString(ref info3.szName)), enUIEventID.Mall_Mystery_On_Buy_Hero_Not_Own, enUIEventID.None, params3, false); return; } stPayInfoSet payInfoSet = CMallSystem.GetLowestPayInfoSetOfGood(heroSkin, CMallSystem.ResBuyTypeToPayType(this.Cfg.bMoneyType)); CHeroSkinBuyManager.OpenBuyHeroSkinForm(heroSkin.dwHeroID, heroSkin.dwSkinID, true, payInfoSet, enUIEventID.Mall_Mystery_On_Buy_Item); break; } return; } } } }
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; } } } } } } } } } } } } } } } } } }
public static stPayInfoSet GetPayInfoSetOfGood(COM_ITEM_TYPE itemType, uint itemID) { CMallMysteryShop instance = Singleton <CMallMysteryShop> .GetInstance(); stPayInfoSet set = new stPayInfoSet(2); long doubleKey = GameDataMgr.GetDoubleKey((uint)itemType, itemID); CMallMysteryProduct product = new CMallMysteryProduct(); if (!instance.m_ProductDic.TryGetValue(doubleKey, out product)) { return(set); } uint index = (instance.Discount / 10) - 1; stPayInfo info = new stPayInfo(); switch (product.ItemType) { case COM_ITEM_TYPE.COM_OBJTYPE_HERO: { ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(itemID); DebugHelper.Assert(dataByKey != null, "神秘商店配置的英雄ID有错,英雄表里不存在"); if (dataByKey != null) { info.m_payType = CMallSystem.ResBuyTypeToPayType(product.Cfg.bMoneyType); switch (info.m_payType) { case enPayType.GoldCoin: info.m_oriValue = (uint)dataByKey.dwBuyCoin; goto Label_01A7; case enPayType.DianQuan: info.m_oriValue = (uint)dataByKey.dwBuyCoupons; goto Label_01A7; case enPayType.Diamond: case enPayType.DiamondAndDianQuan: info.m_oriValue = (uint)dataByKey.dwBuyDiamond; goto Label_01A7; } break; } return(set); } case COM_ITEM_TYPE.COM_OBJTYPE_HEROSKIN: { ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(itemID); DebugHelper.Assert(heroSkin != null, "神秘商店配置的皮肤ID有错,皮肤表里不存在"); if (heroSkin != null) { info.m_payType = CMallSystem.ResBuyTypeToPayType(product.Cfg.bMoneyType); switch (info.m_payType) { case enPayType.DianQuan: info.m_oriValue = heroSkin.dwBuyCoupons; goto Label_01A7; case enPayType.Diamond: case enPayType.DiamondAndDianQuan: info.m_oriValue = heroSkin.dwBuyDiamond; goto Label_01A7; } break; } return(set); } } Label_01A7: if (info.m_oriValue == 0) { info.m_oriValue = (uint)product.Cfg.RouZheKou[product.Cfg.RouZheKou.Length - 1]; } if ((index < 0) || (index >= product.Cfg.RouZheKou.Length)) { info.m_payValue = info.m_oriValue; info.m_discountForDisplay = 0x2710; } else if (instance.IsRandomDiscount) { info.m_payValue = (uint)product.Cfg.RouZheKou[index]; info.m_discountForDisplay = instance.Discount * 100; } else { info.m_payValue = (uint)product.Cfg.iConfirmZheKou; info.m_discountForDisplay = instance.Discount * 100; } set.m_payInfos[set.m_payInfoCount] = info; set.m_payInfoCount++; return(set); }
public void InitData() { DateTime time = new DateTime(0x7f6, 1, 0x12); if (!this.m_Inited) { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo != null) { DateTime time2 = Utility.ToUtcTime2Local((long)masterRoleInfo.getCurrentTimeSinceLogin()); DictionaryView <uint, ResAkaliShopCtrl> .Enumerator enumerator = GameDataMgr.mysteryShopCtlDict.GetEnumerator(); DateTime time3 = time; bool flag = false; bool flag2 = false; while (enumerator.MoveNext()) { KeyValuePair <uint, ResAkaliShopCtrl> current = enumerator.Current; ResAkaliShopCtrl ctrl = current.Value; DateTime time4 = Utility.StringToDateTime(Utility.UTF8Convert(ctrl.szOpenTime), DateTime.MinValue); DateTime time5 = Utility.StringToDateTime(Utility.UTF8Convert(ctrl.szCloseTime), DateTime.MinValue); if ((time2.CompareTo(time4) >= 0) && (time2.CompareTo(time5) <= 0)) { this.m_ShopID = ctrl.dwShopID; this.m_Products.Clear(); this.m_ProductDic.Clear(); this.m_StartTime = time4; this.m_EndTime = time5; this.m_LimitBuyCnt = ctrl.dwTotalBuyNumLimit; this.m_BoughtCnt = 0; switch (((RES_AKALISHOPZHEKOU_TYPE)ctrl.bZheKouType)) { case RES_AKALISHOPZHEKOU_TYPE.RES_AKALISHOPZHEKOU_CONFIRM: this.m_IsRandomDiscount = false; this.m_Discount = (uint)ctrl.iConfirmZheKou; this.m_HasGotDiscount = true; break; case RES_AKALISHOPZHEKOU_TYPE.RES_AKALISHOPZHEKOU_RANDOM: this.m_IsRandomDiscount = true; this.m_Discount = 100; this.m_HasGotDiscount = false; break; } DictionaryView <uint, ResAkaliShopGoods> .Enumerator enumerator2 = GameDataMgr.mysteryShopProductDict.GetEnumerator(); while (enumerator2.MoveNext()) { ResHeroCfgInfo dataByKey; ResHeroSkin heroSkin; ResHeroCfgInfo info3; long num; KeyValuePair <uint, ResAkaliShopGoods> pair2 = enumerator2.Current; ResAkaliShopGoods goodsCfg = pair2.Value; if (goodsCfg.dwShopID != ctrl.dwShopID) { continue; } CMallMysteryProduct item = new CMallMysteryProduct(goodsCfg); switch (item.ItemType) { case COM_ITEM_TYPE.COM_OBJTYPE_HERO: { dataByKey = GameDataMgr.heroDatabin.GetDataByKey(item.ItemID); if (dataByKey != null) { break; } continue; } case COM_ITEM_TYPE.COM_OBJTYPE_HEROSKIN: { heroSkin = CSkinInfo.GetHeroSkin(item.ItemID); if (heroSkin != null) { goto Label_0211; } continue; } default: goto Label_025C; } if (dataByKey.bIsPlayerUse > 0) { this.m_Products.Add(item); } goto Label_026E; Label_0211: info3 = GameDataMgr.heroDatabin.GetDataByKey(heroSkin.dwHeroID); if (info3 == null) { continue; } if ((heroSkin.bIsShow > 0) && (info3.bIsPlayerUse > 0)) { this.m_Products.Add(item); } goto Label_026E; Label_025C: this.m_Products.Add(item); Label_026E: num = GameDataMgr.GetDoubleKey((uint)item.ItemType, item.ItemID); if (!this.m_ProductDic.ContainsKey(num)) { this.m_ProductDic.Add(num, item); } } if (this.m_Products.Count == 0) { DebugHelper.Assert(false, "神秘商店配置了开启时段,但商店里没物品可卖"); } else { flag = true; } continue; } if ((time4.CompareTo(time2) > 0) && (time4.CompareTo(time3) < 0)) { time3 = time4; } } TimeSpan span = (TimeSpan)(time3 - time2); Singleton <CTimerManager> .GetInstance().RemoveTimerSafely(ref this.m_NextRefreshTimerSeq); long num2 = (long)(span.TotalSeconds * 1000.0); if ((num2 > 0L) && (num2 < 0x7fffffffL)) { Singleton <CTimerManager> .GetInstance().AddTimer((int)num2, 1, new CTimer.OnTimeUpHandler(this.RefreshShop)); flag2 = true; } TimeSpan span2 = (TimeSpan)(this.m_EndTime - time2); Singleton <CTimerManager> .GetInstance().RemoveTimerSafely(ref this.m_EndTimerSeq); long num3 = ((int)span2.TotalSeconds) * 0x3e8; if ((num3 > 0L) && (num3 < 0x7fffffffL)) { Singleton <CTimerManager> .GetInstance().AddTimer((int)num3, 1, new CTimer.OnTimeUpHandler(this.CloseShop)); } if (flag || flag2) { this.m_Inited = true; } } } }