Ejemplo n.º 1
0
        public PackInfoListView(VirtualItemPack pack)
        {
            _listControl = new ReorderableListControl(ReorderableListFlags.DisableDuplicateCommand |
                                                      ReorderableListFlags.ShowIndices);
            _listControl.ItemInserted += OnItemInsert;
            _listControl.ItemRemoving += OnItemRemoving;

            _itemPopupDrawers = new List <ItemPopupDrawer>();
            UpdateItemPopupDrawers();
        }
Ejemplo n.º 2
0
        public void UpdateDisplayItem(VirtualItemPack pack)
        {
            _currentDisplayedPack = pack;
            if (pack != null)
            {
                _listAdaptor = new GenericClassListAdaptor <PackElement>(pack.PackElements, 18,
                                                                         CreatePackElement, DrawPackElement);

                UpdateItemPopupDrawers();
            }
        }
Ejemplo n.º 3
0
 private void UpdateRelatedIDOfItems(IItem[] items, string oldID, string newID)
 {
     foreach (var item in items)
     {
         if (item is Gate)
         {
             Gate gate = item as Gate;
             if (gate.RelatedItemID.Equals(oldID))
             {
                 gate.RelatedItemID = newID;
             }
         }
         else if (item is UpgradeItem)
         {
             UpgradeItem upgrade = item as UpgradeItem;
             if (upgrade.RelatedItemID.Equals(oldID))
             {
                 upgrade.RelatedItemID = newID;
                 upgrade.ID            = upgrade.ID.Replace(oldID, newID);
             }
         }
         else if (item is Reward)
         {
             Reward reward = item as Reward;
             if (reward.RelatedItemID.Equals(oldID))
             {
                 reward.RelatedItemID = newID;
             }
         }
         else if (item is Score)
         {
             Score score = item as Score;
             if (score.RelatedVirtualItemID.Equals(oldID))
             {
                 score.RelatedVirtualItemID = newID;
             }
         }
         else if (item is VirtualCategory)
         {
             VirtualCategory category = item as VirtualCategory;
             for (int i = 0; i < category.ItemIDs.Count; i++)
             {
                 if (category.ItemIDs[i].Equals(oldID))
                 {
                     category.ItemIDs[i] = newID;
                 }
             }
         }
         else if (item is VirtualItem)
         {
             if (item is PurchasableItem)
             {
                 PurchasableItem purchsable = item as PurchasableItem;
                 for (int i = 0; i < purchsable.PurchaseInfo.Count; i++)
                 {
                     if (!purchsable.PurchaseInfo[i].IsMarketPurchase &&
                         purchsable.PurchaseInfo[i].VirtualCurrencyID.Equals(oldID))
                     {
                         purchsable.PurchaseInfo[i].VirtualCurrencyID = newID;
                     }
                 }
             }
             if (item is VirtualItemPack)
             {
                 VirtualItemPack pack = item as VirtualItemPack;
                 for (int i = 0; i < pack.PackElements.Count; i++)
                 {
                     if (pack.PackElements[i].ItemID.Equals(oldID))
                     {
                         pack.PackElements[i].ItemID = newID;
                     }
                 }
             }
         }
     }
 }