public void UpdateChapter(PVECampaignChapter id, [Optional, DefaultParameterValue(false)] bool canUnlockNext) { this.chapter = id; this.canUnlockNext = canUnlockNext; this.isOpend = GameData.instance.IsPVECampaignChapterOpened(this.chapter.id); this.UpdateUI(); }
public void ShowChapterOf(PVECampaignChapter id) { if ((this.currentSelectedChapter != id) && GlobalLock.instance.CanGo) { GlobalLock.instance.GoNow(); } else { return; } this.RemoveAllLevelItems(); this.levelItemContainer.Value = 0f; this.animationItem = true; this.currentSelectedChapter = id; CurrentWarParameters.selectedCampaignChapter = this.currentSelectedChapter; this.UpdateChapterSelectStatus(); this.UpdateLevels(); this.animationItem = false; }
private void SetInitChapterId() { List<UserPVECampaignChapter> userCampaigns = this.gamedata.UserCampaigns; if ((userCampaigns == null) || (userCampaigns.Count <= 0)) { this.currentSelectedChapter = PVEConfigs.instance.CampaignChapters[0]; } else if (this.navigationTargetLevel > 0) { foreach (UserPVECampaignChapter chapter in userCampaigns) { if (chapter.campaignId == this.navigationTargetLevel) { this.currentSelectedChapter = PVEConfigs.instance.GetCampaignChapter(chapter.campaignId); break; } } } else if (CurrentWarParameters.selectedCampaignChapter != null) { this.currentSelectedChapter = CurrentWarParameters.selectedCampaignChapter; } else { this.currentSelectedChapter = PVEConfigs.instance.CampaignChapters[0]; } this.navigationTargetLevel = -1; }
public void CheckSelection(PVECampaignChapter id) { this.selectedStatus.SetActive(id == this.chapter); }