예제 #1
0
        /// <summary>
        /// 设置备选卡片信息
        /// </summary>
        /// <param name="allCard">备选的卡片列表</param>
        public void F_SetCardInfos(HeroBattleChoiceData data)
        {
            m_Data             = data;
            mCurPartnerTabType = mCurPartnerTabType == eAttrTabType.None ? eAttrTabType.All : mCurPartnerTabType;
            List <HeroBattleChoiceCellData> allCard = new List <HeroBattleChoiceCellData>();

            switch (mCurPartnerTabType)
            {
            case eAttrTabType.Feng:
                allCard.AddRange(data.dicHeroChoiceData[Hotfix_LT.Data.eRoleAttr.Feng]);
                break;

            case eAttrTabType.Huo:
                allCard.AddRange(data.dicHeroChoiceData[Hotfix_LT.Data.eRoleAttr.Huo]);
                break;

            case eAttrTabType.Shui:
                allCard.AddRange(data.dicHeroChoiceData[Hotfix_LT.Data.eRoleAttr.Shui]);
                break;

            case eAttrTabType.All:
                allCard.AddRange(data.dicHeroChoiceData[Hotfix_LT.Data.eRoleAttr.Feng]);
                allCard.AddRange(data.dicHeroChoiceData[Hotfix_LT.Data.eRoleAttr.Huo]);
                allCard.AddRange(data.dicHeroChoiceData[Hotfix_LT.Data.eRoleAttr.Shui]);
                break;
            }
            //
            for (int i = 0; i < m_AllCardItem.Count; i++)
            {
                m_AllCardItem[i].F_SetCardInfo(null);
            }
            // 排序
            allCard.Sort((x, y) =>
            {
                int result = y.level.CompareTo(x.level);
                if (result == 0)
                {
                    result = y.star.CompareTo(x.star);
                }
                return(result);
            });
            //
            for (int i = 0; i < allCard.Count; i++)
            {
                if (i >= m_AllCardItem.Count)
                {
                    m_AllCardItem.Add(m_CardItem.F_Clone(m_Grid.transform));
                }
                m_AllCardItem[i].F_SetCardInfo(allCard[i]);
            }
            m_Grid.Reposition();
            m_ScrollView.ResetPosition();
        }
예제 #2
0
 void NotifyRefreshChoiceState(HeroBattleChoiceData data)
 {
     if (LTHeroBattleModel.GetInstance().isWaitingMatch) //如果是匹配后第一次收到数据 需要打开vs数据并2秒后打开
     {
         LTHeroBattleModel.GetInstance().isWaitingMatch = false;
         LTHeroBattleModel.GetInstance().matchData.isWaiting = false;
         LadderMatchSuccessUIController.InfoData info = new LadderMatchSuccessUIController.InfoData();
         info.type = 1;
         info.info = data;
         GlobalMenuManager.Instance.CloseMenu("LTHeroBattleMatch");
         GlobalMenuManager.Instance.Open("LTMatchSuccessUI", info);
     }
 }
예제 #3
0
        public override void SetMenuData(object param)
        {
            base.SetMenuData(param);
            HeroBattleChoiceData data = param as HeroBattleChoiceData;

            if (data != null)
            {
                SetChoiceData(data);
            }
            else if ((bool)param)
            {
                LTHeroBattleEvent.GetReloadData();
            }
        }
예제 #4
0
 private LTHeroBattleModel()
 {
     choiceData = new HeroBattleChoiceData();
     matchData  = new HeroBattleMatchData();
 }
예제 #5
0
 /// <summary>
 /// 设置伙伴备选面板
 /// </summary>
 /// <param name="data">当前数据</param>
 private void SetPartnerPanel(HeroBattleChoiceData data)
 {
     m_PrepareCardPanel.F_SetCardInfos(data);
 }
예제 #6
0
        /// <summary>
        /// 设置英雄操作数据
        /// </summary>
        /// <param name="data">操作的数据</param>
        protected override void SetChoiceData(HeroBattleChoiceData data)
        {
            SetPlayerInfo(data.selfInfo, data.otherInfo);

            bool isSelfTurn = (data.openUid == data.selfInfo.uid);

            if (data.choiceState != 2)
            {
                turnGO.alpha      = (isSelfTurn) ? 1 : 0;
                otherTurnGO.alpha = (!isSelfTurn) ? 1 : 0;
                if (_vsLobby != null)
                {
                    _vsLobby.SetTurn(isSelfTurn);
                }
            }

            _choiceState = data.choiceState;

            //设置按钮内容
            m_ConfirmBtn.CustomSetActive(data.choiceState != 2 && isSelfTurn);
            string confirmStr = data.choiceState == 0 ? EB.Localizer.GetString("ID_uifont_in_LTHeroBattleMenu_Label (1)_4") : EB.Localizer.GetString("ID_DIALOG_BUTTON_OK");

            m_ConfirmLabel.text = confirmStr;

            switch (data.choiceState)
            {
            case 0:
                LTUIUtil.SetText(choiceStateTipsLabel, EB.Localizer.GetString("ID_codefont_in_LTHeroBattleHudController_13617"));
                break;

            case 1:
                LTUIUtil.SetText(choiceStateTipsLabel, EB.Localizer.GetString("ID_codefont_in_LTHeroBattleHudController_14889"));
                break;

            case 2:     //非操作模式
                break;
            }

            if (data.selfChoices != null && data.selfChoices.Count == 6)
            {
                StartChangShowModel(data.selfChoices[data.selfChoices.Count - 1].modelName, data.selfChoices[data.selfChoices.Count - 1].heroName,
                                    LTPartnerConfig.LEVEL_SPRITE_NAME_DIC[data.selfChoices[data.selfChoices.Count - 1].type]);
            }
            else
            {
                StartChangShowModel("", "", "");
            }

            if (data.otherChoices != null && data.otherChoices.Count > 0) //如果有已选用 优先显示最近选用的  ps 这是他人的 自己的由于机制不同 在LTHeroBattleModel处理
            {
                HeroBattleChoiceCellData otherLastChoiceCell = data.otherChoices[data.otherChoices.Count - 1];
                StartChangeOtherShowModel(otherLastChoiceCell.modelName, otherLastChoiceCell.heroName,
                                          LTPartnerConfig.LEVEL_SPRITE_NAME_DIC[otherLastChoiceCell.type]);
            }
            else if (data.otherBans != null && data.otherBans.Count > 0) //如果没有已选用 优先显示最近禁用的
            {
                HeroBattleChoiceCellData otherLastChoiceCell = data.otherBans[data.otherBans.Count - 1];
                StartChangeOtherShowModel(otherLastChoiceCell.modelName, otherLastChoiceCell.heroName,
                                          LTPartnerConfig.LEVEL_SPRITE_NAME_DIC[otherLastChoiceCell.type]);
            }
            else //都没有久清空显示的模型
            {
                StartChangeOtherShowModel("", "", "");
            }

            //刷新显示剩余点数
            LTUIUtil.SetText(myPointLabel, data.lessPoint + "/10");
            LTUIUtil.SetText(otherPointLabel, data.otherLessPoint + "/10");
            myLeftPointBar.value    = data.lessPoint / 10f;
            otherLeftPointBar.value = data.otherLessPoint / 10f;
            //设置当前的阵容
            m_TeamPlane[0].F_SetTeam(data.selfChoices, data.selfInfo, data.selfBans);
            m_TeamPlane[1].F_SetTeam(data.otherChoices, data.otherInfo, data.otherBans);
            if (data.choiceState != 2)
            {
                StartChangeTurn(isSelfTurn, data.lessTime);
                StartShowTime(data.lessTime);
                //设置高亮队伍表示操作中
                m_TeamPlane[0].F_SetHeightLight((isSelfTurn && data.choiceState == 1) || (!isSelfTurn && data.choiceState == 0), data.selfChoices.Count, data.choiceState == 0);
                m_TeamPlane[1].F_SetHeightLight((!isSelfTurn && data.choiceState == 1) || (isSelfTurn && data.choiceState == 0), data.otherChoices.Count, data.choiceState == 0);
            }

            m_HeroBattleChoiceData = data;
            //
            SetPartnerPanel(data);
        }
예제 #7
0
        public void ShowUI(object info)
        {
            Container.CustomSetActive(true);
            FusionAudio.PostEvent("UI/New/JueDou", true);
            InfoData data = info as InfoData;
            string   myName;

            if (data == null)
            {
                if (!DataLookupsCache.Instance.SearchDataByID <string>("user.name", out myName))
                {
                    myName = string.Empty;
                }
                LTUIUtil.SetText(MyNameLabel, EB.Localizer.GetString(myName));

                LTUIUtil.SetText(MyScoreLabel, LadderManager.Instance.Info.Point.ToString());
                MyPortrait.spriteName = LTMainHudManager.Instance.UserHeadIcon;
                MyFrame.spriteName    = LTMainHudManager.Instance.UserLeaderHeadFrame.iconId;

                string playerName = EB.Dot.String("ladder.match_result.playerName", info, "");
                int    score      = EB.Dot.Integer("ladder.match_result.point", info, 0);
                string portrait   = EB.Dot.String("ladder.match_result.portrait", info, "");
                int    skin       = EB.Dot.Integer("ladder.match_result.skin", info, 0);
                string frame      = EB.Dot.String("ladder.match_result.headFrame", info, null);
                LTUIUtil.SetText(YourNameLabel, EB.Localizer.GetString(playerName));
                LTUIUtil.SetText(YourScoreLabel, score.ToString());
                //记录天梯分值
                LTHeroBattleModel.GetInstance().choiceData.selfInfo.score = LadderManager.Instance.Info.Point;
                LTHeroBattleModel.GetInstance().choiceData.otherInfo.score = score;
                //
                if (!string.IsNullOrEmpty(portrait))
                {
                    YourPortrait.spriteName = portrait;
                }
                else
                {
                    YourPortrait.spriteName = "Partner_Head_Sidatuila";
                }
                YourFrame.spriteName = EconemyTemplateManager.Instance.GetHeadFrame(frame).iconId;
                StartCoroutine(TimingSkip());
            }
            else
            {
                switch (data.type)
                {
                case 0:
                    if (!DataLookupsCache.Instance.SearchDataByID <string>("user.name", out myName))
                    {
                        myName = string.Empty;
                    }
                    LTUIUtil.SetText(MyNameLabel, EB.Localizer.GetString(myName));
                    LTUIUtil.SetText(MyScoreLabel, LadderManager.Instance.Info.Point.ToString());
                    MyPortrait.spriteName = LTMainHudManager.Instance.UserHeadIcon;
                    MyFrame.spriteName    = LTMainHudManager.Instance.UserLeaderHeadFrame.iconId;

                    string playerName = EB.Dot.String("ladder.match_result.playerName", data.info, "");
                    int    score      = EB.Dot.Integer("ladder.match_result.point", data.info, 0);
                    string portrait   = EB.Dot.String("ladder.match_result.portrait", data.info, "");
                    int    skin       = EB.Dot.Integer("ladder.match_result.skin", data.info, 0);
                    string frame      = EB.Dot.String("ladder.match_result.headFrame", data.info, null);
                    LTUIUtil.SetText(YourNameLabel, EB.Localizer.GetString(playerName));
                    LTUIUtil.SetText(YourScoreLabel, score.ToString());
                    //记录天梯分值
                    LTHeroBattleModel.GetInstance().choiceData.selfInfo.score = LadderManager.Instance.Info.Point;
                    LTHeroBattleModel.GetInstance().choiceData.otherInfo.score = score;
                    //
                    if (!string.IsNullOrEmpty(portrait))
                    {
                        YourPortrait.spriteName = portrait;
                    }
                    else
                    {
                        YourPortrait.spriteName = "Partner_Head_Sidatuila";
                    }
                    YourFrame.spriteName = EconemyTemplateManager.Instance.GetHeadFrame(frame).iconId;
                    StartCoroutine(TimingSkip());
                    break;

                case 1:
                    HeroBattleChoiceData choiceData = data.info as HeroBattleChoiceData;
                    LTUIUtil.SetText(TypeLabel, EB.Localizer.GetString("ID_codefont_in_LadderMatchSuccessUIController_3473"));
                    LTUIUtil.SetText(YourTypeLabel, EB.Localizer.GetString("ID_codefont_in_LadderMatchSuccessUIController_3473"));
                    StartCoroutine(OpenHeroBattleHud());
                    if (!DataLookupsCache.Instance.SearchDataByID <string>("user.name", out myName))
                    {
                        myName = string.Empty;
                    }
                    LTUIUtil.SetText(MyNameLabel, EB.Localizer.GetString(myName));
                    MyPortrait.spriteName = LTMainHudManager.Instance.UserHeadIcon;
                    MyFrame.spriteName    = LTMainHudManager.Instance.UserLeaderHeadFrame.iconId;
                    LTUIUtil.SetText(MyScoreLabel, BalanceResourceUtil.GetUserLevel().ToString());
                    LTUIUtil.SetText(YourNameLabel, EB.Localizer.GetString(choiceData.otherInfo.name));
                    YourPortrait.spriteName = choiceData.otherInfo.portrait;
                    YourFrame.spriteName    = choiceData.otherInfo.frame;
                    LTUIUtil.SetText(YourScoreLabel, choiceData.otherInfo.level.ToString());
                    break;
                }
            }
        }