public static void PrepareSelling() { //ClearAllItemOrderLists(); ItemSetListHighlight.Clear(); if (ApiAdapter.IsFetching) { return; } if (ItemSetList == null) { return; } //Trace.WriteLine(StashTabList.StashTabs.Count, "stashtab count"); foreach (StashTab s in StashTabList.StashTabs) { s.PrepareOverlayList(); } foreach (ItemSet itemSet in ItemSetList) { itemSet.OrderItems(); //GlobalItemOrderList.AddRange(itemSet.ItemList); } if (Properties.Settings.Default.ExaltedRecipe) { ItemSetShaper.OrderItems(); ItemSetElder.OrderItems(); ItemSetWarlord.OrderItems(); ItemSetCrusader.OrderItems(); ItemSetHunter.OrderItems(); ItemSetRedeemer.OrderItems(); if (ItemSetShaper.EmptyItemSlots.Count == 0) { ItemSetListHighlight.Add(new ItemSet { ItemList = new List <Item>(ItemSetShaper.ItemList), EmptyItemSlots = new List <string>(ItemSetShaper.EmptyItemSlots) }); } if (ItemSetElder.EmptyItemSlots.Count == 0) { ItemSetListHighlight.Add(new ItemSet { ItemList = new List <Item>(ItemSetElder.ItemList), EmptyItemSlots = new List <string>(ItemSetElder.EmptyItemSlots) }); } if (ItemSetCrusader.EmptyItemSlots.Count == 0) { ItemSetListHighlight.Add(new ItemSet { ItemList = new List <Item>(ItemSetCrusader.ItemList), EmptyItemSlots = new List <string>(ItemSetCrusader.EmptyItemSlots) }); } if (ItemSetHunter.EmptyItemSlots.Count == 0) { ItemSetListHighlight.Add(new ItemSet { ItemList = new List <Item>(ItemSetHunter.ItemList), EmptyItemSlots = new List <string>(ItemSetHunter.EmptyItemSlots) }); } if (ItemSetWarlord.EmptyItemSlots.Count == 0) { ItemSetListHighlight.Add(new ItemSet { ItemList = new List <Item>(ItemSetWarlord.ItemList), EmptyItemSlots = new List <string>(ItemSetWarlord.EmptyItemSlots) }); } if (ItemSetRedeemer.EmptyItemSlots.Count == 0) { ItemSetListHighlight.Add(new ItemSet { ItemList = new List <Item>(ItemSetRedeemer.ItemList), EmptyItemSlots = new List <string>(ItemSetRedeemer.EmptyItemSlots) }); } } //ItemSetListHighlight = new List<ItemSet>(ItemSetList); foreach (ItemSet set in ItemSetList) { if (set.HasChaos) { ItemSetListHighlight.Add(new ItemSet { ItemList = new List <Item>(set.ItemList), EmptyItemSlots = new List <string>(set.EmptyItemSlots) }); } } }
// public static void ActivateNextCell(bool active, Cell cell) { if (active) { if (Properties.Settings.Default.HighlightMode == 0) { //activate cell by cell foreach (StashTab s in StashTabList.StashTabs) { s.DeactivateItemCells(); s.TabHeaderColor = Brushes.Transparent; } // remove and sound if itemlist empty if (ItemSetListHighlight.Count > 0) { if (ItemSetListHighlight[0].ItemList.Count == 0) { ItemSetListHighlight.RemoveAt(0); PlayerSet.Dispatcher.Invoke(() => { PlayNotificationSoundSetPicked(); }); } } else { if (ItemSetListHighlight.Count > 0) { PlayerSet.Dispatcher.Invoke(() => { PlayNotificationSoundSetPicked(); }); } } // next item if itemlist not empty if (ItemSetListHighlight.Count > 0) { if (ItemSetListHighlight[0].ItemList.Count > 0 && ItemSetListHighlight[0].EmptyItemSlots.Count == 0) { Item highlightItem = ItemSetListHighlight[0].ItemList[0]; StashTab currentTab = GetStashTabFromItem(highlightItem); if (currentTab != null) { currentTab.ActivateItemCells(highlightItem); if (Properties.Settings.Default.ColorStash != "") { currentTab.TabHeaderColor = new SolidColorBrush((System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString(Properties.Settings.Default.ColorStash)); } else { currentTab.TabHeaderColor = Brushes.Red; } ItemSetListHighlight[0].ItemList.RemoveAt(0); } //check for full sets //if (ItemSetListHighlight[0].ItemList.Count <= 0) //{ //} } } } else if (Properties.Settings.Default.HighlightMode == 1) { // activate whole set if (ItemSetListHighlight.Count > 0) { Trace.WriteLine(ItemSetListHighlight[0].ItemList.Count, "item list count"); Trace.WriteLine(ItemSetListHighlight.Count, "itemset list ocunt"); // check for full sets if (ItemSetListHighlight[0].EmptyItemSlots.Count == 0) { if (cell != null) { Item highlightItem = cell.CellItem; StashTab currentTab = GetStashTabFromItem(highlightItem); if (currentTab != null) { currentTab.DeactivateSingleItemCells(cell.CellItem); currentTab.TabHeaderColor = Brushes.Transparent; ItemSetListHighlight[0].ItemList.Remove(highlightItem); } } //Trace.WriteLine("IS HERE IS HERE IS HERE"); foreach (Item i in ItemSetListHighlight[0].ItemList) { //currentTab.ActivateItemCells(i); StashTab currTab = GetStashTabFromItem(i); currTab.ActivateItemCells(i); //currTab.ShowNumbersOnActiveCells(); if (Properties.Settings.Default.ColorStash != "") { currTab.TabHeaderColor = new SolidColorBrush((System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString(Properties.Settings.Default.ColorStash)); } else { currTab.TabHeaderColor = Brushes.Red; } } // mark item order if (ItemSetListHighlight[0] != null) { if (ItemSetListHighlight[0].ItemList.Count > 0) { StashTab cTab = GetStashTabFromItem(ItemSetListHighlight[0].ItemList[0]); cTab.MarkNextItem(ItemSetListHighlight[0].ItemList[0]); } } if (ItemSetListHighlight[0].ItemList.Count == 0) { //Trace.WriteLine("itemsetlist gets removes0"); ItemSetListHighlight.RemoveAt(0); // activate next set ActivateNextCell(true, null); PlayerSet.Dispatcher.Invoke(() => { PlayNotificationSoundSetPicked(); }); } } } } else if (Properties.Settings.Default.HighlightMode == 2) { //activate all cells at once if (ItemSetListHighlight.Count > 0) { foreach (ItemSet set in ItemSetListHighlight) { if (set.EmptyItemSlots.Count == 0) { if (cell != null) { Item highlightItem = cell.CellItem; StashTab currentTab = GetStashTabFromItem(highlightItem); if (currentTab != null) { currentTab.DeactivateSingleItemCells(cell.CellItem); currentTab.TabHeaderColor = Brushes.Transparent; ItemSetListHighlight[0].ItemList.Remove(highlightItem); } } } } } } } }