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);
        }
 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);
 }
        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());
        }
示例#4
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));
                }
            }
        }