private void ClothesListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (e.AddedItems.Count <= 0) { return; } _selectedCloth = (ClothData)e.AddedItems[0]; if (_selectedCloth == null) { return; } clothEditWindow.Visibility = Visibility.Collapsed; pedPropEditWindow.Visibility = Visibility.Collapsed; editGroupBox.Visibility = Visibility.Visible; if (_selectedCloth.IsComponent()) { clothEditWindow.Visibility = Visibility.Visible; drawableName.Text = _selectedCloth.Name; texturesList.ItemsSource = _selectedCloth.Textures; firstPersonModelPath.Text = _selectedCloth.FirstPersonModelPath != "" ? _selectedCloth.FirstPersonModelPath : "Not selected..."; unkFlag1Check.IsChecked = _selectedCloth.PedComponentFlags.unkFlag1; unkFlag2Check.IsChecked = _selectedCloth.PedComponentFlags.unkFlag2; unkFlag3Check.IsChecked = _selectedCloth.PedComponentFlags.unkFlag3; unkFlag4Check.IsChecked = _selectedCloth.PedComponentFlags.unkFlag4; isHighHeelsCheck.IsChecked = _selectedCloth.PedComponentFlags.isHighHeels; } else { pedPropEditWindow.Visibility = Visibility.Visible; drawableName.Text = _selectedCloth.Name; pedPropName.Text = _selectedCloth.Name; pedPropTexturesList.ItemsSource = _selectedCloth.Textures; pedPropFlag1.IsChecked = _selectedCloth.PedPropFlags.unkFlag1; pedPropFlag2.IsChecked = _selectedCloth.PedPropFlags.unkFlag2; pedPropFlag3.IsChecked = _selectedCloth.PedPropFlags.unkFlag3; pedPropFlag4.IsChecked = _selectedCloth.PedPropFlags.unkFlag4; pedPropFlag5.IsChecked = _selectedCloth.PedPropFlags.unkFlag5; } }
private void ClothesListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (e.AddedItems.Count > 0) { hasChanged = true; selectedCloth = (ClothData)e.AddedItems[0]; if (selectedCloth != null) { clothEditWindow.Visibility = Visibility.Collapsed; pedPropEditWindow.Visibility = Visibility.Collapsed; if (selectedCloth.IsComponent()) { clothEditWindow.Visibility = Visibility.Visible; drawableName.Text = selectedCloth.Name; texturesList.ItemsSource = selectedCloth.textures; fpModelPath.Text = selectedCloth.fpModelPath != "" ? selectedCloth.fpModelPath : "Not selected..."; unkFlag1Check.IsChecked = selectedCloth.componentFlags.unkFlag1; unkFlag2Check.IsChecked = selectedCloth.componentFlags.unkFlag2; unkFlag3Check.IsChecked = selectedCloth.componentFlags.unkFlag3; unkFlag4Check.IsChecked = selectedCloth.componentFlags.unkFlag4; isHighHeelsCheck.IsChecked = selectedCloth.componentFlags.isHighHeels; } else { pedPropEditWindow.Visibility = Visibility.Visible; drawableName.Text = selectedCloth.Name; pedPropName.Text = selectedCloth.Name; pedPropTexturesList.ItemsSource = selectedCloth.textures; pedPropFlag1.IsChecked = selectedCloth.pedPropFlags.unkFlag1; pedPropFlag2.IsChecked = selectedCloth.pedPropFlags.unkFlag2; pedPropFlag3.IsChecked = selectedCloth.pedPropFlags.unkFlag3; pedPropFlag4.IsChecked = selectedCloth.pedPropFlags.unkFlag4; pedPropFlag5.IsChecked = selectedCloth.pedPropFlags.unkFlag5; } } } }