public void newBodyPart(string name, bool skin, bool bone, bool crucial, List<bool> affects, float damageMod, float bleedMod, bool isLeg, bool isArm, bool isHand, BodyPart parent) { this.name = name; this.skin = skin; this.bone = bone; this.crucial = crucial; this.affects = affects; this.damageMod = damageMod; this.bleedMod = bleedMod; this.isLeg = isLeg; this.isArm = isArm; this.isHand = isHand; this.parent = parent; }
private void addChild(object sender, RoutedEventArgs e) { BodyPart childBodyPart = new BodyPart(); AddBodyPartWindow addChildWindow = new AddBodyPartWindow(); addChildWindow.parent = bodyPart; addChildWindow.ShowDialog(); if (addChildWindow.createdPart == true) { MainWindow.bodyParts.Add(addChildWindow.bodyPart); BodyPartItem bodyPartItem = new BodyPartItem(MainWindow.bodyParts.Last().name, addChildWindow.bodyPart); MainWindow.bodyPartItems.Add(bodyPartItem); Core.mainWindow.addToStackPanel(bodyPartItem); } }
public BodyPartItem(string name, BodyPart bodyPart) { this.bodyPart = bodyPart; panel.Orientation = Orientation.Horizontal; //bodyItem.Content = panel; bodyPart.name = name; editButton.Content = bodyPart.name; editButton.Click += new RoutedEventHandler(editBodyPart); addChildButton.Content = "+ Add Child"; addChildButton.Click += new RoutedEventHandler(addChild); panel.Children.Add(editButton); panel.Children.Add(addChildButton); }
public void edit(BodyPart bodyPart) { //MessageBox.Show("Edit bodypart"); this.bodyPart = bodyPart; TxtBox_Name.Text = this.bodyPart.name; ChkBox_Skin.IsChecked = bodyPart.skin; ChkBox_Bone.IsChecked = bodyPart.bone; ChkBox_Crucial.IsChecked = bodyPart.crucial; TxtBox_DmgMod.Text = Convert.ToString(bodyPart.damageMod); TxtBox_BleedMod.Text = Convert.ToString(bodyPart.bleedMod); ChkBox_AfSight.IsChecked = bodyPart.affects[0]; ChkBox_AfSmell.IsChecked = bodyPart.affects[1]; ChkBox_AfHearing.IsChecked = bodyPart.affects[2]; ChkBox_IsLeg.IsChecked = bodyPart.isLeg; ChkBox_IsArm.IsChecked = bodyPart.isArm; ChkBox_IsHand.IsChecked = bodyPart.isHand; }
public AddBodyPartWindow(BodyPart parent = null) { InitializeComponent(); this.parent = parent; }