public static string GetRelaIcon(int intimacyValue, COM_INTIMACY_STATE state) { int relaLevel = IntimacyRelationViewUT.CalcRelaLevel(intimacyValue); return IntimacyRelationViewUT.GetRelaIconByRelaLevel(relaLevel, state); }
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 Show_Item_Middle(CUIComponent com, CFR frData, CUIFormScript uiFrom) { IntimacyRelationViewUT.SetButtonParam(com.m_widgets[16], frData); IntimacyRelationViewUT.SetButtonParam(com.m_widgets[14], frData); IntimacyRelationViewUT.SetButtonParam(com.m_widgets[12], frData); IntimacyRelationViewUT.SetButtonParam(com.m_widgets[7], frData); int cDDays = frData.CDDays; GameObject obj = Utility.FindChild(com.gameObject, "mengban"); obj.CustomSetActive(cDDays != -1); if (cDDays != -1) { com.m_widgets[5].CustomSetActive(true); com.m_widgets[6].CustomSetActive(false); IntimacyRelationViewUT.Set_Middle_Text(com, true, string.Format(UT.FRData().IntimRela_CD_CountDown, cDDays), false); return; } if (frData.state == COM_INTIMACY_STATE.COM_INTIMACY_STATE_VALUE_FULL && cDDays == -1) { com.m_widgets[5].CustomSetActive(true); com.m_widgets[6].CustomSetActive(true); com.m_widgets[10].CustomSetActive(false); IntimacyRelationViewUT.Set_Drop_Text(com, !frData.bInShowChoiseRelaList, frData); IntimacyRelationViewUT.Set_Drop_List(com, frData.bInShowChoiseRelaList); IntimacyRelationViewUT.Set_Middle_Text(com, false, string.Empty, false); } if (IntimacyRelationViewUT.IsRelaState(frData.state)) { com.m_widgets[5].CustomSetActive(true); com.m_widgets[6].CustomSetActive(false); IntimacyRelationViewUT.Set_Middle_Text(com, true, IntimacyRelationViewUT.GetMiddleTextStr(frData.state), true); ushort num; CFriendModel.EIntimacyType eIntimacyType; bool flag; Singleton<CFriendContoller>.instance.model.GetFriendIntimacy(frData.ulluid, frData.worldID, out num, out eIntimacyType, out flag); if (num > 0) { int relaLevel = IntimacyRelationViewUT.CalcRelaLevel((int)num); string relaIconByRelaLevel = IntimacyRelationViewUT.GetRelaIconByRelaLevel(relaLevel, frData.state); if (!string.IsNullOrEmpty(relaIconByRelaLevel)) { GameObject p = com.m_widgets[10]; GameObject gameObject = Utility.FindChild(p, "Icon"); if (gameObject != null) { Image component = gameObject.GetComponent<Image>(); if (component != null) { component.gameObject.CustomSetActive(true); component.SetSprite(relaIconByRelaLevel, uiFrom, true, false, false, false); component.SetNativeSize(); } } } } } if (IntimacyRelationViewUT.IsRelaStateConfirm(frData.state)) { if (frData.bReciveOthersRequest) { com.m_widgets[5].CustomSetActive(true); com.m_widgets[6].CustomSetActive(false); COM_INTIMACY_STATE stateByConfirmState = IntimacyRelationViewUT.GetStateByConfirmState(frData.state); string relationText = IntimacyRelationViewUT.GetRelationText(stateByConfirmState); string txt = string.Format(UT.FRData().IntimRela_Tips_ReceiveOtherReqRela, UT.Bytes2String(frData.friendInfo.szUserName), relationText); IntimacyRelationViewUT.Set_Middle_Text(com, true, txt, false); } else { com.m_widgets[5].CustomSetActive(true); com.m_widgets[6].CustomSetActive(false); IntimacyRelationViewUT.Set_Middle_Text(com, true, UT.FRData().IntimRela_Tips_Wait4TargetRspReqRela, false); } } if (IntimacyRelationViewUT.IsRelaStateDeny(frData.state)) { if (frData.bReciveOthersRequest) { com.m_widgets[5].CustomSetActive(true); com.m_widgets[6].CustomSetActive(false); COM_INTIMACY_STATE stateByDenyState = IntimacyRelationViewUT.GetStateByDenyState(frData.state); string relationText2 = IntimacyRelationViewUT.GetRelationText(stateByDenyState); string txt2 = string.Format(UT.FRData().IntimRela_Tips_ReceiveOtherDelRela, UT.Bytes2String(frData.friendInfo.szUserName), relationText2); IntimacyRelationViewUT.Set_Middle_Text(com, true, txt2, false); } else { com.m_widgets[5].CustomSetActive(true); com.m_widgets[6].CustomSetActive(false); IntimacyRelationViewUT.Set_Middle_Text(com, true, UT.FRData().IntimRela_Tips_Wait4TargetRspDelRela, false); } } }