private void NewLGSItem_Click(object sender, RoutedEventArgs e) { SlotType slot = SlotType.None; if (tvItems.SelectedItem != null) { slot = (SlotType)(tvItems.SelectedItem as TreeViewItem).Tag; } else { if (!GetSlot(SlotType.None, LGSCrafting.LGSItemContainer.DisallowedSlots, out slot)) { return; } } if (slot == SlotType.None) { return; } LGSCrafting.LGSItemContainer lic = new LGSCrafting.LGSItemContainer { Name = "<Custom Item>" }; lic.BaseItem = DatasetManager.Dataset.Items.Find(i => i.Name.StartsWith("Legendary Green Steel") && i.Slot == slot); CustomItemsManager.CustomItems.Add(lic); TreeViewItem tvi = AddItemToTreeView(lic); tvi.BringIntoView(); tvi.IsSelected = true; }
public LGSItemPropertyData(LGSCrafting.LGSItemContainer item, int slot) { LGSItem = item; LGSSlot = slot; Slot = "Tier " + (slot + 1); AvailableProperties = LGSCrafting.LGSAugments[Slot]; }
public static bool Load() { try { CustomItems = new List <ACustomItemContainer>(); XmlDocument doc = new XmlDocument(); doc.Load(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "customitems.xml")); foreach (XmlElement xi in doc.GetElementsByTagName("CustomItem")) { string name = xi.Attributes["name"].Value; ItemDataSource source = (ItemDataSource)Enum.Parse(typeof(ItemDataSource), xi.Attributes["source"].Value); switch (source) { case ItemDataSource.LegendaryGreenSteel: LGSCrafting.LGSItemContainer lic = new LGSCrafting.LGSItemContainer { Name = name }; if (lic.FromXml(xi)) { CustomItems.Add(lic); } break; case ItemDataSource.SlaveLord: SlaveLordCrafting.SlaveLordItemContainer slic = new SlaveLordCrafting.SlaveLordItemContainer { Name = name }; if (slic.FromXml(xi)) { CustomItems.Add(slic); } break; case ItemDataSource.Custom: CustomItemContainer cic = new CustomItemContainer { Name = name, Source = source }; if (cic.FromXml(xi)) { CustomItems.Add(cic); } break; } } return(true); } catch { return(false); } }
public void SetItem(LGSCrafting.LGSItemContainer item) { LGSItem = null; lvSlots.Items.Clear(); tvBreakdown.Items.Clear(); lvCrafting.Items.Clear(); if (item == null) { return; } LGSItem = item; for (int i = 0; i < LGSCrafting.Tiers; i++) { LGSItemPropertyData data = new LGSItemPropertyData(item, i); data.PropertyChanged += Data_PropertyChanged; lvSlots.Items.Add(data); } // we call this to regenerate the DDOItemData potentially being used LGSItem.GetItem(); CalculateCraftingCosts(); }