private void Refresh() { if (!Object.op_Inequality((Object)MonoSingleton <GameManager> .Instance, (Object)null)) { return; } bool flag1 = false; bool flag2 = true; foreach (TrophyParam rootTropy in ChallengeMission.GetRootTropies()) { if (!ChallengeMission.GetTrophyCounter(rootTropy).IsEnded) { if (this.IsNotReceiveRewards(rootTropy)) { flag1 = true; this.UpdateTrophyCount(rootTropy); } flag2 = false; break; } } this.Badge.SetActive(flag1); ((Component)this).get_gameObject().SetActive(!flag2); if (flag2) { return; } FlowNode_GameObject.ActivateOutputLinks((Component)this, 10); }
private static TrophyParam GetCurrentRoot() { TrophyParam[] rootTropies = ChallengeMission.GetRootTropies(); int currentRootIndex = ChallengeMission.GetCurrentRootIndex(rootTropies); if (currentRootIndex >= 0 && currentRootIndex < rootTropies.Length) { return(rootTropies[currentRootIndex]); } return((TrophyParam)null); }
public static TrophyParam GetCurrentRootTrophy() { TrophyParam[] rootTropies = ChallengeMission.GetRootTropies(); int currentRootIndex = ChallengeMission.GetCurrentRootIndex(rootTropies); if (currentRootIndex >= 0) { return(rootTropies[currentRootIndex]); } return((TrophyParam)null); }
public static TrophyParam GetCurrentRootTrophy(string category) { TrophyParam[] rootTropies = ChallengeMission.GetRootTropies(category); if (rootTropies == null || rootTropies.Length == 0) { return((TrophyParam)null); } foreach (TrophyParam trophy in rootTropies) { if (!ChallengeMission.GetTrophyCounter(trophy).IsEnded) { return(trophy); } } return((TrophyParam)null); }
private static int GetCurrentRootIndex() { return(ChallengeMission.GetCurrentRootIndex(ChallengeMission.GetRootTropies())); }
public static TrophyParam[] GetRootTrophiesSortedByPriority() { return(ChallengeMission.GetTrophiesSortedByPriority(ChallengeMission.GetRootTropies())); }
private void Refresh(bool doInitialize, bool autoCategorySelection, bool changeCategory = false) { string category; if (autoCategorySelection) { category = ChallengeMission.GetTopMostPriorityCategory(this.mCategories); int index = Array.FindIndex <ChallengeCategoryParam>(this.mCategories, (Predicate <ChallengeCategoryParam>)(cat => cat.iname == category)); this.mCurrentCategoryIndex = index >= 0 ? index : 0; } else { category = this.mCategories[this.mCurrentCategoryIndex].iname; } for (int index = 0; index < this.mCategoryButtons.Count; ++index) { ((Component)this.mCategoryButtons[index].SelectionFrame).get_gameObject().SetActive(index == this.mCurrentCategoryIndex); } if (doInitialize) { for (int index = 0; index < this.mCategories.Length && index < this.mCategoryButtons.Count; ++index) { bool flag1 = false; bool flag2 = true; TrophyParam currentRootTrophy = ChallengeMission.GetCurrentRootTrophy(this.mCategories[index].iname); bool flag3; if (currentRootTrophy != null) { foreach (TrophyParam childeTrophy in ChallengeMission.GetChildeTrophies(currentRootTrophy)) { TrophyState trophyCounter = ChallengeMission.GetTrophyCounter(childeTrophy); if (!trophyCounter.IsEnded) { flag2 = false; if (trophyCounter.IsCompleted) { flag1 = true; break; } } } TrophyState trophyCounter1 = ChallengeMission.GetTrophyCounter(currentRootTrophy); flag3 = flag1 || flag2 && !trophyCounter1.IsEnded; } else { flag3 = false; } ((Component)this.mCategoryButtons[index].Badge).get_gameObject().SetActive(flag3); } } TrophyParam[] rootTropies = ChallengeMission.GetRootTropies(category); int activeTrophyIndex = ChallengeMission.GetCurrentActiveTrophyIndex(rootTropies); if (doInitialize || changeCategory) { this.mCurrentPage = activeTrophyIndex; } TrophyParam trophyParam = rootTropies[this.mCurrentPage]; this.mRootCount = rootTropies.Length; this.PageNumText.set_text((this.mCurrentPage + 1).ToString()); this.PageMaxNumText.set_text(this.mRootCount.ToString()); this.ChangeRewardImage(trophyParam); this.PageDotTemplate.SetActive(false); using (List <GameObject> .Enumerator enumerator = this.mDotsList.GetEnumerator()) { while (enumerator.MoveNext()) { UnityEngine.Object.Destroy((UnityEngine.Object)enumerator.Current); } } this.mDotsList.Clear(); for (int index = 0; index < this.mRootCount; ++index) { GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.PageDotTemplate); this.mDotsList.Add(gameObject); gameObject.SetActive(true); ((Toggle)gameObject.GetComponent <Toggle>()).set_isOn(index == this.mCurrentPage); gameObject.get_transform().SetParent(this.PageDotsHolder.get_transform(), false); } ((Selectable)this.BackPageButton).set_interactable(true); ((Selectable)this.NextPageButton).set_interactable(true); if (this.mCurrentPage <= 0) { ((Selectable)this.BackPageButton).set_interactable(false); } if (this.mCurrentPage >= this.mRootCount - 1) { ((Selectable)this.NextPageButton).set_interactable(false); } if (this.mCurrentPage > activeTrophyIndex) { this.OpenNonAchievedPage(this.mCurrentPage); } else { this.OpenNewPage(trophyParam, doInitialize); } }