Example #1
0
        private static void ShowSuperKingRankPanel(CUIFormScript form)
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            bool       flag   = CLadderView.IsSuperKing(masterRoleInfo.m_rankGrade, masterRoleInfo.m_rankClass);
            GameObject widget = form.GetWidget(10);

            widget.CustomSetActive(flag);
            if (flag)
            {
                CUICommonSystem.SetRankDisplay(masterRoleInfo.m_rankClass, widget.transform);
            }
        }
Example #2
0
        public static string GetGradeParticleBgResName()
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo != null)
            {
                ResRankGradeConf gradeDataByShowGrade = CLadderSystem.GetGradeDataByShowGrade((int)masterRoleInfo.m_rankGrade);
                if (gradeDataByShowGrade != null)
                {
                    if (CLadderView.IsSuperKing(masterRoleInfo.m_rankGrade, masterRoleInfo.m_rankClass))
                    {
                        return(gradeDataByShowGrade.szGradeParticleBgSuperMaster);
                    }
                    return(gradeDataByShowGrade.szGradeParticleBg);
                }
            }
            return(string.Empty);
        }
Example #3
0
        public static string GetGradeParticleBgResName()
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo != null)
            {
                ResRankGradeConf dataByKey = GameDataMgr.rankGradeDatabin.GetDataByKey((uint)masterRoleInfo.m_rankGrade);
                if (dataByKey != null)
                {
                    if (CLadderView.IsSuperKing(masterRoleInfo.m_rankGrade, masterRoleInfo.m_rankClass))
                    {
                        return(dataByKey.szGradeParticleBgSuperMaster);
                    }
                    return(dataByKey.szGradeParticleBg);
                }
            }
            return(string.Empty);
        }
Example #4
0
        private bool IsShowLadderKingForm()
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            return(CLadderView.IsSuperKing(masterRoleInfo.m_rankGrade, (uint)((byte)masterRoleInfo.m_rankClass)) && this.IsFirstShowLadderKingFormBeforeDailyRefreshTime());
        }
        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);
            }
        }
Example #6
0
        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();
                        COM_PLAYERCAMP            playerCamp = Singleton <GamePlayerCenter> .instance.GetHostPlayer().PlayerCamp;

                        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;
                                bool       flag = ((current.PlayerCamp == playerCamp) || Singleton <WatchController> .GetInstance().IsWatching) || Singleton <WatchController> .GetInstance().IsReplaying;

                                if (obj5 != null)
                                {
                                    if (flag)
                                    {
                                        string rankFrameIconPath = CLadderView.GetRankFrameIconPath((byte)current.GradeOfRank, current.ClassOfRank);
                                        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);
                                    }
                                }
                                Transform transform2 = gameObject.transform.Find("RankClassText");
                                if (transform2 != null)
                                {
                                    GameObject obj6 = transform2.gameObject;
                                    if (flag && CLadderView.IsSuperKing((byte)current.GradeOfRank, current.ClassOfRank))
                                    {
                                        obj6.CustomSetActive(true);
                                        obj6.GetComponent <Text>().text = current.ClassOfRank.ToString();
                                    }
                                    else
                                    {
                                        obj6.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 ((Singleton <WatchController> .GetInstance().IsWatching&& (current.PlayerUId == Singleton <WatchController> .GetInstance().TargetUID)) || (!Singleton <WatchController> .GetInstance().IsWatching&& (current.PlayerId == Singleton <GamePlayerCenter> .instance.GetHostPlayer().PlayerId)))
                                {
                                    component.color = CUIUtility.s_Text_Color_Self;
                                }
                                else
                                {
                                    component.color = CUIUtility.s_Text_Color_CommonGray;
                                }
                                GameObject obj7 = gameObject.transform.Find("Txt_LoadingPct").gameObject;
                                if (obj7 != null)
                                {
                                    Text text3 = obj7.GetComponent <Text>();
                                    if (current.Computer)
                                    {
                                        text3.text = !curLvelContext.m_isWarmBattle ? "100%" : "1%";
                                    }
                                    else
                                    {
                                        text3.text = (!MonoSingleton <Reconnection> .instance.isProcessingRelayRecover && !Singleton <WatchController> .GetInstance().IsWatching) ? "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);
                                            if (heroSkin.dwSkinID > 0)
                                            {
                                                text2.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("LoadingSkinNameTxt"), heroSkin.szSkinName, heroSkin.szHeroName);
                                            }
                                        }
                                        bool      bActive    = (((current.PlayerCamp == playerCamp) || Singleton <WatchController> .GetInstance().IsWatching) || Singleton <WatchController> .GetInstance().IsReplaying) && (curLvelContext.m_isWarmBattle || !current.Computer);
                                        Transform transform3 = gameObject.transform.Find("heroProficiencyBgImg");
                                        if (transform3 != null)
                                        {
                                            transform3.gameObject.CustomSetActive(bActive);
                                            if (bActive)
                                            {
                                                CUICommonSystem.SetHeroProficiencyBgImage(formScript, transform3.gameObject, (int)data2.TheProficiencyInfo.Level, true);
                                            }
                                        }
                                        Transform transform4 = gameObject.transform.Find("heroProficiencyImg");
                                        if (transform4 != null)
                                        {
                                            transform4.gameObject.CustomSetActive(bActive);
                                            if (bActive)
                                            {
                                                CUICommonSystem.SetHeroProficiencyIconImage(formScript, transform4.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 transform5 = gameObject.transform.Find("skinLabelImage");
                                    if (transform5 != null)
                                    {
                                        CUICommonSystem.SetHeroSkinLabelPic(formScript, transform5.gameObject, dataByKey.dwCfgID, data2.SkinId);
                                    }
                                }
                            }
                        }
                    }
                }
                formScript.gameObject.transform.FindChild("Img_Tiao").FindChild("Tips").gameObject.GetComponent <Text>().text = GenerateRandomPvpLoadingTips(GenerateMultiRandomNum());
            }
        }
Example #7
0
        public static void ShowRankDetail(GameObject go, byte rankGrade, uint rankClass, uint score, bool bShowScore = true, bool useSmall = false, bool isLadderRewardForm = false, bool isUseSpecialColorWhenSuperKing = false, bool isImgSamll = true)
        {
            DebugHelper.Assert(go != null, "GameObject is NULL!!!");
            Image image       = go.transform.Find("ImgRank") ? go.transform.Find("ImgRank").GetComponent <Image>() : null;
            Image image2      = go.transform.Find("ImgSubRank") ? go.transform.Find("ImgSubRank").GetComponent <Image>() : null;
            Text  text        = go.transform.Find("txtRankName") ? go.transform.Find("txtRankName").GetComponent <Text>() : null;
            Text  text2       = go.transform.Find("txtTopGroupScore") ? go.transform.Find("txtTopGroupScore").GetComponent <Text>() : null;
            byte  bLogicGrade = CLadderSystem.GetGradeDataByShowGrade((int)rankGrade).bLogicGrade;

            if (image)
            {
                string rankIconPath = CLadderView.GetRankIconPath(rankGrade, rankClass);
                string text3        = "{0}";
                if (isImgSamll)
                {
                    text3 += "_small";
                }
                image.SetSprite((!useSmall) ? rankIconPath : string.Format(text3, rankIconPath), null, true, false, false, false);
                image.gameObject.CustomSetActive(true);
            }
            if (image2)
            {
                if (isLadderRewardForm && (int)bLogicGrade >= CLadderSystem.MAX_RANK_LEVEL)
                {
                    image2.gameObject.CustomSetActive(false);
                }
                else
                {
                    image2.SetSprite(CLadderView.GetSubRankIconPath(rankGrade, rankClass), null, true, false, false, false);
                    image2.gameObject.CustomSetActive(true);
                }
            }
            if (text)
            {
                text.set_text(CLadderView.GetRankName(rankGrade, rankClass));
                if (isUseSpecialColorWhenSuperKing && CLadderView.IsSuperKing(rankGrade, rankClass))
                {
                    text.set_text("<color=#feba29>" + text.get_text() + "</color>");
                }
            }
            if (text2)
            {
                if ((int)bLogicGrade >= CLadderSystem.MAX_RANK_LEVEL)
                {
                    text2.set_text(string.Format("x{0}", score));
                }
                text2.gameObject.CustomSetActive((int)bLogicGrade >= CLadderSystem.MAX_RANK_LEVEL);
            }
            Transform transform = go.transform.Find("ScoreCon");

            if (!transform)
            {
                return;
            }
            if ((int)bLogicGrade >= CLadderSystem.MAX_RANK_LEVEL || !bShowScore)
            {
                transform.gameObject.CustomSetActive(false);
            }
            else
            {
                transform.Find("Con3Star").gameObject.CustomSetActive(false);
                transform.Find("Con4Star").gameObject.CustomSetActive(false);
                transform.Find("Con5Star").gameObject.CustomSetActive(false);
                ResRankGradeConf gradeDataByShowGrade = CLadderSystem.GetGradeDataByShowGrade((int)rankGrade);
                if (gradeDataByShowGrade != null)
                {
                    Transform transform2 = transform.Find(string.Format("Con{0}Star", gradeDataByShowGrade.dwGradeUpNeedScore));
                    if (transform2)
                    {
                        transform2.gameObject.CustomSetActive(true);
                        int num = 1;
                        while ((long)num <= (long)((ulong)gradeDataByShowGrade.dwGradeUpNeedScore))
                        {
                            Image  component  = transform2.Find(string.Format("ImgScore{0}", num)).GetComponent <Image>();
                            string prefabPath = ((ulong)score >= (ulong)((long)num)) ? CLadderView.LADDER_IMG_STAR : CLadderView.LADDER_IMG_STAR_EMPTY;
                            if (component)
                            {
                                component.SetSprite(prefabPath, null, true, false, false, false);
                            }
                            num++;
                        }
                    }
                }
                transform.gameObject.CustomSetActive(true);
            }
        }
Example #8
0
        public static void ShowRankDetail(GameObject go, byte rankGrade, uint rankClass, uint score, bool bShowScore = true, bool useSmall = false, bool isLadderRewardForm = false, bool isUseSpecialColorWhenSuperKing = false, bool isImgSamll = true)
        {
            DebugHelper.Assert(go != null, "GameObject is NULL!!!");
            DebugHelper.Assert(rankGrade > 0, "grade must be above 0!!!");
            Image image  = (!go.transform.Find("ImgRank")) ? null : go.transform.Find("ImgRank").GetComponent <Image>();
            Image image2 = (!go.transform.Find("ImgSubRank")) ? null : go.transform.Find("ImgSubRank").GetComponent <Image>();
            Text  text   = (!go.transform.Find("txtRankName")) ? null : go.transform.Find("txtRankName").GetComponent <Text>();
            Text  text2  = (!go.transform.Find("txtTopGroupScore")) ? null : go.transform.Find("txtTopGroupScore").GetComponent <Text>();

            if (image)
            {
                string rankIconPath = CLadderView.GetRankIconPath(rankGrade, rankClass);
                string text3        = "{0}";
                if (isImgSamll)
                {
                    text3 += "_small";
                }
                image.SetSprite(useSmall ? string.Format(text3, rankIconPath) : rankIconPath, null, true, false, false, false);
                image.gameObject.CustomSetActive(true);
            }
            if (image2)
            {
                if (isLadderRewardForm && (int)rankGrade >= CLadderSystem.MAX_RANK_LEVEL)
                {
                    image2.gameObject.CustomSetActive(false);
                }
                else
                {
                    image2.SetSprite(CLadderView.GetSubRankIconPath(rankGrade, rankClass), null, true, false, false, false);
                    image2.gameObject.CustomSetActive(true);
                }
            }
            if (text)
            {
                text.text = CLadderView.GetRankName(rankGrade, rankClass);
                if (isUseSpecialColorWhenSuperKing && CLadderView.IsSuperKing(rankGrade, rankClass))
                {
                    text.text = "<color=#feba29>" + text.text + "</color>";
                }
            }
            if (text2)
            {
                if ((int)rankGrade >= CLadderSystem.MAX_RANK_LEVEL)
                {
                    text2.text = string.Format("x{0}", score);
                }
                text2.gameObject.CustomSetActive((int)rankGrade >= CLadderSystem.MAX_RANK_LEVEL);
            }
            Transform transform = go.transform.Find("ScoreCon");

            if (!transform)
            {
                return;
            }
            if ((int)rankGrade >= CLadderSystem.MAX_RANK_LEVEL || !bShowScore)
            {
                transform.gameObject.CustomSetActive(false);
            }
            else
            {
                transform.Find("Con3Star").gameObject.CustomSetActive(false);
                transform.Find("Con4Star").gameObject.CustomSetActive(false);
                transform.Find("Con5Star").gameObject.CustomSetActive(false);
                ResRankGradeConf dataByKey = GameDataMgr.rankGradeDatabin.GetDataByKey((uint)rankGrade);
                if (dataByKey != null)
                {
                    Transform transform2 = transform.Find(string.Format("Con{0}Star", dataByKey.dwGradeUpNeedScore));
                    if (transform2)
                    {
                        transform2.gameObject.CustomSetActive(true);
                        int num = 1;
                        while ((long)num <= (long)((ulong)dataByKey.dwGradeUpNeedScore))
                        {
                            Image  component  = transform2.Find(string.Format("ImgScore{0}", num)).GetComponent <Image>();
                            string prefabPath = ((ulong)score < (ulong)((long)num)) ? CLadderView.LADDER_IMG_STAR_EMPTY : CLadderView.LADDER_IMG_STAR;
                            if (component)
                            {
                                component.SetSprite(prefabPath, null, true, false, false, false);
                            }
                            num++;
                        }
                    }
                }
                transform.gameObject.CustomSetActive(true);
            }
        }