public static TrophyParam[] GetRootTropies() { ChallengeCategoryParam[] challengeCategories = MonoSingleton <GameManager> .Instance.MasterParam.ChallengeCategories; List <TrophyParam> trophyParamList = new List <TrophyParam>(); TrophyParam[] tropies = ChallengeMission.GetTropies(); foreach (TrophyParam trophyParam in tropies) { TrophyParam trophy = trophyParam; if (trophy.IsChallengeMissionRoot) { ChallengeCategoryParam challengeCategoryParam = ((IEnumerable <ChallengeCategoryParam>)challengeCategories).FirstOrDefault <ChallengeCategoryParam>((Func <ChallengeCategoryParam, bool>)(cat => cat.iname == trophy.Category)); if (challengeCategoryParam != null) { if (challengeCategoryParam.begin_at == null || challengeCategoryParam.end_at == null) { trophyParamList.Add(trophy); } else { DateTime serverTime = TimeManager.ServerTime; if (serverTime >= challengeCategoryParam.begin_at.DateTimes && serverTime <= challengeCategoryParam.end_at.DateTimes) { trophyParamList.Add(trophy); } } } } } return(trophyParamList.ToArray()); }
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 void Start() { if (Object.op_Equality((Object)this.TextMessage, (Object)null)) { ((Behaviour)this).set_enabled(false); } else if (string.IsNullOrEmpty(GlobalVars.SelectedChallengeMissionTrophy)) { ((Behaviour)this).set_enabled(false); } else { this.mTrophy = ChallengeMission.GetTrophy(GlobalVars.SelectedChallengeMissionTrophy); if (this.mTrophy == null) { ((Behaviour)this).set_enabled(false); } else { if (this.mTrophy.IsChallengeMissionRoot) { this.PanelNormal.SetActive(false); this.PanelComplete.SetActive(true); FlowNode_GameObject.ActivateOutputLinks((Component)this, 3); } else { this.PanelNormal.SetActive(true); this.PanelComplete.SetActive(false); FlowNode_GameObject.ActivateOutputLinks((Component)this, 2); } this.UpdateReward(this.mTrophy); } } }
private void Refresh(bool fromRefresh) { this.mShowingOverlay = false; bool flag1 = false; TrophyState trophyState = (TrophyState)null; TrophyParam currentRootTrophy = ChallengeMission.GetCurrentRootTrophy(); if (currentRootTrophy == null) { return; } foreach (TrophyParam currentTrophy in ChallengeMission.GetCurrentTrophies(currentRootTrophy)) { TrophyState trophyCounter = ChallengeMission.GetTrophyCounter(currentTrophy); if (!trophyCounter.IsEnded) { if (!trophyCounter.IsCompleted) { ; } DataSource.Bind <TrophyParam>(((Component)this).get_gameObject(), currentTrophy); DataSource.Bind <TrophyState>(((Component)this).get_gameObject(), trophyCounter); trophyState = trophyCounter; flag1 = true; this.RefreshRewardIcon(currentTrophy); break; } } if (!flag1) { this.RefreshRewardIcon(currentRootTrophy); DataSource.Bind <TrophyParam>(((Component)this).get_gameObject(), currentRootTrophy); TrophyState trophyCounter = ChallengeMission.GetTrophyCounter(currentRootTrophy); if (trophyCounter != null) { DataSource.Bind <TrophyState>(((Component)this).get_gameObject(), trophyCounter); } } if (!((Component)this).get_gameObject().get_activeSelf()) { ((Component)this).get_gameObject().SetActive(true); } GameParameter.UpdateAll(((Component)this).get_gameObject()); bool flag2 = !flag1; if (trophyState != null) { flag2 = trophyState.IsCompleted; } if (!Object.op_Inequality((Object)this.ButtonTry, (Object)null) || !Object.op_Inequality((Object)this.ButtonDetail, (Object)null) || (!Object.op_Inequality((Object)this.ButtonReward, (Object)null) || !Object.op_Inequality((Object)this.ButtonHelp, (Object)null))) { return; } ((Component)this.ButtonTry).get_gameObject().SetActive(!flag2); ((Component)this.ButtonDetail).get_gameObject().SetActive(!flag2); ((Component)this.ButtonReward).get_gameObject().SetActive(flag2); ((Component)this.ButtonHelp).get_gameObject().SetActive(!flag2); }
public static TrophyParam GetTopMostPriorityTrophy(ChallengeCategoryParam[] categories) { TrophyParam trophyParam1 = (TrophyParam)null; TrophyParam trophyParam2 = (TrophyParam)null; TrophyParam trophyParam3 = (TrophyParam)null; foreach (ChallengeCategoryParam category in categories) { bool flag = true; TrophyParam currentRootTrophy = ChallengeMission.GetCurrentRootTrophy(category.iname); if (currentRootTrophy != null) { foreach (TrophyParam childeTrophy in ChallengeMission.GetChildeTrophies(currentRootTrophy)) { TrophyState trophyCounter = ChallengeMission.GetTrophyCounter(childeTrophy); if (!trophyCounter.IsEnded) { flag = false; if (trophyCounter.IsCompleted) { if (trophyParam2 == null) { trophyParam2 = childeTrophy; } } else if (trophyParam1 == null) { trophyParam1 = childeTrophy; } } } TrophyState trophyCounter1 = ChallengeMission.GetTrophyCounter(currentRootTrophy); if (!trophyCounter1.IsEnded) { if (flag) { if (trophyParam3 == null) { trophyParam3 = currentRootTrophy; } } else if (trophyCounter1.IsCompleted) { if (trophyParam2 == null) { trophyParam2 = currentRootTrophy; } } else if (trophyParam1 == null) { trophyParam1 = currentRootTrophy; } } } } return(trophyParam3 ?? trophyParam2 ?? trophyParam1); }
private static string GetTopMostPriorityCategory(ChallengeCategoryParam[] categories) { TrophyParam mostPriorityTrophy = ChallengeMission.GetTopMostPriorityTrophy(categories); if (mostPriorityTrophy == null) { return((string)null); } return(mostPriorityTrophy.Category); }
public static TrophyParam GetCurrentRootTrophy() { TrophyParam[] rootTropies = ChallengeMission.GetRootTropies(); int currentRootIndex = ChallengeMission.GetCurrentRootIndex(rootTropies); if (currentRootIndex >= 0) { return(rootTropies[currentRootIndex]); } return((TrophyParam)null); }
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); }
private bool IsNotReceiveRewards(TrophyParam rootTrophy) { foreach (TrophyParam currentTrophy in ChallengeMission.GetCurrentTrophies(rootTrophy)) { TrophyState trophyCounter = ChallengeMission.GetTrophyCounter(currentTrophy); if (trophyCounter.IsCompleted && !trophyCounter.IsEnded) { return(true); } } return(false); }
public static TrophyParam[] GetRootTropies() { List <TrophyParam> trophyParamList = new List <TrophyParam>(); foreach (TrophyParam tropy in ChallengeMission.GetTropies()) { if (tropy.IsChallengeMissionRoot) { trophyParamList.Add(tropy); } } return(trophyParamList.ToArray()); }
public static TrophyParam[] GetCurrentTrophies(TrophyParam root) { List <TrophyParam> trophyParamList = new List <TrophyParam>(); foreach (TrophyParam tropy in ChallengeMission.GetTropies()) { if (tropy.IsChallengeMission && root.iname == tropy.ParentTrophy) { trophyParamList.Add(tropy); } } return(trophyParamList.ToArray()); }
private static ChallengeCategoryParam[] GetOpeningCategory() { ChallengeCategoryParam[] array = ((IEnumerable <ChallengeCategoryParam>)MonoSingleton <GameManager> .Instance.MasterParam.ChallengeCategories).OrderByDescending <ChallengeCategoryParam, int>((Func <ChallengeCategoryParam, int>)(cat => cat.prio)).ToArray <ChallengeCategoryParam>(); List <ChallengeCategoryParam> challengeCategoryParamList = new List <ChallengeCategoryParam>(); foreach (ChallengeCategoryParam category in array) { if (ChallengeMission.IsCategoryOpening(category)) { challengeCategoryParamList.Add(category); } } return(challengeCategoryParamList.ToArray()); }
private void OnSelectItem(TrophyParam selectTrophy) { if (ChallengeMission.GetTrophyCounter(selectTrophy).IsCompleted) { GlobalVars.SelectedChallengeMissionTrophy = selectTrophy.iname; GlobalVars.SelectedTrophy.Set(selectTrophy.iname); FlowNode_GameObject.ActivateOutputLinks((Component)this, 101); } else { DataSource.Bind <TrophyParam>(((Component)this.DetailWindow).get_gameObject(), selectTrophy); FlowNode_GameObject.ActivateOutputLinks((Component)this, 100); } }
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(TrophyParam[] trophies) { if (trophies == null || trophies.Length == 0) { return(-1); } int num = 0; for (int index = 0; index < trophies.Length; ++index) { if (ChallengeMission.GetTrophyCounter(trophies[index]).IsEnded) { ++num; } } return(num); }
private void OnSelectItem(TrophyParam selectTrophy) { if (ChallengeMission.GetTrophyCounter(selectTrophy).IsCompleted) { GlobalVars.SelectedChallengeMissionTrophy = selectTrophy.iname; GlobalVars.SelectedTrophy.Set(selectTrophy.iname); FlowNode_GameObject.ActivateOutputLinks((Component)this, 101); } else { if ((MonoSingleton <GameManager> .Instance.Player.TutorialFlags & 1L) == 0L) { return; } DataSource.Bind <TrophyParam>(((Component)this.DetailWindow).get_gameObject(), selectTrophy); FlowNode_GameObject.ActivateOutputLinks((Component)this, 100); } }
private void UpdateTrophyCount(TrophyParam rootTrophy) { TrophyParam[] currentTrophies = ChallengeMission.GetCurrentTrophies(rootTrophy); int num = 0; foreach (TrophyParam trophy in currentTrophies) { TrophyState trophyCounter = ChallengeMission.GetTrophyCounter(trophy); if (trophyCounter.IsCompleted && !trophyCounter.IsEnded) { ++num; } } if (!Object.op_Inequality((Object)this.BadgeCount, (Object)null)) { return; } this.BadgeCount.set_text(num.ToString()); }
private static int GetCurrentActiveTrophyIndex(TrophyParam[] trophies) { if (trophies == null || trophies.Length == 0) { return(-1); } int num = 0; foreach (TrophyParam trophy in trophies) { if (ChallengeMission.GetTrophyCounter(trophy).IsEnded) { ++num; } } if (num >= trophies.Length) { return(trophies.Length - 1); } return(num); }
public static TrophyParam[] GetRootTropies() { ChallengeCategoryParam[] challengeCategories = MonoSingleton <GameManager> .Instance.MasterParam.ChallengeCategories; List <TrophyParam> trophyParamList = new List <TrophyParam>(); TrophyParam[] tropies = ChallengeMission.GetTropies(); // ISSUE: object of a compiler-generated type is created // ISSUE: variable of a compiler-generated type ChallengeMission.\u003CGetRootTropies\u003Ec__AnonStorey30E tropiesCAnonStorey30E = new ChallengeMission.\u003CGetRootTropies\u003Ec__AnonStorey30E(); foreach (TrophyParam trophyParam in tropies) { // ISSUE: reference to a compiler-generated field tropiesCAnonStorey30E.trophy = trophyParam; // ISSUE: reference to a compiler-generated field if (tropiesCAnonStorey30E.trophy.IsChallengeMissionRoot) { // ISSUE: reference to a compiler-generated method ChallengeCategoryParam challengeCategoryParam = ((IEnumerable <ChallengeCategoryParam>)challengeCategories).FirstOrDefault <ChallengeCategoryParam>(new Func <ChallengeCategoryParam, bool>(tropiesCAnonStorey30E.\u003C\u003Em__31E)); if (challengeCategoryParam != null) { if (challengeCategoryParam.begin_at == null || challengeCategoryParam.end_at == null) { // ISSUE: reference to a compiler-generated field trophyParamList.Add(tropiesCAnonStorey30E.trophy); } else { DateTime serverTime = TimeManager.ServerTime; if (serverTime >= challengeCategoryParam.begin_at.DateTimes && serverTime <= challengeCategoryParam.end_at.DateTimes) { // ISSUE: reference to a compiler-generated field trophyParamList.Add(tropiesCAnonStorey30E.trophy); } } } } } return(trophyParamList.ToArray()); }
private void Refresh(bool fromRefresh) { this.mShowingOverlay = false; TrophyParam mostPriorityTrophy = ChallengeMission.GetTopMostPriorityTrophy(); if (mostPriorityTrophy == null) { return; } TrophyState trophyCounter = ChallengeMission.GetTrophyCounter(mostPriorityTrophy); if (!trophyCounter.IsEnded) { DataSource.Bind <TrophyParam>(((Component)this).get_gameObject(), mostPriorityTrophy); DataSource.Bind <TrophyState>(((Component)this).get_gameObject(), trophyCounter); this.RefreshRewardIcon(mostPriorityTrophy); } if (!((Component)this).get_gameObject().get_activeSelf()) { ((Component)this).get_gameObject().SetActive(true); } GameParameter.UpdateAll(((Component)this).get_gameObject()); ChallengeCategoryParam[] challengeCategories = MonoSingleton <GameManager> .Instance.MasterParam.ChallengeCategories; if (challengeCategories != null && challengeCategories.Length > 0) { DataSource.Bind <ChallengeCategoryParam>(((Component)this.HelpIcon).get_gameObject(), ((IEnumerable <ChallengeCategoryParam>)challengeCategories).FirstOrDefault <ChallengeCategoryParam>()); } bool flag = mostPriorityTrophy.IsChallengeMissionRoot || trophyCounter.IsCompleted; if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ButtonTry, (UnityEngine.Object)null) || !UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ButtonDetail, (UnityEngine.Object)null) || (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ButtonReward, (UnityEngine.Object)null) || !UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ButtonHelp, (UnityEngine.Object)null))) { return; } ((Component)this.ButtonTry).get_gameObject().SetActive(!flag); ((Component)this.ButtonDetail).get_gameObject().SetActive(!flag); ((Component)this.ButtonReward).get_gameObject().SetActive(flag); ((Component)this.ButtonHelp).get_gameObject().SetActive(!flag); }
private void Awake() { if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.DetailWindow, (UnityEngine.Object)null)) { ((Component)this.DetailWindow).get_gameObject().SetActive(false); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.CharMessageWindow, (UnityEngine.Object)null)) { this.CharMessageWindow.SetActive(false); } this.mCategories = ChallengeMission.GetOpeningCategory(); if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.CategoryButtonTemplate, (UnityEngine.Object)null)) { return; } this.CategoryButtonTemplate.SetActive(false); for (int index = 0; index < this.mCategories.Length; ++index) { // ISSUE: object of a compiler-generated type is created // ISSUE: variable of a compiler-generated type ChallengeMission.\u003CAwake\u003Ec__AnonStorey30A awakeCAnonStorey30A = new ChallengeMission.\u003CAwake\u003Ec__AnonStorey30A(); // ISSUE: reference to a compiler-generated field awakeCAnonStorey30A.\u003C\u003Ef__this = this; ChallengeCategoryParam mCategory = this.mCategories[index]; GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.CategoryButtonTemplate); ChallengeMissionCategoryButton component = (ChallengeMissionCategoryButton)gameObject.GetComponent <ChallengeMissionCategoryButton>(); // ISSUE: reference to a compiler-generated field awakeCAnonStorey30A.index = index; // ISSUE: method pointer ((UnityEvent)component.Button.get_onClick()).AddListener(new UnityAction((object)awakeCAnonStorey30A, __methodptr(\u003C\u003Em__2A4))); component.SetChallengeCategory(mCategory); this.mCategoryButtons.Add(component); DataSource.Bind <ChallengeCategoryParam>(((Component)component).get_gameObject(), mCategory); gameObject.get_transform().SetParent(this.CategoryButtonContainer, false); gameObject.SetActive(true); } }
public void Refresh() { GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect(); TrophyParam dataOfClass = DataSource.FindDataOfClass <TrophyParam>(((Component)this).get_gameObject(), (TrophyParam)null); if (Object.op_Equality((Object)instanceDirect, (Object)null) || dataOfClass == null) { ((Behaviour)this).set_enabled(false); } else { TrophyState trophyCounter1 = ChallengeMission.GetTrophyCounter(dataOfClass); if (trophyCounter1.IsEnded) { ((Component)this).get_gameObject().SetActive(false); } else { ((Component)this).get_gameObject().SetActive(true); ChallengeMissionItem.State state = ChallengeMissionItem.State.Challenge; if (dataOfClass.RequiredTrophies != null && dataOfClass.RequiredTrophies.Length > 0) { TrophyParam trophy = ChallengeMission.GetTrophy(dataOfClass.RequiredTrophies[0]); if (trophy != null) { TrophyState trophyCounter2 = ChallengeMission.GetTrophyCounter(trophy); state = !trophyCounter2.IsEnded ? (!trophyCounter2.IsCompleted ? ChallengeMissionItem.State.None : ChallengeMissionItem.State.Next) : ChallengeMissionItem.State.Challenge; } } if (trophyCounter1.IsCompleted) { state = ChallengeMissionItem.State.Clear; } this.SetStateIcon(state); ChallengeMissionItem.ButtonObject buttonObject; if (state == ChallengeMissionItem.State.Clear) { ((Component)this.ButtonHighlight.button).get_gameObject().SetActive(true); ((Component)this.ButtonNormal.button).get_gameObject().SetActive(false); buttonObject = this.ButtonHighlight; } else { ((Component)this.ButtonHighlight.button).get_gameObject().SetActive(false); ((Component)this.ButtonNormal.button).get_gameObject().SetActive(true); buttonObject = this.ButtonNormal; } if (buttonObject != null && Object.op_Inequality((Object)buttonObject.title, (Object)null)) { if (state == ChallengeMissionItem.State.None) { buttonObject.title.set_text(LocalizedText.Get("sys.CHALLENGE_LOCKED")); } else { buttonObject.title.set_text(dataOfClass.Name); } } if (buttonObject != null && Object.op_Inequality((Object)buttonObject.button, (Object)null)) { ((UnityEventBase)buttonObject.button.get_onClick()).RemoveAllListeners(); ((UnityEvent)buttonObject.button.get_onClick()).AddListener(this.OnClick); ((Selectable)buttonObject.button).set_interactable(state == ChallengeMissionItem.State.Challenge || state == ChallengeMissionItem.State.Clear); } if (buttonObject == null || !Object.op_Inequality((Object)buttonObject.reward, (Object)null)) { return; } if (dataOfClass.Gold != 0) { buttonObject.reward.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_GOLD"), (object)dataOfClass.Gold)); } else if (dataOfClass.Exp != 0) { buttonObject.reward.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_EXP"), (object)dataOfClass.Exp)); } else if (dataOfClass.Coin != 0) { buttonObject.reward.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_COIN"), (object)dataOfClass.Coin)); } else if (dataOfClass.Stamina != 0) { buttonObject.reward.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_STAMINA"), (object)dataOfClass.Stamina)); } else { if (dataOfClass.Items == null || dataOfClass.Items.Length <= 0) { return; } ItemParam itemParam = instanceDirect.GetItemParam(dataOfClass.Items[0].iname); if (itemParam == null) { return; } buttonObject.reward.set_text(itemParam.name); } } } }
public void Refresh() { ((Component)this).get_gameObject().SetActive(true); ((Component)this.ClearBadge).get_gameObject().SetActive(false); GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect(); TrophyParam dataOfClass = DataSource.FindDataOfClass <TrophyParam>(((Component)this).get_gameObject(), (TrophyParam)null); if (UnityEngine.Object.op_Equality((UnityEngine.Object)instanceDirect, (UnityEngine.Object)null) || dataOfClass == null) { ((Component)this.ButtonHighlight.button).get_gameObject().SetActive(false); ((Component)this.ButtonNormal.button).get_gameObject().SetActive(false); ((Component)this.ButtonSecret.button).get_gameObject().SetActive(true); } else { TrophyState trophyCounter = ChallengeMission.GetTrophyCounter(dataOfClass); ChallengeMissionItem.State state = ChallengeMissionItem.State.Challenge; if (trophyCounter.IsEnded) { state = ChallengeMissionItem.State.Ended; } else if (trophyCounter.IsCompleted) { state = ChallengeMissionItem.State.Clear; } ChallengeMissionItem.ButtonObject buttonObject; if (state == ChallengeMissionItem.State.Clear) { ((Component)this.ButtonHighlight.button).get_gameObject().SetActive(true); ((Component)this.ButtonNormal.button).get_gameObject().SetActive(false); ((Component)this.ButtonSecret.button).get_gameObject().SetActive(false); buttonObject = this.ButtonHighlight; } else { ((Component)this.ButtonHighlight.button).get_gameObject().SetActive(false); ((Component)this.ButtonNormal.button).get_gameObject().SetActive(true); ((Component)this.ButtonSecret.button).get_gameObject().SetActive(false); buttonObject = this.ButtonNormal; } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ClearBadge, (UnityEngine.Object)null)) { ((Component)this.ClearBadge).get_gameObject().SetActive(state == ChallengeMissionItem.State.Ended); } if (buttonObject != null && UnityEngine.Object.op_Inequality((UnityEngine.Object)buttonObject.title, (UnityEngine.Object)null)) { buttonObject.title.set_text(dataOfClass.Name); } if (buttonObject != null && UnityEngine.Object.op_Inequality((UnityEngine.Object)buttonObject.button, (UnityEngine.Object)null)) { ((UnityEventBase)buttonObject.button.get_onClick()).RemoveAllListeners(); ((UnityEvent)buttonObject.button.get_onClick()).AddListener(this.OnClick); ((Selectable)buttonObject.button).set_interactable(state != ChallengeMissionItem.State.Ended); } if (buttonObject != null && UnityEngine.Object.op_Inequality((UnityEngine.Object)buttonObject.reward, (UnityEngine.Object)null)) { if (dataOfClass.Gold != 0) { buttonObject.reward.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_GOLD"), (object)dataOfClass.Gold)); GameUtility.SetGameObjectActive((Component)buttonObject.icon, true); GameUtility.SetGameObjectActive((Component)buttonObject.conceptCardIcon, false); } else if (dataOfClass.Exp != 0) { buttonObject.reward.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_EXP"), (object)dataOfClass.Exp)); GameUtility.SetGameObjectActive((Component)buttonObject.icon, true); GameUtility.SetGameObjectActive((Component)buttonObject.conceptCardIcon, false); } else if (dataOfClass.Coin != 0) { buttonObject.reward.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_COIN"), (object)dataOfClass.Coin)); GameUtility.SetGameObjectActive((Component)buttonObject.icon, true); GameUtility.SetGameObjectActive((Component)buttonObject.conceptCardIcon, false); } else if (dataOfClass.Stamina != 0) { buttonObject.reward.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_STAMINA"), (object)dataOfClass.Stamina)); GameUtility.SetGameObjectActive((Component)buttonObject.icon, true); GameUtility.SetGameObjectActive((Component)buttonObject.conceptCardIcon, false); } else if (dataOfClass.Items != null && dataOfClass.Items.Length > 0) { GameUtility.SetGameObjectActive((Component)buttonObject.icon, true); GameUtility.SetGameObjectActive((Component)buttonObject.conceptCardIcon, false); ItemParam itemParam = instanceDirect.GetItemParam(dataOfClass.Items[0].iname); if (itemParam != null) { buttonObject.reward.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_ITEM"), (object)itemParam.name, (object)dataOfClass.Items[0].Num)); } } else if (dataOfClass.ConceptCards != null && dataOfClass.ConceptCards.Length > 0) { GameUtility.SetGameObjectActive((Component)buttonObject.icon, false); GameUtility.SetGameObjectActive((Component)buttonObject.conceptCardIcon, true); ConceptCardParam conceptCardParam = instanceDirect.MasterParam.GetConceptCardParam(dataOfClass.ConceptCards[0].iname); if (conceptCardParam != null) { buttonObject.reward.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_DETAIL_REWARD_CONCEPT_CARD"), (object)conceptCardParam.name, (object)dataOfClass.ConceptCards[0].Num)); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object)buttonObject.conceptCardIcon, (UnityEngine.Object)null)) { ConceptCardData cardDataForDisplay = ConceptCardData.CreateConceptCardDataForDisplay(conceptCardParam.iname); buttonObject.conceptCardIcon.Setup(cardDataForDisplay); } } } if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)buttonObject.icon, (UnityEngine.Object)null)) { return; } buttonObject.icon.UpdateValue(); } }
private void Refresh() { TrophyParam currentRoot = ChallengeMission.GetCurrentRoot(); if (currentRoot == null) { FlowNode_GameObject.ActivateOutputLinks((Component)this, 103); } else { TrophyParam[] currentTrophies = ChallengeMission.GetCurrentTrophies(currentRoot); if (currentTrophies.Length != this.Items.Count) { FlowNode_GameObject.ActivateOutputLinks((Component)this, 103); } else { if (Object.op_Inequality((Object)this.Index, (Object)null)) { int currentRootIndex = ChallengeMission.GetCurrentRootIndex(); ((Component)this.Index).get_gameObject().SetActive(true); this.Index.set_text((currentRootIndex + 1).ToString()); } bool flag1 = false; bool flag2 = true; for (int index = 0; index < this.Items.Count; ++index) { // ISSUE: object of a compiler-generated type is created // ISSUE: variable of a compiler-generated type ChallengeMission.\u003CRefresh\u003Ec__AnonStorey236 refreshCAnonStorey236 = new ChallengeMission.\u003CRefresh\u003Ec__AnonStorey236(); // ISSUE: reference to a compiler-generated field refreshCAnonStorey236.\u003C\u003Ef__this = this; // ISSUE: reference to a compiler-generated field refreshCAnonStorey236.trophy = currentTrophies[index]; // ISSUE: reference to a compiler-generated field TrophyState trophyCounter = ChallengeMission.GetTrophyCounter(refreshCAnonStorey236.trophy); if (trophyCounter.IsEnded) { ((Component)this.Items[index]).get_gameObject().SetActive(false); } else { if (trophyCounter.IsCompleted) { flag1 = true; } // ISSUE: method pointer this.Items[index].OnClick = new UnityAction((object)refreshCAnonStorey236, __methodptr(\u003C\u003Em__246)); // ISSUE: reference to a compiler-generated field DataSource.Bind <TrophyParam>(((Component)this.Items[index]).get_gameObject(), refreshCAnonStorey236.trophy); this.Items[index].Refresh(); flag2 = false; } } if (Object.op_Inequality((Object)this.MessageText, (Object)null)) { string str1; if (flag1) { str1 = LocalizedText.Get("sys.CHALLENGE_MSG_CLEAR"); } else { string str2 = string.Empty; if (currentRoot.Gold != 0) { str2 = string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_GOLD"), (object)currentRoot.Gold); } else if (currentRoot.Exp != 0) { str2 = string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_EXP"), (object)currentRoot.Exp); } else if (currentRoot.Coin != 0) { str2 = string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_COIN"), (object)currentRoot.Coin); } else if (currentRoot.Stamina != 0) { str2 = string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_STAMINA"), (object)currentRoot.Stamina); } else if (currentRoot.Items != null && currentRoot.Items.Length > 0) { ItemParam itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(currentRoot.Items[0].iname); if (itemParam != null) { if (itemParam.type == EItemType.Unit) { UnitParam unitParam = MonoSingleton <GameManager> .Instance.GetUnitParam(itemParam.iname); if (unitParam != null) { str2 = LocalizedText.Get("sys.CHALLENGE_DETAIL_REWARD_UNIT", (object)((int)unitParam.rare + 1), (object)unitParam.name); } } else { str2 = LocalizedText.Get("sys.CHALLENGE_REWARD_ITEM", (object)itemParam.name, (object)currentRoot.Items[0].Num); } } } str1 = LocalizedText.Get("sys.CHALLENGE_MSG_INFO", new object[1] { (object)str2 }); } this.MessageText.set_text(str1); } if (Object.op_Inequality((Object)this.MessageWindow, (Object)null)) { this.MessageWindow.SetActive(Object.op_Inequality((Object)this.MessageText, (Object)null)); FlowNode_GameObject.ActivateOutputLinks((Component)this, 98); } TrophyState trophyCounter1 = ChallengeMission.GetTrophyCounter(currentRoot); if (flag2) { if (!trophyCounter1.IsEnded) { MonoSingleton <GameManager> .GetInstanceDirect().Player.OnChallengeMissionComplete(currentRoot.iname); GlobalVars.SelectedChallengeMissionTrophy = currentRoot.iname; GlobalVars.SelectedTrophy.Set(currentRoot.iname); if (currentRoot.iname == "CHALLENGE_01") { FlowNode_GameObject.ActivateOutputLinks((Component)this, 104); } else { FlowNode_GameObject.ActivateOutputLinks((Component)this, 102); } } else { FlowNode_GameObject.ActivateOutputLinks((Component)this, 103); } } if (this.IsInvoking("WaitLoadTexture")) { return; } this.StartCoroutine(this.WaitLoadTexture(currentRoot)); } } }
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); } }
private void OpenNewPage(TrophyParam rootTrophy, bool doInitialize) { if (rootTrophy == null) { FlowNode_GameObject.ActivateOutputLinks((Component)this, 103); } else { TrophyParam[] childeTrophies = ChallengeMission.GetChildeTrophies(rootTrophy); if (childeTrophies.Length != this.Items.Count) { FlowNode_GameObject.ActivateOutputLinks((Component)this, 103); } else { ((Component)this.Shadow).get_gameObject().SetActive(false); bool flag1 = false; bool flag2 = true; for (int index = 0; index < this.Items.Count; ++index) { // ISSUE: object of a compiler-generated type is created // ISSUE: variable of a compiler-generated type ChallengeMission.\u003COpenNewPage\u003Ec__AnonStorey30C pageCAnonStorey30C = new ChallengeMission.\u003COpenNewPage\u003Ec__AnonStorey30C(); // ISSUE: reference to a compiler-generated field pageCAnonStorey30C.\u003C\u003Ef__this = this; // ISSUE: reference to a compiler-generated field pageCAnonStorey30C.trophy = childeTrophies[index]; // ISSUE: reference to a compiler-generated field TrophyState trophyCounter = ChallengeMission.GetTrophyCounter(pageCAnonStorey30C.trophy); if (!trophyCounter.IsEnded) { flag2 = false; if (trophyCounter.IsCompleted) { flag1 = true; } } // ISSUE: method pointer this.Items[index].OnClick = new UnityAction((object)pageCAnonStorey30C, __methodptr(\u003C\u003Em__2A7)); // ISSUE: reference to a compiler-generated field DataSource.Bind <TrophyParam>(((Component)this.Items[index]).get_gameObject(), pageCAnonStorey30C.trophy); ItemParam data = (ItemParam)null; // ISSUE: reference to a compiler-generated field if (pageCAnonStorey30C.trophy.Coin != 0) { data = MonoSingleton <GameManager> .Instance.GetItemParam("$COIN"); } else { // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field if (pageCAnonStorey30C.trophy.Items != null && pageCAnonStorey30C.trophy.Items.Length > 0) { // ISSUE: reference to a compiler-generated field data = MonoSingleton <GameManager> .Instance.GetItemParam(pageCAnonStorey30C.trophy.Items[0].iname); } } if (data != null) { DataSource.Bind <ItemParam>(((Component)this.Items[index]).get_gameObject(), data); } this.Items[index].Refresh(); } ((Component)this.CompleteBadge).get_gameObject().SetActive(flag2); if (!flag2 && !doInitialize) { return; } TrophyState trophyCounter1 = ChallengeMission.GetTrophyCounter(rootTrophy); if (this.UseCharMessage && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.MessageText, (UnityEngine.Object)null) && !trophyCounter1.IsEnded) { string str1 = (string)null; if (flag1) { str1 = LocalizedText.Get("sys.CHALLENGE_MSG_CLEAR"); } else if (PlayerPrefsUtility.GetInt(PlayerPrefsUtility.CHALLENGEMISSION_HAS_SHOW_MESSAGE, 0) == 0) { string str2 = string.Empty; if (rootTrophy.Gold != 0) { str2 = string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_GOLD"), (object)rootTrophy.Gold); } else if (rootTrophy.Exp != 0) { str2 = string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_EXP"), (object)rootTrophy.Exp); } else if (rootTrophy.Coin != 0) { str2 = string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_COIN"), (object)rootTrophy.Coin); } else if (rootTrophy.Stamina != 0) { str2 = string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_STAMINA"), (object)rootTrophy.Stamina); } else if (rootTrophy.Items != null && rootTrophy.Items.Length > 0) { ItemParam itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(rootTrophy.Items[0].iname); if (itemParam != null) { if (itemParam.type == EItemType.Unit) { UnitParam unitParam = MonoSingleton <GameManager> .Instance.GetUnitParam(itemParam.iname); if (unitParam != null) { str2 = LocalizedText.Get("sys.CHALLENGE_DETAIL_REWARD_UNIT", (object)((int)unitParam.rare + 1), (object)unitParam.name); } } else { str2 = LocalizedText.Get("sys.CHALLENGE_REWARD_ITEM", (object)itemParam.name, (object)rootTrophy.Items[0].Num); } } } str1 = LocalizedText.Get("sys.CHALLENGE_MSG_INFO", new object[1] { (object)str2 }); PlayerPrefsUtility.SetInt(PlayerPrefsUtility.CHALLENGEMISSION_HAS_SHOW_MESSAGE, 1, false); } if (str1 != null) { this.MessageText.set_text(str1); if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.CharMessageWindow, (UnityEngine.Object)null)) { this.ResetMessageCloseCoroutine(); this.CharMessageWindow.SetActive(true); this.StartMessageCloseCoroutine(); } } } if (!flag2 || trophyCounter1.IsEnded) { return; } MonoSingleton <GameManager> .GetInstanceDirect().Player.OnChallengeMissionComplete(rootTrophy.iname); GlobalVars.SelectedChallengeMissionTrophy = rootTrophy.iname; GlobalVars.SelectedTrophy.Set(rootTrophy.iname); PlayerPrefsUtility.SetInt(PlayerPrefsUtility.CHALLENGEMISSION_HAS_SHOW_MESSAGE, 0, false); if (rootTrophy.iname == "CHALLENGE_02") { FlowNode_GameObject.ActivateOutputLinks((Component)this, 104); } else { FlowNode_GameObject.ActivateOutputLinks((Component)this, 102); } } } }
private static string GetTopMostPriorityCategory(ChallengeCategoryParam[] categories) { return(ChallengeMission.GetTopMostPriorityTrophy(categories)?.Category); }
private static int GetCurrentRootIndex() { return(ChallengeMission.GetCurrentRootIndex(ChallengeMission.GetRootTropies())); }
public static TrophyParam GetTopMostPriorityTrophy() { return(ChallengeMission.GetTopMostPriorityTrophy(ChallengeMission.GetOpeningCategory())); }
public static TrophyParam[] GetRootTrophiesSortedByPriority() { return(ChallengeMission.GetTrophiesSortedByPriority(ChallengeMission.GetRootTropies())); }