Exemple #1
0
        private void InitUI()
        {
            if (campaignId <= 0)
            {
                return;
            }

            mainTpl = Hotfix_LT.Data.SceneTemplateManager.Instance.GetLostMainCampaignTplById(campaignId.ToString());
            if (mainTpl == null)
            {
                return;
            }

            DataLookupsCache.Instance.SearchIntByID(string.Format("userCampaignStatus.normalChapters.{0}.campaigns.{1}.star", mainTpl.ChapterId, campaignId), out m_StarNum);
            DataLookupsCache.Instance.SearchDataByID <bool>(string.Format("userCampaignStatus.normalChapters.{0}.campaigns.{1}.complete", mainTpl.ChapterId, campaignId), out m_IsComplete);

            TitleLabel.text = mainTpl.Name;
            DescLabel.text  = mainTpl.Desc;
            for (int i = 0; i < StarList.Count; i++)
            {
                if (i < m_StarNum)
                {
                    StarList[i].gameObject.CustomSetActive(true);
                }
                else
                {
                    StarList[i].gameObject.CustomSetActive(false);
                }
            }

            isShowFree = Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigValue("DungeonFirstPassFree") > 0 && m_StarNum <= 0;
            FreeObj.CustomSetActive(isShowFree);
            CostObj.CustomSetActive(!isShowFree);
            VigorCostLabel.text = mainTpl.CostVigor.ToString();

            for (int i = 0; i < DropItemList.Count; i++)
            {
                if (i < mainTpl.AwardIconList.Count)
                {
                    DropItemList[i].mDMono.gameObject.CustomSetActive(true);
                    int    tempID = int.Parse(mainTpl.AwardIconList[i]);
                    string id     = tempID < 1000 ? BalanceResourceUtil.GetResStrID(tempID) : tempID.ToString();
                    string type   = tempID < 1000 ? LTShowItemType.TYPE_RES : LTShowItemType.TYPE_GAMINVENTORY;
                    DropItemList[i].LTItemData = new LTShowItemData(id, 0, type, false);
                }
                else
                {
                    DropItemList[i].mDMono.gameObject.CustomSetActive(false);
                }
            }

            bool isCanBlitz = m_IsComplete && m_StarNum >= 3;

            BlitzLabel.gameObject.CustomSetActive(!isCanBlitz);
            BlitzBtn.gameObject.CustomSetActive(isCanBlitz);
            MultiBlitzBtn.gameObject.CustomSetActive(isCanBlitz);
            BattleBtn.transform.localPosition = isCanBlitz ? RightBattlePos : LeftBattlePos;
            BattleBtn.gameObject.CustomSetActive(true);
        }
Exemple #2
0
        private void SetInfo(bool showTween = false)
        {
            int curlevel = partnerData.GetProficiencyLevelByType(CurType);

            CurUpData  = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetProficiencyUpByTypeAndLevel(CurType, curlevel);
            NextUpData = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetProficiencyUpByTypeAndLevel(CurType, curlevel + 1);

            CurTipLabel.text  = string.Format("{0} Lv.{1}", EB.Localizer.GetString("ID_CURRENT_LEVEL"), curlevel);
            NextTipLabel.text = string.Format("{0} Lv.{1}", EB.Localizer.GetString("ID_NEXT_LEVEL"), curlevel + 1);

            for (int i = 0; i < FxList.Count; i++)
            {
                FxList[i].CustomSetActive(false);
            }
            if (CurUpData != null)
            {
                string str = string.Format("+{0}%", CurUpData.ATK * 100);
                if (showTween && !CurATKTipLabel.text.Equals(str))
                {
                    ShowUpFx(0);
                }
                CurATKTipLabel.text = str;

                str = string.Format("+{0}%", CurUpData.maxHP * 100);
                if (showTween && !CurHPTipLabel.text.Equals(str))
                {
                    ShowUpFx(1);
                }
                CurHPTipLabel.text = str;

                str = string.Format("+{0}%", CurUpData.DEF * 100);
                if (showTween && !CurDEFTipLabel.text.Equals(str))
                {
                    ShowUpFx(2);
                }
                CurDEFTipLabel.text = str;
            }
            else
            {
                CurATKTipLabel.text = "+0%";
                CurHPTipLabel.text  = "+0%";
                CurDEFTipLabel.text = "+0%";
            }

            if (NextUpData != null)
            {
                NextATKTipLabel.text = string.Format("+{0}%", NextUpData.ATK * 100);
                NextHPTipLabel.text  = string.Format("+{0}%", NextUpData.maxHP * 100);
                NextDEFTipLabel.text = string.Format("+{0}%", NextUpData.DEF * 100);

                string color      = LT.Hotfix.Utility.ColorUtility.WhiteColorHexadecimal;
                int    resBalance = BalanceResourceUtil.GetUserPoten();
                if (resBalance < NextUpData.potenCost)
                {
                    color = LT.Hotfix.Utility.ColorUtility.RedColorHexadecimal;
                }
                else
                {
                    color = LT.Hotfix.Utility.ColorUtility.GreenColorHexadecimal;
                }

                MetCostLabel.text = string.Format("[{0}]{1}[-]/{2}", color, BalanceResourceUtil.GetUserPoten(), NextUpData.potenCost);

                color      = LT.Hotfix.Utility.ColorUtility.WhiteColorHexadecimal;
                resBalance = BalanceResourceUtil.GetUserGold();
                int grade = partnerData.HeroInfo.role_grade;
                if (grade > NextUpData.goldCost.Length)
                {
                    grade = NextUpData.goldCost.Length;
                }
                if (resBalance < NextUpData.goldCost[grade - 1])
                {
                    color = LT.Hotfix.Utility.ColorUtility.RedColorHexadecimal;
                }
                GoldCostLabel.text = string.Format("[{0}]{1}[-]", color, NextUpData.goldCost[grade - 1]);
                NextInfoObj.CustomSetActive(true);
                MaxLevelObj.CustomSetActive(false);
                CostObj.CustomSetActive(true);
            }
            else
            {
                NextInfoObj.CustomSetActive(false);
                MaxLevelObj.CustomSetActive(true);
                CostObj.CustomSetActive(false);
            }
        }