private void LockerTree_SelectionChanged(object sender, EventArgs e) { PartsLocker.Items.Clear(); if (LockerTree.SelectedNode == null || LockerTree.SelectedNode.Children.Count > 0) { return; } InventoryEntry entry = LockerTree.SelectedNode.GetEntry(); if (LockerTree.SelectedNode.Children.Count == 0) { // Tree nodes with no children are items or weapons. Entries with children would be section headers. string SelectedItem = LockerTree.SelectedNode.Data().Text; LockerPartsGroup.Text = entry.Name; RatingLocker.Text = entry.Rating; DescriptionLocker.Text = entry.Description.Replace("$LINE$", "\r\n"); int partcount = entry.GetPartCount(); for (int Progress = 0; Progress < partcount; Progress++) { PartsLocker.Items.Add(entry.Parts[Progress]); } WTSlideSelector.MinMaxAdvanced(entry.UsesBigLevel, ref LevelIndexLocker); Util.SetNumericUpDown(RemAmmoLocker, entry.Quantity); QualityLocker.Value = entry.QualityIndex; LevelIndexLocker.Value = entry.LevelIndex; } }
private void GearTree_SelectionChanged(object sender, EventArgs e) { int OldPartIndex = PartsGear.SelectedIndex; PartsGear.Items.Clear(); // If the node has children it not an item. It is a category label. if (GearTree.SelectedNode == null || GearTree.SelectedNode.Children.Count > 0) { GearPartsGroup.Text = "No " + gearTextName + " Selected"; return; } InventoryEntry gear = GearTree.SelectedNode.GetEntry(); GearPartsGroup.Text = gear.Name; Init(); for (int i = 0; i < gear.Parts.Count; i++) { PartsGear.Items.Add(gear.Parts[i]); } WTSlideSelector.MinMaxAdvanced(gear.UsesBigLevel, ref LevelIndexGear); Util.SetNumericUpDown(QuantityGear, gear.Quantity); QualityGear.Value = gear.QualityIndex; EquippedSlotGear.SelectedIndex = gear.EquippedSlot; LevelIndexGear.Value = gear.LevelIndex; JunkGear.Value = gear.IsJunk; LockedGear.Value = gear.IsLocked; if (PartsGear.Items.Count > OldPartIndex) { PartsGear.SelectedIndex = OldPartIndex; } GearInformationUpdate(); }