// Instantiate Trainer Select Window if a trainer object is needed public SelectTrainerTCWin(object tI) { ti = (TrainerInit)tI; InitializeComponent(); showAvailableTrainers(); }
// Handles a trainer being clicked. private void button_Click(object sender, RoutedEventArgs e) { int t; bool confirmed = false; Button button = sender as Button; TrainerInit a = new TrainerInit(); trainer tr = new trainer(); string numString = button.Name.ToString(); numString = numString.Remove(0, 3); t = Convert.ToInt32(numString); var result = MessageBox.Show("Add " + pTrainers[t].name + " to current trainer party?", "Warning", MessageBoxButton.YesNo); if (result == MessageBoxResult.Yes) { //pTrainers[t].active = true; //tr.Save(pTrainers[t], false, false); //aTrainers.Add(pTrainers[t]); //pTrainers.RemoveAt(t); confirmed = true; // Send new trainer info back to trainer class TrainerInit.recieveTrainerData(aTrainers, pTrainers); Close(); //trainerAdded(confirmed); } }
//private void Add1_Click(object sender, RoutedEventArgs e) //{ // TrainerInit ti = new TrainerInit(); // ti.loadPassiveTrainers(); // rowCounter = 3; // addRow(); // SelectTrainerTCWin selTra = new SelectTrainerTCWin(ti); // selTra.Show(); //} private void button_Click(object sender, RoutedEventArgs e) { TrainerInit ti = new TrainerInit(); ti.loadPassiveTrainers(); SelectTrainerTCWin selTra = new SelectTrainerTCWin(ti); selTra.Show(); }