Example #1
0
        private TrophyWindow.TabIndex TrophyCategorysToTabIndex(TrophyCategorys category)
        {
            switch (category)
            {
            case TrophyCategorys.Story:
                return(TrophyWindow.TabIndex.Story);

            case TrophyCategorys.Event:
                return(TrophyWindow.TabIndex.Event);

            case TrophyCategorys.Training:
                return(TrophyWindow.TabIndex.Training);

            default:
                return(TrophyWindow.TabIndex.Other);
            }
        }
Example #2
0
 public bool Deserialize(JSON_TrophyCategoryParam json)
 {
     if (json == null)
     {
         return(false);
     }
     this.iname       = json.iname;
     this.hash_code   = this.iname.GetHashCode();
     this.is_not_pull = json.is_not_pull == 1;
     this.days        = json.day_reset;
     this.beginner    = json.bgnr;
     this.begin_at.Set(json.begin_at, DateTime.MinValue);
     this.end_at.Set(json.end_at, DateTime.MaxValue);
     this.category     = json.category == 0 ? TrophyCategorys.Other : (TrophyCategorys)json.category;
     this.linked_quest = json.linked_quest;
     return(true);
 }
Example #3
0
        private void Initialize()
        {
            this.RefreshTrophyDatas();
            bool flag = false;

            this.SetToggleIsOn(0);
            for (TrophyCategorys index1 = TrophyCategorys.Story; index1 <= TrophyCategorys.Other; ++index1)
            {
                if (this.TrophyRecordDatas.ContainsKey(index1))
                {
                    if (!flag)
                    {
                        for (int index2 = 0; index2 < this.TrophyRecordDatas[index1].Count; ++index2)
                        {
                            if (this.TrophyRecordDatas[index1][index2].IsInCompletedData)
                            {
                                FlowNode_GameObject.ActivateOutputLinks((Component)this, 1001);
                                flag = true;
                                this.SetToggleIsOn((int)this.TrophyCategorysToTabIndex(index1));
                                break;
                            }
                        }
                    }
                    else
                    {
                        break;
                    }
                }
            }
            if (this.DailyCheck())
            {
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 1000);
            }
            else
            {
                if (flag)
                {
                    return;
                }
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 1000);
            }
        }
Example #4
0
        private void RefreshBadge()
        {
            this.story_badge_obj.SetActive(false);
            this.event_badge_obj.SetActive(false);
            this.multi_badge_obj.SetActive(false);
            this.training_badge_obj.SetActive(false);
            this.campaign_badge_obj.SetActive(false);
            this.other_badge_obj.SetActive(false);
            if (Object.op_Inequality((Object)this.daily_badge_obj, (Object)null))
            {
                this.daily_badge_obj.SetActive(false);
                for (int index = 0; index < this.trophy_daily_datas.Count; ++index)
                {
                    if (this.trophy_daily_datas[index].IsCompleted)
                    {
                        this.daily_badge_obj.SetActive(true);
                        break;
                    }
                }
            }
            bool       flag       = false;
            GameObject gameObject = (GameObject)null;

            using (Dictionary <TrophyCategorys, List <TrophyCategoryData> > .KeyCollection.Enumerator enumerator = this.trophy_record_datas.Keys.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    TrophyCategorys current = enumerator.Current;
                    for (int index = 0; index < this.trophy_record_datas[current].Count; ++index)
                    {
                        if (this.trophy_record_datas[current][index].IsInCompletedData)
                        {
                            switch (current)
                            {
                            case TrophyCategorys.Story:
                                gameObject = this.story_badge_obj;
                                goto label_19;

                            case TrophyCategorys.Event:
                                gameObject = this.event_badge_obj;
                                goto label_19;

                            case TrophyCategorys.Multi:
                                gameObject = this.multi_badge_obj;
                                goto label_19;

                            case TrophyCategorys.Training:
                                gameObject = this.training_badge_obj;
                                goto label_19;

                            case TrophyCategorys.Campaign:
                                gameObject = this.campaign_badge_obj;
                                goto label_19;

                            case TrophyCategorys.Other:
                                gameObject = this.other_badge_obj;
                                goto label_19;

                            default:
                                goto label_19;
                            }
                        }
                    }
label_19:
                    if (Object.op_Inequality((Object)gameObject, (Object)null))
                    {
                        flag = true;
                        gameObject.SetActive(true);
                        gameObject = (GameObject)null;
                    }
                }
            }
            this.record_badge_obj.SetActive(flag);
        }
Example #5
0
        public bool Deserialize(JSON_TrophyParam json)
        {
            if (json == null || json.objective == null)
            {
                return(false);
            }
            if (json.flg_quests == null)
            {
                this.RequiredTrophies = new string[0];
            }
            else
            {
                this.RequiredTrophies = new string[json.flg_quests.Length];
                for (int index = 0; index < json.flg_quests.Length; ++index)
                {
                    this.RequiredTrophies[index] = json.flg_quests[index];
                }
            }
            this.Objectives = new TrophyObjective[json.objective.Length];
            for (int index = 0; index < json.objective.Length; ++index)
            {
                this.Objectives[index]       = new TrophyObjective();
                this.Objectives[index].Param = this;
                this.Objectives[index].index = index;
                if (!this.Objectives[index].Deserialize(json.objective[index]))
                {
                    return(false);
                }
            }
            this.iname    = json.iname;
            this.begin_at = json.begin_at;
            this.end_at   = json.end_at;
            this.Name     = json.name;
            this.Expr     = json.expr;
            this.Gold     = json.reward_gold;
            this.Coin     = json.reward_coin;
            this.Exp      = json.reward_exp;
            this.Stamina  = json.reward_stamina;
            this.Days     = json.day_reset & 1;
            this.ConvertDayRepeat(json.day_reset);
            this.Beginner     = json.bgnr;
            this.ParentTrophy = json.parent_iname;
            this.help         = json.help;
            this.Category     = json.category == 0 ? TrophyCategorys.Other : (TrophyCategorys)json.category;
            this.DispType     = (TrophyDispType)json.disp;
            int length = 0;

            if (!string.IsNullOrEmpty(json.reward_item1_iname) && json.reward_item1_num > 0)
            {
                ++length;
            }
            if (!string.IsNullOrEmpty(json.reward_item2_iname) && json.reward_item2_num > 0)
            {
                ++length;
            }
            if (!string.IsNullOrEmpty(json.reward_item3_iname) && json.reward_item3_num > 0)
            {
                ++length;
            }
            this.Items = new TrophyParam.RewardItem[length];
            int index1 = 0;

            if (!string.IsNullOrEmpty(json.reward_item1_iname) && json.reward_item1_num > 0)
            {
                this.Items[index1].iname = json.reward_item1_iname;
                this.Items[index1].Num   = json.reward_item1_num;
                ++index1;
            }
            if (!string.IsNullOrEmpty(json.reward_item2_iname) && json.reward_item2_num > 0)
            {
                this.Items[index1].iname = json.reward_item2_iname;
                this.Items[index1].Num   = json.reward_item2_num;
                ++index1;
            }
            if (!string.IsNullOrEmpty(json.reward_item3_iname) && json.reward_item3_num > 0)
            {
                this.Items[index1].iname = json.reward_item3_iname;
                this.Items[index1].Num   = json.reward_item3_num;
                int num = index1 + 1;
            }
            return(true);
        }