public bool PlayMostRecentStoryAction() { StaticDataController staticDataController = Service.StaticDataController; EpisodeProgressInfo episodeProgressInfo = Service.CurrentPlayer.EpisodeProgressInfo; EpisodeDataVO episodeDataVO = staticDataController.Get <EpisodeDataVO>(episodeProgressInfo.uid); string text = string.Empty; if (episodeProgressInfo.grindInfo.Started > 0) { text = staticDataController.Get <EpisodeTaskVO>(episodeDataVO.GrindTask).StoryID; } if (string.IsNullOrEmpty(text)) { int num = Math.Min(episodeProgressInfo.currentTaskIndex, episodeDataVO.Tasks.Length - 1); for (int i = num; i >= 0; i--) { EpisodeTaskVO optional = staticDataController.GetOptional <EpisodeTaskVO>(episodeDataVO.Tasks[i]); if (optional != null && !string.IsNullOrEmpty(optional.StoryID)) { text = optional.StoryID; break; } } } if (string.IsNullOrEmpty(text)) { Service.Logger.Error("EpisodeInfoScreen: Could not determine most recent story ID"); } return(this.PlayTaskStoryAction(text)); }
public bool PlayIntroStoryAction() { EpisodeProgressInfo episodeProgressInfo = Service.CurrentPlayer.EpisodeProgressInfo; if (episodeProgressInfo.uid == null || episodeProgressInfo.currentTaskIndex != 0 || episodeProgressInfo.introStoryViewed) { return(false); } StaticDataController staticDataController = Service.StaticDataController; EpisodeDataVO episodeDataVO = staticDataController.Get <EpisodeDataVO>(episodeProgressInfo.uid); bool flag = this.PlayStoryActionForTaskUid(episodeDataVO.Tasks[0]); if (flag) { Service.EpisodeWidgetViewController.ResetWidget(); this.MarkEpisodePanelOpened(); } return(flag); }
private void RefreshEpisodeData() { StaticDataController staticDataController = Service.StaticDataController; EpisodeProgressInfo episodeProgressInfo = Service.CurrentPlayer.EpisodeProgressInfo; if (episodeProgressInfo == null) { this.CurrentEpisodeData = null; return; } string uid = episodeProgressInfo.uid; if (string.IsNullOrEmpty(uid)) { Service.EventManager.RegisterObserver(this, EventId.FueCompleted); this.CurrentEpisodeData = null; } else if (this.CurrentEpisodeData == null || (this.CurrentEpisodeData != null && this.CurrentEpisodeData.Uid != uid)) { EpisodeDataVO optional = staticDataController.GetOptional <EpisodeDataVO>(uid); if (optional != null) { this.CurrentEpisodeData = staticDataController.GetOptional <EpisodeDataVO>(uid); } } if (this.CurrentEpisodeData != null) { Service.Logger.Debug(string.Concat(new string[] { "Current Episode: ", this.CurrentEpisodeData.Uid, " is active: ", this.CurrentEpisodeData.StartTime.ToString(), " ---> ", this.CurrentEpisodeData.EndTime.ToString() })); } }