Esempio n. 1
0
        public void SetupActivityView(WeekDayActivityDataItem activityData, MonoActivityInfoPanel infoPanel, List <LevelDataItem> levels, Transform levelScrollTrans, LevelBtnClickCallBack OnLevelClick, Transform bgTrans, Dictionary <LevelDataItem, Transform> levelTransDict)
        {
            this._activityDatta = activityData;
            this._infoPanel     = infoPanel;
            this._bgTrans       = bgTrans;
            this.InitCache();
            this._selectedGameObject.SetActive(true);
            this._unselectedGameObject.SetActive(true);
            this._hideGameObject.SetActive(false);
            this._imageGameObject.SetActive(true);
            if (!string.IsNullOrEmpty(activityData.GetSmallImgPath()))
            {
                this._imageImage.sprite = Miscs.GetSpriteByPrefab(activityData.GetSmallImgPath());
            }
            this._descText.text = activityData.GetActitityTitle();
            Transform transform = UnityEngine.Object.Instantiate <GameObject>(Miscs.LoadResource <GameObject>(((activityData == null) || (activityData.GetStatus() != ActivityDataItemBase.Status.InProgress)) ? "UI/Menus/Widget/Map/LevelPanelActivity" : activityData.GetLevelPanelPath(), BundleType.RESOURCE_FILE)).transform;

            transform.SetParent(levelScrollTrans.Find("Content"), false);
            transform.GetComponent <MonoLevelPanel>().SetupView(levels, OnLevelClick, levelTransDict, activityData, 0);
            base.transform.GetComponent <MonoItemStatus>().isValid = true;
            transform.GetComponent <MonoItemStatus>().isValid      = true;
            this._bgTrans.gameObject.SetActive(true);
            if (this._activityDatta != null)
            {
                this._preImage.sprite  = Miscs.GetSpriteByPrefab(this._activityDatta.GetBgImgPath());
                this._postImage.sprite = Miscs.GetSpriteByPrefab(this._activityDatta.GetBgImgPath());
                this._infoPanel.SetupView(this._activityDatta);
            }
        }
Esempio n. 2
0
        private void SetupTitleView(WeekDayActivityDataItem activityData)
        {
            bool flag = activityData.GetStatus() == ActivityDataItemBase.Status.InProgress;

            this._normalGameObject.SetActive(flag);
            this._greyGameObject.SetActive(!flag);
        }
 public ChapterOverviewPageContext(WeekDayActivityDataItem acitivtyData)
 {
     this._noSpecialStory = true;
     this.InitChapterOverviewPageContext();
     this._selectedActivityData = acitivtyData;
     this._showingTab           = "Event";
 }
Esempio n. 4
0
 private void AddAllActivityFromMetaData()
 {
     this._allWeekDayActivityDict.Clear();
     this._allSeriesDict.Clear();
     foreach (WeekDayActivityMetaData data in WeekDayActivityMetaDataReader.GetItemList())
     {
         WeekDayActivityDataItem item = new WeekDayActivityDataItem(data.weekDayActivityID);
         this._allWeekDayActivityDict.Add(data.weekDayActivityID, item);
         int seriesID = item.GetSeriesID();
         if (!this._allSeriesDict.ContainsKey(seriesID))
         {
             this._allSeriesDict.Add(seriesID, new SeriesDataItem(seriesID));
         }
         this._allSeriesDict[seriesID].weekActivityList.Add(item);
         foreach (int num2 in item.GetLevelIDList())
         {
             if (!this._allLevelDict.ContainsKey(num2) && (LevelMetaDataReader.GetLevelMetaDataByKey(num2) != null))
             {
                 LevelDataItem item2 = new LevelDataItem(num2)
                 {
                     ActID     = item.GetActivityID(),
                     ChapterID = seriesID
                 };
                 this._allLevelDict.Add(item2.levelId, item2);
             }
         }
     }
 }
Esempio n. 5
0
        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;
            }
        }
Esempio n. 6
0
        public SeriesDataItem GetWeekDaySeriesByActivityID(int activityID)
        {
            SeriesDataItem          item2;
            WeekDayActivityDataItem weekDayActivityByID = this.GetWeekDayActivityByID(activityID);

            if (weekDayActivityByID == null)
            {
                return(null);
            }
            this._allSeriesDict.TryGetValue(weekDayActivityByID.GetSeriesID(), out item2);
            return(item2);
        }
Esempio n. 7
0
 public void SetupView(WeekDayActivityDataItem activityData)
 {
     this._activityData = activityData;
     base.gameObject.SetActive(true);
     if (this._activityData.GetActivityType() == 3)
     {
         this.SetupNuclearActivityInfo();
     }
     else
     {
         this.SetupDefaultActivityInfo();
     }
 }
Esempio n. 8
0
        public ChapterSelectPageContext(WeekDayActivityDataItem weekDayActivity)
        {
            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._chapterType         = 2;
            this._weekDayActivityData = weekDayActivity;
        }
        private void OnChangeSelectActivity(int index)
        {
            List <WeekDayActivityDataItem> list = new List <WeekDayActivityDataItem>();

            foreach (WeekDayActivityDataItem item in Singleton <LevelModule> .Instance.AllWeekDayActivityList)
            {
                if (item.GetStatus() != ActivityDataItemBase.Status.Unavailable)
                {
                    list.Add(item);
                }
            }
            if (index < list.Count)
            {
                this._selectedActivityData = list[index];
                this._selectedChapterData  = null;
            }
        }
Esempio n. 10
0
        private void GoToSerialPage(int serialID)
        {
            WeekDayActivityDataItem        weekDayActivity        = null;
            List <WeekDayActivityDataItem> allWeekDayActivityList = Singleton <LevelModule> .Instance.AllWeekDayActivityList;

            for (int i = 0; i < allWeekDayActivityList.Count; i++)
            {
                if ((allWeekDayActivityList[i].GetSeriesID() == serialID) && (allWeekDayActivityList[i].GetStatus() == ActivityDataItemBase.Status.InProgress))
                {
                    weekDayActivity = allWeekDayActivityList[i];
                    break;
                }
            }
            if (weekDayActivity == null)
            {
                weekDayActivity = Singleton <LevelModule> .Instance.GetActivityListBySeriesID(serialID)[0];
            }
            Singleton <MainUIManager> .Instance.ShowPage(new ChapterSelectPageContext(weekDayActivity), UIType.Page);
        }
Esempio n. 11
0
        private void GoToActivityPage(List <int> activityIDList)
        {
            int activityID = 0;
            WeekDayActivityDataItem weekDayActivity = null;

            foreach (int num2 in activityIDList)
            {
                if (Singleton <LevelModule> .Instance.GetWeekDayActivityByID(num2).GetStatus() == ActivityDataItemBase.Status.InProgress)
                {
                    activityID = num2;
                    break;
                }
            }
            if (activityID <= 0)
            {
                activityID = activityIDList[0];
            }
            weekDayActivity = Singleton <LevelModule> .Instance.GetWeekDayActivityByID(activityID);

            Singleton <MainUIManager> .Instance.ShowPage(new ChapterSelectPageContext(weekDayActivity), UIType.Page);
        }
Esempio n. 12
0
 public void SetupView(List <LevelDataItem> levels, LevelBtnClickCallBack OnLevelClick, Dictionary <LevelDataItem, Transform> levelTransDict, WeekDayActivityDataItem activityData = null, int totalFinishChallengeNum = 0)
 {
     if ((activityData == null) || (activityData.GetStatus() == ActivityDataItemBase.Status.InProgress))
     {
         foreach (LevelDataItem item in levels)
         {
             Transform parent    = base.transform.Find(item.SectionId.ToString());
             Transform transform = UnityEngine.Object.Instantiate <GameObject>(this.level).transform;
             transform.SetParent(parent, false);
             int       num       = 1;
             StageType levelType = item.LevelType;
             if (((levelType == 2) || (levelType == 3)) && (activityData != null))
             {
                 num = activityData.maxEnterTimes - activityData.enterTimes;
             }
             transform.GetComponent <MonoLevelView>().SetupView(item, num > 0, OnLevelClick, totalFinishChallengeNum);
             if (item.LevelType == 1)
             {
                 levelTransDict.Add(item, transform);
             }
         }
     }
     else
     {
         base.transform.Find("Icon/Desc").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(MiscData.Config.ActivityStatusImgPath[(int)activityData.GetStatus()]);
     }
 }