Esempio n. 1
0
        public static bool CheckRequiredTrophies(GameManager gm, TrophyParam tp, bool is_end_check, bool is_beginner_check = true)
        {
            if (is_beginner_check)
            {
                TrophyState trophyCounter = gm.Player.GetTrophyCounter(tp, false);
                if (tp.IsBeginner && !MonoSingleton <GameManager> .Instance.Player.IsBeginner() && (trophyCounter == null || !trophyCounter.IsCompleted))
                {
                    return(false);
                }
            }
            bool flag = true;

            string[] requiredTrophies = tp.RequiredTrophies;
            for (int index = 0; index < requiredTrophies.Length; ++index)
            {
                if (!string.IsNullOrEmpty(requiredTrophies[index]))
                {
                    TrophyParam trophy = gm.MasterParam.GetTrophy(requiredTrophies[index]);
                    if (trophy != null && is_end_check)
                    {
                        TrophyState trophyCounter = gm.Player.GetTrophyCounter(trophy, false);
                        if (trophyCounter == null || !trophyCounter.IsEnded)
                        {
                            flag = false;
                            break;
                        }
                    }
                }
            }
            return(flag);
        }
Esempio n. 2
0
        private bool MakeTrophyPlate(TrophyParam trophy, TrophyState st, bool is_achievement)
        {
            Transform transform = ((Component)this).get_transform();

            if (this.TrophyType == TrophyList.TrophyTypes.Daily)
            {
                if (trophy.Days != 1)
                {
                    return(false);
                }
            }
            else if (this.TrophyType == TrophyList.TrophyTypes.Normal && (trophy.Days != 0 || this.TrophyCategory != trophy.Category))
            {
                return(false);
            }
            if (trophy.IsInvisibleVip() || trophy.IsInvisibleCard() || trophy.IsInvisibleStamina() || (trophy.RequiredTrophies != null && !TrophyParam.CheckRequiredTrophies(MonoSingleton <GameManager> .Instance, trophy, true) || !trophy.IsAvailablePeriod(TimeManager.ServerTime, is_achievement)))
            {
                return(false);
            }
            ListItemEvents listItemEvents1 = !st.IsEnded ? (!Object.op_Inequality((Object)this.Item_FollowTwitter, (Object)null) || !trophy.ContainsCondition(TrophyConditionTypes.followtwitter) ? (!trophy.iname.Contains("DAILY_GLAPVIDEO") ? (!st.IsCompleted ? this.Item_Normal : this.Item_Completed) : this.Item_Normal) : this.Item_FollowTwitter) : this.Item_Ended;

            if (Object.op_Equality((Object)listItemEvents1, (Object)null) || trophy.iname.Substring(0, 7) == "REVIEW_" && Network.Host.Contains("eval.alchemist.gu3.jp"))
            {
                return(false);
            }
            ListItemEvents listItemEvents2 = (ListItemEvents)Object.Instantiate <ListItemEvents>((M0)listItemEvents1);

            DataSource.Bind <TrophyParam>(((Component)listItemEvents2).get_gameObject(), trophy);
            ((Component)listItemEvents2).get_transform().SetParent(transform, false);
            listItemEvents2.OnOpenDetail = new ListItemEvents.ListItemEvent(this.OnItemDetail);
            listItemEvents2.OnSelect     = new ListItemEvents.ListItemEvent(this.OnItemSelect);
            SRPG_Button componentInChildren = (SRPG_Button)((Component)listItemEvents2).GetComponentInChildren <SRPG_Button>();

            if (Object.op_Inequality((Object)componentInChildren, (Object)null) && !st.IsEnded)
            {
                if (Object.op_Inequality((Object)this.Item_FollowTwitter, (Object)null) && trophy.ContainsCondition(TrophyConditionTypes.followtwitter))
                {
                    this.FollowBtnSetting(componentInChildren);
                }
                else if (trophy.iname.Contains("DAILY_GLAPVIDEO"))
                {
                    this.GlobalVideoAdsBtnSetting(componentInChildren);
                }
                else if (st.IsCompleted)
                {
                    this.AchievementBtnSetting(componentInChildren);
                }
                else
                {
                    this.ChallengeBtnSetting(componentInChildren, trophy);
                }
            }
            RewardData data = new RewardData(trophy);

            DataSource.Bind <RewardData>(((Component)listItemEvents2).get_gameObject(), data);
            this.AddItem(listItemEvents2);
            ((Component)listItemEvents2).get_gameObject().SetActive(true);
            return(true);
        }
        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);
        }
Esempio n. 4
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);
        }
 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);
 }
Esempio n. 6
0
 public void AddTrophy(TrophyState _trophy)
 {
     this.trophies.Add(_trophy);
     if (_trophy.IsCompleted)
     {
         this.tmp1_trophies.Add(_trophy);
         this.is_in_completed_data = true;
     }
     else
     {
         this.tmp2_trophies.Add(_trophy);
     }
 }
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
         this.OnRetry();
     }
     else
     {
         WebAPI.JSON_BodyResponse <FlowNode_ReqBingoProgress.JSON_BingoResponse> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqBingoProgress.JSON_BingoResponse> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         if (jsonObject.body == null)
         {
             this.OnRetry();
         }
         else if (jsonObject.body.bingoprogs == null)
         {
             Network.RemoveAPI();
             this.Success();
         }
         else
         {
             GameManager instance = MonoSingleton <GameManager> .Instance;
             for (int index1 = 0; index1 < jsonObject.body.bingoprogs.Length; ++index1)
             {
                 JSON_TrophyProgress bingoprog = jsonObject.body.bingoprogs[index1];
                 if (bingoprog != null)
                 {
                     if (instance.MasterParam.GetTrophy(bingoprog.iname) == null)
                     {
                         DebugUtility.LogError("存在しないミッション:" + bingoprog.iname);
                     }
                     else
                     {
                         TrophyState trophyCounter = instance.Player.GetTrophyCounter(instance.MasterParam.GetTrophy(bingoprog.iname), false);
                         for (int index2 = 0; index2 < bingoprog.pts.Length && index2 < trophyCounter.Count.Length; ++index2)
                         {
                             trophyCounter.Count[index2] = bingoprog.pts[index2];
                         }
                         trophyCounter.StartYMD = bingoprog.ymd;
                         trophyCounter.IsEnded  = bingoprog.rewarded_at != 0;
                     }
                 }
             }
             Network.RemoveAPI();
             this.Success();
         }
     }
 }
Esempio n. 8
0
 public void RemoveTrophy(TrophyState _trophy)
 {
     if (this.trophies.Contains(_trophy))
     {
         this.trophies.Remove(_trophy);
     }
     if (this.tmp1_trophies.Contains(_trophy))
     {
         this.tmp1_trophies.Remove(_trophy);
     }
     if (!this.tmp2_trophies.Contains(_trophy))
     {
         return;
     }
     this.tmp2_trophies.Remove(_trophy);
 }
Esempio n. 9
0
        public virtual void Start()
        {
            if (Object.op_Inequality((Object)this.Item_Complete, (Object)null))
            {
                this.Item_Complete.SetActive(false);
            }
            if (Object.op_Inequality((Object)this.Item_Incomplete, (Object)null))
            {
                this.Item_Incomplete.SetActive(false);
            }
            TrophyParam dataOfClass = DataSource.FindDataOfClass <TrophyParam>(((Component)this).get_gameObject(), (TrophyParam)null);

            if (dataOfClass == null)
            {
                return;
            }
            TrophyState trophyCounter = MonoSingleton <GameManager> .Instance.Player.GetTrophyCounter(dataOfClass, false);

            Transform transform = ((Component)this).get_transform();

            for (int index = 0; index < dataOfClass.Objectives.Length; ++index)
            {
                TrophyObjective     objective = dataOfClass.Objectives[index];
                TrophyObjectiveData data      = new TrophyObjectiveData();
                data.CountMax    = objective.RequiredCount;
                data.Description = objective.GetDescription();
                data.Objective   = objective;
                bool flag;
                if (index < trophyCounter.Count.Length)
                {
                    data.Count = trophyCounter.Count[index];
                    flag       = objective.RequiredCount <= trophyCounter.Count[index];
                }
                else
                {
                    flag = false;
                }
                GameObject gameObject1 = !flag ? this.Item_Incomplete : this.Item_Complete;
                if (!Object.op_Equality((Object)gameObject1, (Object)null))
                {
                    GameObject gameObject2 = (GameObject)Object.Instantiate <GameObject>((M0)gameObject1);
                    DataSource.Bind <TrophyObjectiveData>(gameObject2, data);
                    gameObject2.get_transform().SetParent(transform, false);
                    gameObject2.SetActive(true);
                }
            }
        }
Esempio n. 10
0
        private void reflectTrophyProgs(JSON_TrophyProgress[] trophy_progs)
        {
            if (trophy_progs == null)
            {
                return;
            }
            GameManager instance = MonoSingleton <GameManager> .Instance;

            for (int index1 = 0; index1 < trophy_progs.Length; ++index1)
            {
                JSON_TrophyProgress trophyProg = trophy_progs[index1];
                if (trophyProg != null)
                {
                    if (instance.MasterParam.GetTrophy(trophyProg.iname) == null)
                    {
                        DebugUtility.LogWarning("存在しないミッション:" + trophyProg.iname);
                    }
                    else
                    {
                        TrophyState trophyCounter = instance.Player.GetTrophyCounter(instance.MasterParam.GetTrophy(trophyProg.iname));
                        for (int index2 = 0; index2 < trophyProg.pts.Length && index2 < trophyCounter.Count.Length; ++index2)
                        {
                            trophyCounter.Count[index2] = trophyProg.pts[index2];
                        }
                        trophyCounter.StartYMD = trophyProg.ymd;
                        trophyCounter.IsEnded  = trophyProg.rewarded_at != 0;
                        if (trophyProg.rewarded_at != 0)
                        {
                            try
                            {
                                trophyCounter.RewardedAt = trophyProg.rewarded_at.FromYMD();
                            }
                            catch
                            {
                                trophyCounter.RewardedAt = DateTime.MinValue;
                            }
                        }
                        else
                        {
                            trophyCounter.RewardedAt = DateTime.MinValue;
                        }
                    }
                }
            }
        }
Esempio n. 11
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());
        }
Esempio n. 12
0
 private bool IsDisplayTrophy(TrophyState st)
 {
     if (st.Param.DispType == TrophyDispType.Award || st.Param.IsChallengeMission || (st.Param.IsInvisibleVip() || st.Param.IsInvisibleCard()) || (st.Param.IsInvisibleStamina() || st.Param.RequiredTrophies != null && !TrophyParam.CheckRequiredTrophies(MonoSingleton <GameManager> .Instance, st.Param, true, false)) || st.Param.IsBeginner && !MonoSingleton <GameManager> .Instance.Player.IsBeginner() && !st.IsCompleted)
     {
         return(false);
     }
     if (!st.IsCompleted && st.Param.ContainsCondition(TrophyConditionTypes.overvsrankfloor))
     {
         if (string.IsNullOrEmpty(st.Param.Objectives[0].sval_base))
         {
             if (!MonoSingleton <GameManager> .Instance.ExistsOpenVersusTower((string)null))
             {
                 return(false);
             }
         }
         else if (!MonoSingleton <GameManager> .Instance.ExistsOpenVersusTower(st.Param.Objectives[0].sval_base))
         {
             return(false);
         }
     }
     return((st.Param.iname.Length < 7 || !(st.Param.iname.Substring(0, 7) == "REVIEW_") || !Network.Host.Contains("eval.alchemist.gu3.jp")) && (st.Param.IsBeginner || st.Param.CategoryParam.IsOpenLinekedQuest(TimeManager.ServerTime, st.IsCompleted)));
 }
Esempio n. 13
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);
        }
Esempio n. 14
0
        public ListItemEvents MakeTrophyPlate(TrophyState st, bool is_achievement)
        {
            ListItemEvents listItemEvents1 = !st.IsEnded ? (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Item_FollowTwitter, (UnityEngine.Object)null) || !st.Param.ContainsCondition(TrophyConditionTypes.followtwitter) ? (!st.IsCompleted ? this.Item_Normal : this.Item_Completed) : this.Item_FollowTwitter) : this.Item_Ended;

            if (UnityEngine.Object.op_Equality((UnityEngine.Object)listItemEvents1, (UnityEngine.Object)null))
            {
                return((ListItemEvents)null);
            }
            ListItemEvents listItemEvents2 = (ListItemEvents)UnityEngine.Object.Instantiate <ListItemEvents>((M0)listItemEvents1);

            DataSource.Bind <TrophyParam>(((Component)listItemEvents2).get_gameObject(), st.Param);
            ((Component)listItemEvents2).get_transform().SetParent(((Component)this).get_transform(), false);
            listItemEvents2.OnOpenDetail = new ListItemEvents.ListItemEvent(this.OnItemDetail);
            listItemEvents2.OnSelect     = new ListItemEvents.ListItemEvent(this.OnItemSelect);
            SRPG_Button componentInChildren = (SRPG_Button)((Component)listItemEvents2).GetComponentInChildren <SRPG_Button>();

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)componentInChildren, (UnityEngine.Object)null) && !st.IsEnded)
            {
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Item_FollowTwitter, (UnityEngine.Object)null) && st.Param.ContainsCondition(TrophyConditionTypes.followtwitter))
                {
                    this.FollowBtnSetting(componentInChildren);
                }
                else if (st.IsCompleted)
                {
                    this.AchievementBtnSetting(componentInChildren);
                }
                else
                {
                    this.ChallengeBtnSetting(componentInChildren, st.Param);
                }
            }
            RewardData data = new RewardData(st.Param);

            DataSource.Bind <RewardData>(((Component)listItemEvents2).get_gameObject(), data);
            ((Component)listItemEvents2).get_gameObject().SetActive(true);
            return(listItemEvents2);
        }
Esempio n. 15
0
        private void reflectLoginTrophyProgs()
        {
            GameManager instance   = MonoSingleton <GameManager> .Instance;
            PlayerData  player     = instance.Player;
            int         loginCount = player.LoginCount;

            TrophyObjective[] trophiesOfType = instance.MasterParam.GetTrophiesOfType(TrophyConditionTypes.logincount);
            if (trophiesOfType == null)
            {
                return;
            }
            for (int index = 0; index < trophiesOfType.Length; ++index)
            {
                if (trophiesOfType[index] != null)
                {
                    TrophyState trophyCounter = player.GetTrophyCounter(trophiesOfType[index].Param);
                    if (trophyCounter != null && !(trophyCounter.Count == null | trophyCounter.Count.Length < 1))
                    {
                        trophyCounter.Count[0] = loginCount;
                        trophyCounter.IsDirty  = true;
                    }
                }
            }
        }
Esempio n. 16
0
        private void OnItemSelect(GameObject go)
        {
            TrophyParam dataOfClass = DataSource.FindDataOfClass <TrophyParam>(go, (TrophyParam)null);

            if (dataOfClass == null)
            {
                return;
            }
            TrophyState trophyCounter = MonoSingleton <GameManager> .Instance.Player.GetTrophyCounter(dataOfClass);

            if (!trophyCounter.IsEnded && trophyCounter.IsCompleted)
            {
                if (dataOfClass.IsInvisibleStamina() || !dataOfClass.IsAvailablePeriod(TimeManager.ServerTime, true))
                {
                    UIUtility.NegativeSystemMessage((string)null, LocalizedText.Get("sys.TROPHY_OUTDATED"), (UIUtility.DialogResultEvent)null, (GameObject)null, false, -1);
                    this.Refresh();
                }
                else
                {
                    GlobalVars.SelectedTrophy.Set(dataOfClass.iname);
                    RewardData rewardData = new RewardData(dataOfClass);
                    GlobalVars.LastReward.Set(rewardData);
                    GlobalVars.UnitGetReward = new UnitGetParam(rewardData.Items.ToArray());
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 100);
                }
            }
            else
            {
                QuestParam questParam = new QuestParam();
                switch (dataOfClass.Objectives[0].type)
                {
                case TrophyConditionTypes.winquest:
                case TrophyConditionTypes.playerlv:
                case TrophyConditionTypes.winquestsoldier:
                case TrophyConditionTypes.losequest:
                    QuestTypes quest_type1 = QuestTypes.Story;
                    if (!questParam.TransSectionGotoQuest(dataOfClass.Objectives[0].sval, out quest_type1, new UIUtility.DialogResultEvent(this.MsgBoxJumpToQuest)))
                    {
                        this.g_quest_type = quest_type1;
                        break;
                    }
                    QuestTypes questTypes = quest_type1;
                    switch (questTypes)
                    {
                    case QuestTypes.Event:
                        FlowNode_GameObject.ActivateOutputLinks((Component)this, 1007);
                        return;

                    case QuestTypes.Tower:
                        FlowNode_GameObject.ActivateOutputLinks((Component)this, 1026);
                        return;

                    default:
                        if (questTypes == QuestTypes.Multi)
                        {
                            FlowNode_GameObject.ActivateOutputLinks((Component)this, 1005);
                            return;
                        }
                        FlowNode_GameObject.ActivateOutputLinks((Component)this, 1001);
                        return;
                    }

                case TrophyConditionTypes.winelite:
                case TrophyConditionTypes.loseelite:
                    if (!questParam.TransSectionGotoElite(new UIUtility.DialogResultEvent(this.MsgBoxJumpToQuest)))
                    {
                        this.g_quest_type = QuestTypes.Story;
                        break;
                    }
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1001);
                    break;

                case TrophyConditionTypes.winevent:
                case TrophyConditionTypes.loseevent:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1007);
                    break;

                case TrophyConditionTypes.gacha:
                case TrophyConditionTypes.collectunits:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1000);
                    break;

                case TrophyConditionTypes.multiplay:
                case TrophyConditionTypes.winmulti:
                case TrophyConditionTypes.winmultimore:
                case TrophyConditionTypes.winmultiless:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1005);
                    break;

                case TrophyConditionTypes.ability:
                case TrophyConditionTypes.changeability:
                case TrophyConditionTypes.makeabilitylevel:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1025);
                    break;

                case TrophyConditionTypes.soubi:
                    this.GotoEquip();
                    break;

                case TrophyConditionTypes.buygold:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1004);
                    break;

                case TrophyConditionTypes.arena:
                case TrophyConditionTypes.winarena:
                case TrophyConditionTypes.losearena:
                    this.GotoArena();
                    break;

                case TrophyConditionTypes.review:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1029);
                    break;

                case TrophyConditionTypes.fggid:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1009);
                    break;

                case TrophyConditionTypes.unitlevel:
                case TrophyConditionTypes.evolutionnum:
                case TrophyConditionTypes.joblevel:
                case TrophyConditionTypes.upunitlevel:
                case TrophyConditionTypes.makeunitlevel:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1025);
                    break;

                case TrophyConditionTypes.unitequip:
                case TrophyConditionTypes.upjoblevel:
                case TrophyConditionTypes.makejoblevel:
                case TrophyConditionTypes.totaljoblv11:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1025);
                    break;

                case TrophyConditionTypes.limitbreak:
                case TrophyConditionTypes.evoltiontimes:
                case TrophyConditionTypes.changejob:
                case TrophyConditionTypes.totalunitlvs:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1025);
                    break;

                case TrophyConditionTypes.buyatshop:
                    this.GotoShop(dataOfClass);
                    break;

                case TrophyConditionTypes.artifacttransmute:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1021);
                    break;

                case TrophyConditionTypes.artifactstrength:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1021);
                    break;

                case TrophyConditionTypes.artifactevolution:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1021);
                    break;

                case TrophyConditionTypes.wintower:
                case TrophyConditionTypes.losetower:
                    QuestTypes quest_type2 = QuestTypes.Tower;
                    if (!questParam.TransSectionGotoTower(dataOfClass.Objectives[0].sval, out quest_type2))
                    {
                        break;
                    }
                    if (quest_type2 == QuestTypes.Event)
                    {
                        FlowNode_GameObject.ActivateOutputLinks((Component)this, 1007);
                        break;
                    }
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1026);
                    break;

                case TrophyConditionTypes.vs:
                case TrophyConditionTypes.vswin:
                    this.GotoVersus();
                    break;

                case TrophyConditionTypes.fblogin:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1040);
                    break;
                }
            }
        }
Esempio n. 17
0
        private void Refresh()
        {
            if (!this.mStarted)
            {
                return;
            }
            if (Object.op_Inequality((Object)this.mCanvasGroup, (Object)null))
            {
                this.mCanvasGroup.set_alpha(0.0f);
            }
            this.ClearItems();
            GameManager instance = MonoSingleton <GameManager> .Instance;

            TrophyParam[] trophies = instance.Trophies;
            PlayerData    player   = instance.Player;

            if (trophies == null || trophies.Length <= 0)
            {
                return;
            }
            if (this.TrophyType == TrophyList.TrophyTypes.Daily)
            {
                MonoSingleton <GameManager> .Instance.Player.DailyAllCompleteCheck();
            }
            int[] numArray1 = new int[trophies.Length];
            for (int index = 0; index < trophies.Length; ++index)
            {
                numArray1[index] = index;
            }
            TrophyState[] trophyStateArray = new TrophyState[trophies.Length];
            for (int index = 0; index < trophies.Length; ++index)
            {
                trophyStateArray[index] = !trophies[index].IsChallengeMission ? player.GetTrophyCounter(trophies[index]) : (TrophyState)null;
            }
            int num = -1;

            if (this.TrophyType == TrophyList.TrophyTypes.All)
            {
                num = 50;
                ulong[] numArray2 = new ulong[trophies.Length];
                for (int index = 0; index < trophies.Length; ++index)
                {
                    DateTime dateTime = trophyStateArray[index] == null ? DateTime.MinValue : trophyStateArray[index].RewardedAt;
                    numArray2[index] = (ulong)((long)((ulong)dateTime.Year % 100UL) * 10000000000L + (long)((ulong)dateTime.Month % 100UL) * 100000000L + (long)((ulong)dateTime.Day % 100UL) * 1000000L + (long)((ulong)dateTime.Hour % 100UL) * 10000L + (long)((ulong)dateTime.Minute % 100UL) * 100L) + (ulong)dateTime.Second % 100UL;
                }
                Dictionary <int, ulong> dictionary = new Dictionary <int, ulong>();
                dictionary.Keys.CopyTo(numArray1, 0);
                dictionary.Values.CopyTo(numArray2, 0);
                Array.Sort <ulong, int>(numArray2, numArray1);
                Array.Reverse((Array)numArray1);
            }
            for (int index1 = 0; index1 < trophies.Length && num != 0; ++index1)
            {
                int         index2 = numArray1[index1];
                TrophyState st     = trophyStateArray[index2];
                if (st != null && st.IsCompleted && (trophies[index2].DispType != TrophyDispType.Award && this.MakeTrophyPlate(trophies[index2], st, true)) && 0 < num)
                {
                    --num;
                }
            }
            for (int index1 = 0; index1 < trophies.Length && num != 0; ++index1)
            {
                int         index2 = numArray1[index1];
                TrophyState st     = trophyStateArray[index2];
                if (st != null && !st.IsCompleted && (trophies[index2].DispType != TrophyDispType.Award && trophies[index2].DispType != TrophyDispType.Hide) && (this.MakeTrophyPlate(trophies[index2], st, false) && 0 < num))
                {
                    --num;
                }
            }
            GameParameter.UpdateValuesOfType(GameParameter.ParameterTypes.TROPHY_BADGE);
        }
Esempio n. 18
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();
            }
        }
Esempio n. 19
0
        private void RefreshTrophyDatas()
        {
            this.trophy_record_datas.Clear();
            this.trophy_daily_datas.Clear();
            this.trophy_ended_datas.Clear();
            this.trophy_category_datas.Clear();
            TrophyCategoryParam[] trophyCategories = MonoSingleton <GameManager> .Instance.MasterParam.TrophyCategories;
            if (trophyCategories == null)
            {
                return;
            }
            for (int index = 0; index < trophyCategories.Length; ++index)
            {
                if (this.IsDisplayTrophyCategory(trophyCategories[index]) && !this.trophy_category_datas.ContainsKey(trophyCategories[index].hash_code))
                {
                    this.trophy_category_datas.Add(trophyCategories[index].hash_code, new TrophyCategoryData(trophyCategories[index]));
                }
            }
            TrophyParam[] trophies = MonoSingleton <GameManager> .Instance.Trophies;
            for (int index = 0; index < trophies.Length; ++index)
            {
                TrophyState trophyCounter = MonoSingleton <GameManager> .Instance.Player.GetTrophyCounter(trophies[index], true);

                if (!trophyCounter.Param.is_none_category_hash && this.IsDisplayTrophy(trophyCounter))
                {
                    if (trophyCounter.IsEnded)
                    {
                        this.trophy_ended_datas.Add(trophyCounter);
                    }
                    else if (trophies[index].DispType != TrophyDispType.Hide && this.trophy_category_datas.ContainsKey(trophyCounter.Param.category_hash_code))
                    {
                        this.trophy_category_datas[trophyCounter.Param.category_hash_code].AddTrophy(trophyCounter);
                    }
                }
            }
            using (Dictionary <int, TrophyCategoryData> .KeyCollection.Enumerator enumerator = this.trophy_category_datas.Keys.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    int current = enumerator.Current;
                    if (this.trophy_category_datas[current].Trophies.Count > 0)
                    {
                        if (!this.trophy_category_datas[current].Param.IsAvailablePeriod(TimeManager.ServerTime, false))
                        {
                            if (this.trophy_category_datas[current].IsInCompletedData)
                            {
                                for (int index = this.trophy_category_datas[current].Trophies.Count - 1; index >= 0; --index)
                                {
                                    if (!this.trophy_category_datas[current].Trophies[index].IsCompleted)
                                    {
                                        this.trophy_category_datas[current].RemoveTrophy(this.trophy_category_datas[current].Trophies[index]);
                                    }
                                }
                            }
                            else
                            {
                                continue;
                            }
                        }
                        if (this.trophy_category_datas[current].Param.IsDaily)
                        {
                            for (int index = 0; index < this.trophy_category_datas[current].Trophies.Count; ++index)
                            {
                                if (this.trophy_category_datas[current].Trophies[index].IsCompleted)
                                {
                                    this.trophy_daily_datas.Add(this.trophy_category_datas[current].Trophies[index]);
                                }
                                else
                                {
                                    this.tmp_trophy_daily_datas.Add(this.trophy_category_datas[current].Trophies[index]);
                                }
                            }
                        }
                        else
                        {
                            if (!this.trophy_record_datas.ContainsKey(this.trophy_category_datas[current].Param.category))
                            {
                                this.trophy_record_datas.Add(this.trophy_category_datas[current].Param.category, new List <TrophyCategoryData>());
                            }
                            this.trophy_category_datas[current].Apply();
                            this.trophy_record_datas[this.trophy_category_datas[current].Param.category].Add(this.trophy_category_datas[current]);
                        }
                    }
                }
            }
            this.trophy_daily_datas.AddRange((IEnumerable <TrophyState>) this.tmp_trophy_daily_datas);
            this.trophy_category_datas.Clear();
            this.tmp_trophy_daily_datas.Clear();
            this.RefreshBadge();
        }
Esempio n. 20
0
        private void OnItemSelect(GameObject go)
        {
            TrophyParam dataOfClass = DataSource.FindDataOfClass <TrophyParam>(go, (TrophyParam)null);

            if (dataOfClass == null)
            {
                return;
            }
            TrophyState trophyCounter = MonoSingleton <GameManager> .Instance.Player.GetTrophyCounter(dataOfClass, true);

            if (!trophyCounter.IsEnded && trophyCounter.IsCompleted)
            {
                if (dataOfClass.IsInvisibleStamina() || !dataOfClass.IsAvailablePeriod(TimeManager.ServerTime, true))
                {
                    UIUtility.NegativeSystemMessage((string)null, LocalizedText.Get("sys.TROPHY_OUTDATED"), (UIUtility.DialogResultEvent)null, (GameObject)null, false, -1);
                    this.Refresh();
                }
                else
                {
                    GlobalVars.SelectedTrophy.Set(dataOfClass.iname);
                    RewardData rewardData = new RewardData(dataOfClass);
                    GlobalVars.LastReward.Set(rewardData);
                    GlobalVars.UnitGetReward = new UnitGetParam(rewardData.Items.ToArray());
                    this.trophy_window.ActivateOutputLinks(2000);
                }
            }
            else
            {
                QuestParam questParam = new QuestParam();
                switch (dataOfClass.Objectives[0].type)
                {
                case TrophyConditionTypes.winquest:
                case TrophyConditionTypes.playerlv:
                case TrophyConditionTypes.winquestsoldier:
                case TrophyConditionTypes.losequest:
                case TrophyConditionTypes.damage_over:
                case TrophyConditionTypes.complete_all_quest_mission:
                case TrophyConditionTypes.has_gold_over:
                case TrophyConditionTypes.complete_all_quest_mission_total:
                case TrophyConditionTypes.complete_all_mission_count:
                case TrophyConditionTypes.complete_story_mission_count:
                    QuestTypes quest_type1 = QuestTypes.Story;
                    if (!questParam.TransSectionGotoQuest(dataOfClass.Objectives[0].sval_base, out quest_type1, new UIUtility.DialogResultEvent(this.MsgBoxJumpToQuest)))
                    {
                        break;
                    }
                    switch (quest_type1)
                    {
                    case QuestTypes.Multi:
                    case QuestTypes.MultiGps:
                        this.trophy_window.ActivateOutputLinks(2005);
                        return;

                    case QuestTypes.Event:
                    case QuestTypes.Gps:
                        this.trophy_window.ActivateOutputLinks(2006);
                        return;

                    case QuestTypes.Character:
                        this.trophy_window.ActivateOutputLinks(2032);
                        return;

                    case QuestTypes.Tower:
                        this.trophy_window.ActivateOutputLinks(2026);
                        return;

                    case QuestTypes.Beginner:
                        this.trophy_window.ActivateOutputLinks(2033);
                        return;

                    default:
                        this.trophy_window.ActivateOutputLinks(2002);
                        return;
                    }

                case TrophyConditionTypes.winelite:
                case TrophyConditionTypes.loseelite:
                    if (!questParam.TransSectionGotoElite(new UIUtility.DialogResultEvent(this.MsgBoxJumpToQuest)))
                    {
                        break;
                    }
                    this.trophy_window.ActivateOutputLinks(2002);
                    break;

                case TrophyConditionTypes.winevent:
                case TrophyConditionTypes.loseevent:
                case TrophyConditionTypes.exclear_fire:
                case TrophyConditionTypes.exclear_water:
                case TrophyConditionTypes.exclear_wind:
                case TrophyConditionTypes.exclear_thunder:
                case TrophyConditionTypes.exclear_light:
                case TrophyConditionTypes.exclear_dark:
                case TrophyConditionTypes.exclear_fire_nocon:
                case TrophyConditionTypes.exclear_water_nocon:
                case TrophyConditionTypes.exclear_wind_nocon:
                case TrophyConditionTypes.exclear_thunder_nocon:
                case TrophyConditionTypes.exclear_light_nocon:
                case TrophyConditionTypes.exclear_dark_nocon:
                case TrophyConditionTypes.complete_event_mission_count:
                    questParam.GotoEventListQuest((string)null, (string)null);
                    this.trophy_window.ActivateOutputLinks(2006);
                    break;

                case TrophyConditionTypes.gacha:
                case TrophyConditionTypes.collectunits:
                    this.trophy_window.ActivateOutputLinks(2001);
                    break;

                case TrophyConditionTypes.multiplay:
                case TrophyConditionTypes.winmulti:
                case TrophyConditionTypes.winmultimore:
                case TrophyConditionTypes.winmultiless:
                    this.trophy_window.ActivateOutputLinks(2005);
                    break;

                case TrophyConditionTypes.ability:
                case TrophyConditionTypes.changeability:
                case TrophyConditionTypes.makeabilitylevel:
                    this.trophy_window.ActivateOutputLinks(2025);
                    break;

                case TrophyConditionTypes.soubi:
                    this.GotoEquip();
                    break;

                case TrophyConditionTypes.buygold:
                    this.trophy_window.ActivateOutputLinks(2003);
                    break;

                case TrophyConditionTypes.arena:
                case TrophyConditionTypes.winarena:
                case TrophyConditionTypes.losearena:
                case TrophyConditionTypes.becomearenarank:
                case TrophyConditionTypes.overarenarank:
                    this.GotoArena();
                    break;

                case TrophyConditionTypes.review:
                    this.trophy_window.ActivateOutputLinks(2029);
                    break;

                case TrophyConditionTypes.fggid:
                    this.trophy_window.ActivateOutputLinks(2008);
                    break;

                case TrophyConditionTypes.unitlevel:
                case TrophyConditionTypes.evolutionnum:
                case TrophyConditionTypes.joblevel:
                case TrophyConditionTypes.upunitlevel:
                case TrophyConditionTypes.makeunitlevel:
                    this.trophy_window.ActivateOutputLinks(2025);
                    break;

                case TrophyConditionTypes.unitequip:
                case TrophyConditionTypes.upjoblevel:
                case TrophyConditionTypes.makejoblevel:
                case TrophyConditionTypes.totaljoblv11:
                    this.trophy_window.ActivateOutputLinks(2025);
                    break;

                case TrophyConditionTypes.limitbreak:
                case TrophyConditionTypes.evoltiontimes:
                case TrophyConditionTypes.changejob:
                case TrophyConditionTypes.totalunitlvs:
                    this.trophy_window.ActivateOutputLinks(2025);
                    break;

                case TrophyConditionTypes.buyatshop:
                    this.GotoShop(dataOfClass);
                    break;

                case TrophyConditionTypes.artifacttransmute:
                case TrophyConditionTypes.artifactstrength:
                case TrophyConditionTypes.artifactevolution:
                case TrophyConditionTypes.upartifactlevel:
                case TrophyConditionTypes.makeartifactlevel:
                    this.trophy_window.ActivateOutputLinks(2021);
                    break;

                case TrophyConditionTypes.wintower:
                case TrophyConditionTypes.losetower:
                case TrophyConditionTypes.tower:
                case TrophyConditionTypes.overtowerscore:
                    QuestTypes quest_type2 = QuestTypes.Tower;
                    if (!questParam.TransSectionGotoTower(dataOfClass.Objectives[0].sval_base, out quest_type2))
                    {
                        break;
                    }
                    QuestTypes questTypes = quest_type2;
                    switch (questTypes)
                    {
                    case QuestTypes.Gps:
                        this.trophy_window.ActivateOutputLinks(2006);
                        return;

                    case QuestTypes.Beginner:
                        this.trophy_window.ActivateOutputLinks(2033);
                        return;

                    default:
                        if (questTypes != QuestTypes.Event)
                        {
                            this.trophy_window.ActivateOutputLinks(2026);
                            return;
                        }
                        goto case QuestTypes.Gps;
                    }

                case TrophyConditionTypes.vs:
                case TrophyConditionTypes.vswin:
                case TrophyConditionTypes.overvsrankfloor:
                    this.GotoVersus();
                    break;

                case TrophyConditionTypes.winstory_extra:
                    if (!questParam.TransSectionGotoStoryExtra(new UIUtility.DialogResultEvent(this.MsgBoxJumpToQuest)))
                    {
                        break;
                    }
                    this.trophy_window.ActivateOutputLinks(2002);
                    break;

                case TrophyConditionTypes.multitower_help:
                case TrophyConditionTypes.multitower:
                    this.GotoMultiTower();
                    break;

                case TrophyConditionTypes.read_tips:
                case TrophyConditionTypes.read_tips_count:
                    this.GotoBeginnerTop();
                    break;

                case TrophyConditionTypes.up_conceptcard_level:
                case TrophyConditionTypes.up_conceptcard_level_target:
                case TrophyConditionTypes.limitbreak_conceptcard:
                case TrophyConditionTypes.limitbreak_conceptcard_target:
                case TrophyConditionTypes.up_conceptcard_trust:
                case TrophyConditionTypes.up_conceptcard_trust_target:
                case TrophyConditionTypes.max_conceptcard_trust:
                    this.trophy_window.ActivateOutputLinks(2035);
                    break;

                case TrophyConditionTypes.unlock_tobira_total:
                case TrophyConditionTypes.unlock_tobira_unit:
                case TrophyConditionTypes.envy_unlock_unit:
                case TrophyConditionTypes.sloth_unlock_unit:
                case TrophyConditionTypes.lust_unlock_unit:
                case TrophyConditionTypes.greed_unlock_unit:
                case TrophyConditionTypes.wrath_unlock_unit:
                case TrophyConditionTypes.gluttonny_unlock_unit:
                case TrophyConditionTypes.pride_unlock_unit:
                    this.trophy_window.ActivateOutputLinks(2025);
                    break;

                case TrophyConditionTypes.send_present:
                    this.trophy_window.ActivateOutputLinks(2039);
                    break;

                case TrophyConditionTypes.complete_ordeal_mission_count:
                case TrophyConditionTypes.clear_ordeal:
                    this.trophy_window.ActivateOutputLinks(2036);
                    break;

                case TrophyConditionTypes.view_news:
                    this.trophy_window.ActivateOutputLinks(2038);
                    break;
                }
            }
        }
Esempio n. 21
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));
                }
            }
        }
Esempio n. 22
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);
            }
        }
Esempio n. 23
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);
                    }
                }
            }
        }
Esempio n. 24
0
 public bool IsShowBadge(TrophyState state)
 {
     return(state != null && !state.IsEnded && state.IsCompleted && ((!this.IsBeginner || MonoSingleton <GameManager> .Instance.Player.IsBeginner()) && (!this.IsInvisibleVip() && !this.IsInvisibleCard())) && (!this.IsInvisibleStamina() && !this.IsChallengeMission && (state.Param.DispType != TrophyDispType.Award && state.Param.DispType != TrophyDispType.Hide) && ((state.Param.RequiredTrophies == null || TrophyParam.CheckRequiredTrophies(MonoSingleton <GameManager> .Instance, state.Param, true, true)) && state.Param.IsAvailablePeriod(TimeManager.ServerTime, true))));
 }
Esempio n. 25
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);
                    }
                }
            }
        }