Exemplo n.º 1
0
 private void SetActivateWithoutBookmarkedUnit(bool doActivate)
 {
     using (List <GameObject> .Enumerator enumerator = this.mCurrentUnitObjects.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             BookmarkUnit component = (BookmarkUnit)enumerator.Current.GetComponent <BookmarkUnit>();
             ItemParam    param     = DataSource.FindDataOfClass <ItemParam>(((Component)component).get_gameObject(), (ItemParam)null);
             if (param != null && this.mBookmarkedPieces.FirstOrDefault <QuestBookmarkWindow.ItemAndQuests>((Func <QuestBookmarkWindow.ItemAndQuests, bool>)(b => b.itemName == param.iname)) == null)
             {
                 ((Selectable)component.Button).set_interactable(doActivate);
                 component.Overlay.SetActive(!doActivate);
             }
         }
     }
 }
Exemplo n.º 2
0
 private void OnUnitSelectBookmark(QuestBookmarkWindow.ItemAndQuests target, BookmarkUnit unit)
 {
     if (this.mBookmarkedPieces.Exists((Predicate <QuestBookmarkWindow.ItemAndQuests>)(p => p.itemName == target.itemName)))
     {
         this.DeleteBookmark(target);
         if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)unit, (UnityEngine.Object)null))
         {
             return;
         }
         unit.BookmarkIcon.SetActive(false);
     }
     else
     {
         bool flag = this.AddBookmark(target);
         if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)unit, (UnityEngine.Object)null) || !flag)
         {
             return;
         }
         unit.BookmarkIcon.SetActive(true);
     }
 }
Exemplo n.º 3
0
        private void CreateUnitPanels(IEnumerable <QuestBookmarkWindow.ItemAndQuests> targetPieces, string sectionName)
        {
            UnitParam[] allUnits = MonoSingleton <GameManager> .Instance.MasterParam.GetAllUnits();

            Dictionary <string, QuestParam> dictionary = ((IEnumerable <QuestParam>)MonoSingleton <GameManager> .Instance.Player.AvailableQuests).ToDictionary <QuestParam, string>((Func <QuestParam, string>)(quest => quest.iname));

            foreach (QuestBookmarkWindow.ItemAndQuests targetPiece in targetPieces)
            {
                QuestBookmarkWindow.ItemAndQuests itemQuests = targetPiece;
                GameObject   root      = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.ItemTemplate);
                BookmarkUnit component = (BookmarkUnit)root.GetComponent <BookmarkUnit>();
                bool         flag1     = this.mBookmarkedPieces.Exists((Predicate <QuestBookmarkWindow.ItemAndQuests>)(p => p.itemName == itemQuests.itemName));
                component.BookmarkIcon.SetActive(flag1);
                long serverTime = Network.GetServerTime();
                bool flag2      = false;
                foreach (QuestParam questParam1 in !(sectionName == this.BookmarkSectionName) ? itemQuests.quests.Where <QuestParam>((Func <QuestParam, bool>)(q => q.world == sectionName)) : (IEnumerable <QuestParam>)itemQuests.quests)
                {
                    QuestParam questParam2;
                    if (dictionary.TryGetValue(questParam1.iname, out questParam2) && this.IsAvailableQuest(questParam2, serverTime))
                    {
                        flag2 = true;
                        break;
                    }
                }
                component.Overlay.SetActive(!flag2);
                component.Button.AddListener(new SRPG_Button.ButtonClickEvent(this.OnUnitSelect));
                ItemParam itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(itemQuests.itemName);

                UnitParam data = ((IEnumerable <UnitParam>)allUnits).FirstOrDefault <UnitParam>((Func <UnitParam, bool>)(unit => unit.piece == itemParam.iname));
                DataSource.Bind <ItemParam>(root, itemParam);
                DataSource.Bind <UnitParam>(root, data);
                DataSource.Bind <QuestBookmarkWindow.ItemAndQuests>(root, itemQuests);
                root.get_transform().SetParent(this.ItemContainer.get_transform(), false);
                this.mCurrentUnitObjects.Add(root);
                GameParameter.UpdateAll(root);
                root.SetActive(true);
            }
        }
Exemplo n.º 4
0
 private void SetActivateWithoutBookmarkedUnit(bool doActivate)
 {
     using (List <GameObject> .Enumerator enumerator = this.mCurrentUnitObjects.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             GameObject current = enumerator.Current;
             // ISSUE: object of a compiler-generated type is created
             // ISSUE: variable of a compiler-generated type
             QuestBookmarkWindow.\u003CSetActivateWithoutBookmarkedUnit\u003Ec__AnonStorey368 unitCAnonStorey368 = new QuestBookmarkWindow.\u003CSetActivateWithoutBookmarkedUnit\u003Ec__AnonStorey368();
             BookmarkUnit component = (BookmarkUnit)current.GetComponent <BookmarkUnit>();
             // ISSUE: reference to a compiler-generated field
             unitCAnonStorey368.param = DataSource.FindDataOfClass <ItemParam>(((Component)component).get_gameObject(), (ItemParam)null);
             // ISSUE: reference to a compiler-generated field
             // ISSUE: reference to a compiler-generated method
             if (unitCAnonStorey368.param != null && this.mBookmarkedPieces.FirstOrDefault <QuestBookmarkWindow.ItemAndQuests>(new Func <QuestBookmarkWindow.ItemAndQuests, bool>(unitCAnonStorey368.\u003C\u003Em__3EA)) == null)
             {
                 ((Selectable)component.Button).set_interactable(doActivate);
                 component.Overlay.SetActive(!doActivate);
             }
         }
     }
 }
Exemplo n.º 5
0
        private void CreateUnitPanels(IEnumerable <QuestBookmarkWindow.ItemAndQuests> targetPieces, string sectionName)
        {
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            QuestBookmarkWindow.\u003CCreateUnitPanels\u003Ec__AnonStorey365 panelsCAnonStorey365 = new QuestBookmarkWindow.\u003CCreateUnitPanels\u003Ec__AnonStorey365();
            // ISSUE: reference to a compiler-generated field
            panelsCAnonStorey365.sectionName = sectionName;
            UnitParam[] allUnits = MonoSingleton <GameManager> .Instance.MasterParam.GetAllUnits();

            Dictionary <string, QuestParam> dictionary = ((IEnumerable <QuestParam>)MonoSingleton <GameManager> .Instance.Player.AvailableQuests).ToDictionary <QuestParam, string>((Func <QuestParam, string>)(quest => quest.iname));

            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            QuestBookmarkWindow.\u003CCreateUnitPanels\u003Ec__AnonStorey364 panelsCAnonStorey364 = new QuestBookmarkWindow.\u003CCreateUnitPanels\u003Ec__AnonStorey364();
            foreach (QuestBookmarkWindow.ItemAndQuests targetPiece in targetPieces)
            {
                // ISSUE: reference to a compiler-generated field
                panelsCAnonStorey364.itemQuests = targetPiece;
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                QuestBookmarkWindow.\u003CCreateUnitPanels\u003Ec__AnonStorey366 panelsCAnonStorey366 = new QuestBookmarkWindow.\u003CCreateUnitPanels\u003Ec__AnonStorey366();
                // ISSUE: reference to a compiler-generated field
                panelsCAnonStorey366.\u003C\u003Ef__ref\u0024869 = panelsCAnonStorey365;
                // ISSUE: reference to a compiler-generated field
                panelsCAnonStorey366.\u003C\u003Ef__ref\u0024868 = panelsCAnonStorey364;
                GameObject   root      = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.ItemTemplate);
                BookmarkUnit component = (BookmarkUnit)root.GetComponent <BookmarkUnit>();
                // ISSUE: reference to a compiler-generated method
                bool flag1 = this.mBookmarkedPieces.Exists(new Predicate <QuestBookmarkWindow.ItemAndQuests>(panelsCAnonStorey366.\u003C\u003Em__3E4));
                component.BookmarkIcon.SetActive(flag1);
                long serverTime = Network.GetServerTime();
                bool flag2      = false;
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated method
                // ISSUE: reference to a compiler-generated field
                foreach (QuestParam questParam1 in !(panelsCAnonStorey365.sectionName == this.BookmarkSectionName) ? panelsCAnonStorey364.itemQuests.quests.Where <QuestParam>(new Func <QuestParam, bool>(panelsCAnonStorey366.\u003C\u003Em__3E5)) : (IEnumerable <QuestParam>)panelsCAnonStorey364.itemQuests.quests)
                {
                    QuestParam questParam2;
                    if (dictionary.TryGetValue(questParam1.iname, out questParam2) && this.IsAvailableQuest(questParam2, serverTime))
                    {
                        flag2 = true;
                        break;
                    }
                }
                component.Overlay.SetActive(!flag2);
                component.Button.AddListener(new SRPG_Button.ButtonClickEvent(this.OnUnitSelect));
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated field
                panelsCAnonStorey366.itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(panelsCAnonStorey364.itemQuests.itemName);

                // ISSUE: reference to a compiler-generated method
                UnitParam data = ((IEnumerable <UnitParam>)allUnits).FirstOrDefault <UnitParam>(new Func <UnitParam, bool>(panelsCAnonStorey366.\u003C\u003Em__3E6));
                // ISSUE: reference to a compiler-generated field
                DataSource.Bind <ItemParam>(root, panelsCAnonStorey366.itemParam);
                DataSource.Bind <UnitParam>(root, data);
                // ISSUE: reference to a compiler-generated field
                DataSource.Bind <QuestBookmarkWindow.ItemAndQuests>(root, panelsCAnonStorey364.itemQuests);
                root.get_transform().SetParent(this.ItemContainer.get_transform(), false);
                this.mCurrentUnitObjects.Add(root);
                GameParameter.UpdateAll(root);
                root.SetActive(true);
            }
        }