Ejemplo n.º 1
0
        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 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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 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);
 }
Ejemplo n.º 5
0
 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);
     }
 }
Ejemplo n.º 6
0
 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);
 }
Ejemplo n.º 7
0
        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);
        }
Ejemplo n.º 8
0
 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);
     }
 }
Ejemplo n.º 9
0
        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());
        }
Ejemplo n.º 10
0
        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);
        }
Ejemplo n.º 11
0
        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);
        }
Ejemplo n.º 12
0
        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();
            }
        }
Ejemplo n.º 13
0
        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));
                }
            }
        }
Ejemplo n.º 14
0
        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);
                    }
                }
            }
        }
Ejemplo n.º 15
0
        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);
            }
        }
Ejemplo n.º 16
0
        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);
                    }
                }
            }
        }