Пример #1
0
        private void OnUnitSelect(SRPG_Button button)
        {
            if (!((Selectable)button).get_interactable() || this.mSelectQuestFlag)
            {
                return;
            }
            QuestBookmarkWindow.ItemAndQuests dataOfClass1 = DataSource.FindDataOfClass <QuestBookmarkWindow.ItemAndQuests>(((Component)button).get_gameObject(), (QuestBookmarkWindow.ItemAndQuests)null);
            long currentTime = Network.GetServerTime();

            QuestParam[] availableQuests = MonoSingleton <GameManager> .Instance.Player.AvailableQuests;
            QuestParam[] questParamArray = !(this.mLastSectionName == this.BookmarkSectionName) ? dataOfClass1.quests.Where <QuestParam>((Func <QuestParam, bool>)(q => q.world == this.mLastSectionName)).ToArray <QuestParam>() : QuestDropParam.Instance.GetItemDropQuestList(MonoSingleton <GameManager> .Instance.MasterParam.GetItemParam(dataOfClass1.itemName), GlobalVars.GetDropTableGeneratedDateTime()).Where <QuestParam>((Func <QuestParam, bool>)(q => ((IEnumerable <string>) this.mAvailableSections).Contains <string>(q.world))).ToArray <QuestParam>();
            if (questParamArray.Length <= 0)
            {
                return;
            }
            List <QuestParam> questParamList = new List <QuestParam>();

            foreach (QuestParam questParam1 in questParamArray)
            {
                foreach (QuestParam questParam2 in ((IEnumerable <QuestParam>)availableQuests).Where <QuestParam>((Func <QuestParam, bool>)(q => this.IsAvailableQuest(q, currentTime))))
                {
                    if (questParam1.iname == questParam2.iname)
                    {
                        questParamList.Add(questParam1);
                    }
                }
            }
            if (questParamList.Count <= 0)
            {
                QuestParam questParam = questParamArray[0];
                UIUtility.SystemMessage((string)null, LocalizedText.Get("sys.TXT_QUESTBOOKMARK_BOOKMARK_NOT_AVAIABLE_QUEST", (object)questParam.title, (object)questParam.name), (UIUtility.DialogResultEvent)null, (GameObject)null, true, -1);
            }
            else if (this.mIsBookmarkEditing)
            {
                this.OnUnitSelectBookmark(dataOfClass1, (BookmarkUnit)((Component)button).GetComponent <BookmarkUnit>());
            }
            else if (questParamArray.Length > 1)
            {
                if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.QuestSelectorTemplate, (UnityEngine.Object)null))
                {
                    return;
                }
                GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.QuestSelectorTemplate);
                gameObject.get_transform().SetParent(((Component)this).get_transform().get_parent(), false);
                QuestBookmarkKakeraWindow component = (QuestBookmarkKakeraWindow)gameObject.GetComponent <QuestBookmarkKakeraWindow>();
                if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
                {
                    return;
                }
                UnitParam dataOfClass2 = DataSource.FindDataOfClass <UnitParam>(((Component)button).get_gameObject(), (UnitParam)null);
                component.Refresh(dataOfClass2, (IEnumerable <QuestParam>)questParamArray);
            }
            else
            {
                this.mSelectQuestFlag      = true;
                GlobalVars.SelectedQuestID = questParamArray[0].iname;
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 100);
            }
        }
Пример #2
0
        private void OnUnitSelect(SRPG_Button button)
        {
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            QuestBookmarkWindow.\u003COnUnitSelect\u003Ec__AnonStorey367 selectCAnonStorey367 = new QuestBookmarkWindow.\u003COnUnitSelect\u003Ec__AnonStorey367();
            // ISSUE: reference to a compiler-generated field
            selectCAnonStorey367.\u003C\u003Ef__this = this;
            if (!((Selectable)button).get_interactable())
            {
                return;
            }
            QuestBookmarkWindow.ItemAndQuests dataOfClass1 = DataSource.FindDataOfClass <QuestBookmarkWindow.ItemAndQuests>(((Component)button).get_gameObject(), (QuestBookmarkWindow.ItemAndQuests)null);
            // ISSUE: reference to a compiler-generated field
            selectCAnonStorey367.currentTime = Network.GetServerTime();
            QuestParam[] availableQuests = MonoSingleton <GameManager> .Instance.Player.AvailableQuests;
            // ISSUE: reference to a compiler-generated method
            // ISSUE: reference to a compiler-generated method
            QuestParam[] questParamArray = !(this.mLastSectionName == this.BookmarkSectionName) ? dataOfClass1.quests.Where <QuestParam>(new Func <QuestParam, bool>(selectCAnonStorey367.\u003C\u003Em__3E8)).ToArray <QuestParam>() : QuestDropParam.Instance.GetItemDropQuestList(MonoSingleton <GameManager> .Instance.MasterParam.GetItemParam(dataOfClass1.itemName), GlobalVars.GetDropTableGeneratedDateTime()).Where <QuestParam>(new Func <QuestParam, bool>(selectCAnonStorey367.\u003C\u003Em__3E7)).ToArray <QuestParam>();
            if (questParamArray.Length <= 0)
            {
                return;
            }
            List <QuestParam> questParamList = new List <QuestParam>();

            foreach (QuestParam questParam1 in questParamArray)
            {
                // ISSUE: reference to a compiler-generated method
                foreach (QuestParam questParam2 in ((IEnumerable <QuestParam>)availableQuests).Where <QuestParam>(new Func <QuestParam, bool>(selectCAnonStorey367.\u003C\u003Em__3E9)))
                {
                    if (questParam1.iname == questParam2.iname)
                    {
                        questParamList.Add(questParam1);
                    }
                }
            }
            if (questParamList.Count <= 0)
            {
                QuestParam questParam = questParamArray[0];
                UIUtility.SystemMessage((string)null, LocalizedText.Get("sys.TXT_QUESTBOOKMARK_BOOKMARK_NOT_AVAIABLE_QUEST", (object)questParam.title, (object)questParam.name), (UIUtility.DialogResultEvent)null, (GameObject)null, true, -1);
            }
            else if (this.mIsBookmarkEditing)
            {
                this.OnUnitSelectBookmark(dataOfClass1, (BookmarkUnit)((Component)button).GetComponent <BookmarkUnit>());
            }
            else if (questParamArray.Length > 1)
            {
                if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.QuestSelectorTemplate, (UnityEngine.Object)null))
                {
                    return;
                }
                GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.QuestSelectorTemplate);
                gameObject.get_transform().SetParent(((Component)this).get_transform().get_parent(), false);
                QuestBookmarkKakeraWindow component = (QuestBookmarkKakeraWindow)gameObject.GetComponent <QuestBookmarkKakeraWindow>();
                if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
                {
                    return;
                }
                UnitParam dataOfClass2 = DataSource.FindDataOfClass <UnitParam>(((Component)button).get_gameObject(), (UnitParam)null);
                component.Refresh(dataOfClass2, (IEnumerable <QuestParam>)questParamArray);
            }
            else
            {
                GlobalVars.SelectedQuestID = questParamArray[0].iname;
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 100);
            }
        }