using System; using System.Collections.Generic; using System.Linq; using MoleMole.Config; using proto; using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; namespace MoleMole { // Token: 0x020008AA RID: 2218 public class ChapterSelectPageContext : BasePageContext { // Token: 0x0600372B RID: 14123 RVA: 0x0012A024 File Offset: 0x00128224 public ChapterSelectPageContext(ChapterDataItem chapter = null) { this.config = new ContextPattern { contextName = "ChapterSelectPageContext", viewPrefabPath = "UI/Menus/Page/Map/ChapterSelectPage", cacheType = ViewCacheType.AlwaysCached }; this.findViewSavedInScene = true; this.InitData(chapter); this.SetNewUnlockLevelData(); } // Token: 0x0600372C RID: 14124 RVA: 0x0012A080 File Offset: 0x00128280 public ChapterSelectPageContext(WeekDayActivityDataItem weekDayActivity) { this.config = new ContextPattern { contextName = "ChapterSelectPageContext", viewPrefabPath = "UI/Menus/Page/Map/ChapterSelectPage", cacheType = ViewCacheType.AlwaysCached }; this.findViewSavedInScene = true; this._chapterType = StageType.STAGE_WEEK_DAY; this._weekDayActivityData = weekDayActivity; } // Token: 0x0600372D RID: 14125 RVA: 0x0012A0E0 File Offset: 0x001282E0 public ChapterSelectPageContext(LevelDataItem levelData) { this.config = new ContextPattern { contextName = "ChapterSelectPageContext", viewPrefabPath = "UI/Menus/Page/Map/ChapterSelectPage", cacheType = ViewCacheType.AlwaysCached }; this.findViewSavedInScene = true; this._toShowLevelData = levelData; this._justShowLevelDetail = this._toShowLevelData != null; this._chapterType = levelData.LevelType; switch (this._chapterType) { case StageType.STAGE_STORY: this.chapter = Singleton.Instance.GetChapterById(levelData.ChapterID); this.difficulty = levelData.Diffculty; this._showActIndex = new ActDataItem(levelData.ActID).actIndex; break; case StageType.STAGE_WEEK_DAY: case StageType.STAGE_BEFALL: this._weekDayActivityData = Singleton.Instance.GetWeekDayActivityByID(levelData.ActID); break; } } // Token: 0x0600372E RID: 14126 RVA: 0x0012A1CC File Offset: 0x001283CC public override bool OnNotify(Notify ntf) { if (ntf.type == NotifyTypes.SetLevelDifficulty) { return this.OnSetupDifficultyNotify((LevelDiffculty)((int)ntf.body)); } if (ntf.type == NotifyTypes.StageEnd) { return this.OnStageEndNotify((bool)ntf.body); } if (ntf.type == NotifyTypes.RefreshChapterSelectPage) { return this.OnRefreshChapterSelectPage(); } return ntf.type == NotifyTypes.ActivtyShopScheduleChange && this.ShowActivityShopEntry(); } // Token: 0x0600372F RID: 14127 RVA: 0x0012A240 File Offset: 0x00128440 public override bool OnPacket(NetPacketV1 pkt) { ushort cmdId = pkt.getCmdId(); if (cmdId == 46) { return this.OnStageEndRsp(pkt.getData()); } return cmdId == 126 && this.OnGetWeekDayActivityDataRsp(pkt.getData()); } // Token: 0x06003730 RID: 14128 RVA: 0x0012A280 File Offset: 0x00128480 protected override void BindViewCallbacks() { base.BindViewCallback(base.view.transform.Find("WorldMapBtn").GetComponent