Пример #1
0
        static public InterestType IsItItemOfInterest(PoeItem i, PoeItemsManager ItemsManager, out int ExtraParam)
        {
            if (i.FrameType == PoeItem.FrameTypeIndex.Rare)
            {
                if (ItemsManager.RareItemNames[i.Name] > 1)
                {
                    ExtraParam = ItemsManager.RareItemNames[i.Name];
                    return(InterestType.RareNameMatch);
                }

                //foreach (PoeItem.ItemProperty prop in i.ItemProperties)
                //{
                //    if (prop.Name == "Quality")
                //    {
                //        int quality = int.Parse(prop.Values[0].Value.Remove(prop.Values[0].Value.Length - 1, 1));
                //        if (quality >= 16)
                //        {
                //            ExtraParam = quality;
                //            return InterestType.HighQualityRare;
                //        }
                //    }
                //}
            }
            ExtraParam = 0;
            return(InterestType.None);
        }
Пример #2
0
        public static void CleanObseleteFilters(PoeItemsManager itemsManager)
        {
            int leagueIndex = 0;

            foreach (var filterListByLeague in UncheckedFiltersEx)
            {
                List <string> itemsToDel = new List <string>();
                foreach (string filterInfo in filterListByLeague)
                {
                    string[] filter = filterInfo.Split('@');
                    if (itemsManager.OwnerStashNames.ContainsKey(filter[0]))
                    {
                        if (!itemsManager.OwnerStashNames[filter[0]].Contains(filter[1]))
                        {
                            itemsToDel.Add(filterInfo);
                        }
                    }
                    else
                    {
                        itemsToDel.Add(filterInfo);
                    }
                }
                if (itemsToDel.Count != 0)
                {
                    foreach (var filterItem in itemsToDel)
                    {
                        filterListByLeague.Remove(filterItem);
                    }
                    Save(leagueIndex);
                }
                leagueIndex++;
            }
        }
Пример #3
0
        public ItemsOfInterest(PoeItemsManager items, PoeAccManager accounts)
        {
            if (FirstWindowLoad)
            {
                CleanObseleteFilters(items);
                FirstWindowLoad = false;
            }

            InitializeComponent();
            //AccountsManager = accounts;
            ItemsManager    = items;
            LeagueIndex     = (int)ItemsManager.LeagueIndex;
            InterestedItems = new Helpers.ObservableSortedList <ItemOfInterest>();

            FiltersList = new Helpers.ObservableSortedList <FilterEntry>();

            OwnersList = new SortedSet <string>();
            foreach (var cm in items.OwnerStashNames)
            {
                string owner = cm.Key;
                foreach (string stash in items.OwnerStashNames[owner])
                {
                    FiltersList.Add(new FilterEntry(cm.Key, stash, !UncheckedFiltersEx[LeagueIndex].Contains(cm.Key + '@' + stash)));
                }
            }

            foreach (PoeAccHandler acc in accounts)
            {
                OwnersList.Add(acc.UserDisplayName);
            }
            RefreshItemsOfInterest();
            RefreshVisibilityOfFilteredItems();
            lvItems.ItemsSource   = InterestedItems;
            lvFilters.ItemsSource = FiltersList;
        }
Пример #4
0
 public ItemOwnerManager(PoeItemsManager pim)
 {
     InitializeComponent();
     ItemManager = pim;
     Items = new ObservableCollection<ItemOwnerListEntry>();
     foreach (var cm in pim.OwnerItemsListUpdateTime)
     {
         Items.Add(new ItemOwnerListEntry(cm.Key,cm.Value));
     }
     lvOwners.Items.SortDescriptions.Add(new System.ComponentModel.SortDescription("Owner", System.ComponentModel.ListSortDirection.Ascending));
     lvOwners.ItemsSource = Items;
 }
Пример #5
0
        private void LoadItemManager()
        {
            ItemsManagers = new PoeItemsManager[StaticVariables.LeagueNames.Length];
            for (int x = 0; x < StaticVariables.LeagueNames.Length; x++)
            {
                ItemsManagers[x] = new PoeItemsManager((LeagueId)x);
                try
                {
                    if (Serializer<PoeItemsManager>.PropertiesKeyExists(ItemsManagers[x].GetPropertiesKeyName()))
                    {
                        PoeItemsManager loadedManager = Serializer<PoeItemsManager>.DeserializeFromProperties(ItemsManagers[x].GetPropertiesKeyName());
                        ItemsManagers[x] = loadedManager;
                    }
                }
                catch (Exception ex)
                {
                    AddLogEntry("[" + StaticVariables.LeagueNames[x] + "] Error Loading items (Item Cache is probably lost): " + ex.Message);
                }

                ItemsManagers[x].SetMainWindowWithLog(this);
                ItemsManagers[x].RecalculateFields();
            }
        }