Exemple #1
0
        private void OnSelectItem(GameObject go)
        {
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ScrollRect, (UnityEngine.Object)null) && this.ListID != 0)
            {
                QuestListV2.mScrollPosCache[this.ListID] = this.ScrollRect.get_verticalNormalizedPosition();
            }
            GlobalVars.SelectedRankingQuestParam = DataSource.FindDataOfClass <RankingQuestParam>(go, (RankingQuestParam)null);
            QuestParam dataOfClass = DataSource.FindDataOfClass <QuestParam>(go, (QuestParam)null);

            if (dataOfClass == null)
            {
                return;
            }
            if (dataOfClass.IsKeyQuest && !dataOfClass.IsKeyUnlock(-1L))
            {
                if (dataOfClass.Chapter != null && dataOfClass.Chapter.CheckHasKeyItem() && dataOfClass.IsDateUnlock(-1L))
                {
                    GlobalVars.KeyQuestTimeOver = true;
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 102);
                }
                else
                {
                    UIUtility.SystemMessage(LocalizedText.Get("sys.KEYQUEST_UNLOCK"), LocalizedText.Get("sys.KEYQUEST_AVAILABLE_CAUTION"), new UIUtility.DialogResultEvent(this.OnCloseKeyQuest), (GameObject)null, true, -1);
                }
            }
            else
            {
                GlobalVars.SelectedQuestID = dataOfClass.iname;
                GlobalVars.LastQuestState.Set(dataOfClass.state);
                if (dataOfClass.IsScenario)
                {
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 101);
                }
                else
                {
                    if ((int)dataOfClass.aplv > MonoSingleton <GameManager> .Instance.Player.Lv)
                    {
                        NotifyList.Push(LocalizedText.Get("sys.QUEST_AP_CONDITION", new object[1]
                        {
                            (object)dataOfClass.aplv
                        }));
                    }
                    FlowNode_OnQuestSelect objectOfType = (FlowNode_OnQuestSelect)UnityEngine.Object.FindObjectOfType <FlowNode_OnQuestSelect>();
                    if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)objectOfType, (UnityEngine.Object)null))
                    {
                        return;
                    }
                    objectOfType.Selected();
                }
            }
        }
Exemple #2
0
        private void NotifyNewFriendRequests()
        {
            PlayerData    player        = MonoSingleton <GameManager> .Instance.Player;
            int           num           = 0;
            StringBuilder stringBuilder = new StringBuilder(200);

            string[] array;
            if (PlayerPrefs.HasKey("FRIENDS"))
            {
                array = PlayerPrefs.GetString("FRIENDS").Split(',');
            }
            else
            {
                array = new string[0];
            }
            for (int index = 0; index < player.FollowerUID.Count; ++index)
            {
                if (Array.IndexOf <string>(array, player.FollowerUID[index]) < 0)
                {
                    ++num;
                }
                if (stringBuilder.Length > 0)
                {
                    stringBuilder.Append(',');
                }
                stringBuilder.Append(player.FollowerUID[index]);
            }
            if (num > 0)
            {
                NotifyList.Push(LocalizedText.Get("sys.FRIENDREQS", new object[1]
                {
                    (object)num
                }));
            }
            PlayerPrefs.SetString("FRIENDS", stringBuilder.ToString());
            PlayerPrefs.Save();
        }