public ChapterSelectPageContext(LevelDataItem levelData)
        {
            this._actScrollerSpeedDownRatio = 5f;
            ContextPattern pattern = new ContextPattern {
                contextName    = "ChapterSelectPageContext",
                viewPrefabPath = "UI/Menus/Page/Map/ChapterSelectPage",
                cacheType      = ViewCacheType.AlwaysCached
            };

            base.config = pattern;
            base.findViewSavedInScene = true;
            this._toShowLevelData     = levelData;
            this._justShowLevelDetail = this._toShowLevelData != null;
            this._chapterType         = levelData.LevelType;
            switch (this._chapterType)
            {
            case 1:
                this.chapter = Singleton <LevelModule> .Instance.GetChapterById(levelData.ChapterID);

                this.difficulty    = levelData.Diffculty;
                this._showActIndex = new ActDataItem(levelData.ActID).actIndex;
                break;

            case 2:
            case 3:
                this._weekDayActivityData = Singleton <LevelModule> .Instance.GetWeekDayActivityByID(levelData.ActID);

                break;
            }
        }
        private void SetupView()
        {
            this._difficultyList.Sort(new Comparison <LevelDiffculty>(this.LevelDifficultySort));
            this.SetupDifficultyView(base.transform.Find("Current"), this._currentDifficulty);
            bool      flag      = UnlockUIDataReaderExtend.UnLockByMission(3) && UnlockUIDataReaderExtend.UnlockByTutorial(3);
            bool      flag2     = UnlockUIDataReaderExtend.UnLockByMission(4) && UnlockUIDataReaderExtend.UnlockByTutorial(4);
            Transform transform = base.transform.Find("Current/Arrow");

            if (this._difficultyList.Count > 2)
            {
                transform.gameObject.SetActive(flag || flag2);
            }
            else if (this._difficultyList.Count > 1)
            {
                transform.gameObject.SetActive(flag);
            }
            else
            {
                transform.gameObject.SetActive(false);
            }
            if (this._difficultyList.Count > 1)
            {
                Transform transform2 = base.transform.Find("PopUp");
                for (int i = 1; i < this._difficultyList.Count; i++)
                {
                    LevelDiffculty difficulty = this._difficultyList[i];
                    Transform      child      = transform2.GetChild(i - 1);
                    this.SetupDifficultyView(child, difficulty);
                    child.GetComponent <MonoLevelDifficultyButton>().SetupDifficulty(difficulty);
                }
            }
        }
 public void OnDifficultyBtnClick(LevelDiffculty difficulty)
 {
     this._currentDifficulty = difficulty;
     this.SetupView();
     this.FireNotify(true);
     this.OnBGClick();
 }
Exemple #4
0
 public List <LevelDataItem> GetLevelList(LevelDiffculty diffcult = 1)
 {
     if (this._chapterLevelDict.ContainsKey(diffcult))
     {
         return(this._chapterLevelDict[diffcult]);
     }
     return(new List <LevelDataItem>());
 }
        private void SetupDifficultyView(Transform trans, LevelDiffculty difficulty)
        {
            Color  difficultyColor = Miscs.GetDifficultyColor(difficulty);
            string difficultyDesc  = Miscs.GetDifficultyDesc(difficulty);
            string difficultyMark  = UIUtil.GetDifficultyMark(difficulty);

            trans.Find("Color").GetComponent <Image>().color      = difficultyColor;
            trans.Find("Desc").GetComponent <Text>().text         = difficultyDesc;
            trans.Find("Icon/Image").GetComponent <Image>().color = difficultyColor;
            trans.Find("Icon/Text").GetComponent <Text>().text    = difficultyMark;
        }
 public void Init(LevelDiffculty difficulty, ChapterDataItem chapterData)
 {
     this._popUpActive = false;
     base.transform.Find("PopUp").gameObject.SetActive(this._popUpActive);
     base.transform.Find("Btn").gameObject.SetActive(this._popUpActive);
     this._currentDifficulty = difficulty;
     this._chapterData       = chapterData;
     this._difficultyList    = new List <LevelDiffculty>();
     this.InitPopUp();
     this.SetupView();
     this.FireNotify(true);
 }
Exemple #7
0
        public int GetTotalFinishedChanllengeNum(LevelDiffculty difficulty)
        {
            int num = 0;
            List <LevelDataItem> levelList = this.GetLevelList(difficulty);
            int num2  = 0;
            int count = levelList.Count;

            while (num2 < count)
            {
                if (levelList[num2].status != 1)
                {
                    if (< > f__am$cache4 == null)
                    {
Exemple #8
0
        public LevelDetailDialogContextV2(LevelDataItem levelData, LevelDiffculty difficulty)
        {
            ContextPattern pattern = new ContextPattern {
                contextName    = "LevelDetailDialogContext1",
                viewPrefabPath = "UI/Menus/Dialog/LevelDetailDialogV2",
                ignoreNotify   = false
            };

            base.config     = pattern;
            this.levelData  = levelData;
            this.difficulty = difficulty;
            base.uiType     = UIType.SpecialDialog;
        }
Exemple #9
0
        public Dictionary <int, List <LevelDataItem> > GetLevelOfActs(LevelDiffculty difficulty = 1)
        {
            Dictionary <int, List <LevelDataItem> > dictionary = new Dictionary <int, List <LevelDataItem> >();

            foreach (LevelDataItem item in this.GetLevelList(difficulty))
            {
                if (!dictionary.ContainsKey(item.ActID))
                {
                    dictionary.Add(item.ActID, new List <LevelDataItem>());
                }
                dictionary[item.ActID].Add(item);
            }
            return(dictionary);
        }
Exemple #10
0
        public static LevelDiffculty GetDifficultyFromMark(char mark)
        {
            LevelDiffculty normal = LevelDiffculty.Normal;

            switch (mark)
            {
            case 'H':
                return(LevelDiffculty.Hard);

            case 'S':
                return(LevelDiffculty.Hell);
            }
            return(normal);
        }
Exemple #11
0
        public static string GetDifficultyDesc(LevelDiffculty difficulty)
        {
            switch (difficulty)
            {
            case LevelDiffculty.Normal:
                return(LocalizationGeneralLogic.GetText("Menu_Desc_DifficultyNormal", new object[0]));

            case LevelDiffculty.Hard:
                return(LocalizationGeneralLogic.GetText("Menu_Desc_DifficultyHard", new object[0]));

            case LevelDiffculty.Hell:
                return(LocalizationGeneralLogic.GetText("Menu_Desc_DifficultyHell", new object[0]));
            }
            return(LocalizationGeneralLogic.GetText("Menu_Desc_DifficultyNormal", new object[0]));
        }
Exemple #12
0
        public static Color GetDifficultyColor(LevelDiffculty difficulty)
        {
            switch (difficulty)
            {
            case LevelDiffculty.Normal:
                return(MiscData.GetColor("ChapterDifficultyNormal"));

            case LevelDiffculty.Hard:
                return(MiscData.GetColor("ChapterDifficultyHard"));

            case LevelDiffculty.Hell:
                return(MiscData.GetColor("ChapterDifficultyHell"));
            }
            return(MiscData.GetColor("ChapterDifficultyNormal"));
        }
 private int LevelDifficultySort(LevelDiffculty lobj, LevelDiffculty robj)
 {
     if (lobj == robj)
     {
         return(0);
     }
     if (lobj == this._currentDifficulty)
     {
         return(-1);
     }
     if (robj == this._currentDifficulty)
     {
         return(1);
     }
     return(lobj.CompareTo(robj));
 }
Exemple #14
0
        public static string GetDifficultyMark(LevelDiffculty difficulty)
        {
            string         str       = "N";
            LevelDiffculty diffculty = difficulty;

            if (diffculty != LevelDiffculty.Hard)
            {
                if (diffculty != LevelDiffculty.Hell)
                {
                    return(str);
                }
            }
            else
            {
                return("H");
            }
            return("S");
        }
 public void SetupDifficulty(LevelDiffculty difficulty)
 {
     this._difficulty = difficulty;
 }