/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="args"></param> private void CostumeUpdated(object sender, ListChangedEventArgs args) { // game and watch costume adjustments switch (args.ListChangedType) { case ListChangedType.ItemDeleted: if (MEX.Fighters.IndexOf(_fighter) == GAWIndex) { _removedGawCostume = MEX.GaWColors[args.NewIndex]; MEX.GaWColors.RemoveAt(args.NewIndex); } if (MEX.Fighters.IndexOf(_fighter) == KirbyIndex) { foreach (var v in MEX.Fighters) { if (v.KirbyCostumes != null && v.KirbyCostumes.Count > 0) { v.KirbyCostumes.RemoveAt(args.NewIndex); } } } break; case ListChangedType.ItemAdded: if (MEX.Fighters.IndexOf(_fighter) == GAWIndex) { MEX.GaWColors.Insert(args.NewIndex, _removedGawCostume == null ? new HSDRaw.MEX.Misc.MEX_GawColor() { FillColor = Color.Black, OutlineColor = Color.FromArgb(128, 255, 255, 255) } : _removedGawCostume); _removedGawCostume = null; _costumes[args.NewIndex].Costume.FileName = "PlGwNr.dat"; _costumes[args.NewIndex].Costume.JointSymbol = "PlyGamewatch5K_Share_joint"; } if (MEX.Fighters.IndexOf(_fighter) == KirbyIndex) { foreach (var v in MEX.Fighters) { if (v.KirbyCostumes != null && v.KirbyCostumes.Count > 0) { v.KirbyCostumes.Insert(args.NewIndex, GenerateCostume()); } } } break; } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void moveDown_Click(object sender, EventArgs e) { if (MEX.Fighters.IndexOf(_fighter) == KirbyIndex) { return; } var index = mxListBox1.SelectedIndex; if (_costumes.MoveDown(index)) { mxListBox1.SelectedIndex = index + 1; } _removedGawCostume = null; }