/// <summary> /// Fill toneCombo with autotone values or BaseOnly. /// Get tones, fill combo, select tones. /// </summary> /// <param name="arr"></param> private void SetupTones(Arrangement arr) { disableTonesCheckbox.Checked = false; bool isRS2014 = parentControl.CurrentGameVersion != GameVersion.RS2012; if (!String.IsNullOrEmpty(arr.ToneBase)) { if (parentControl.tonesLB.Items.Count == 1 && parentControl.tonesLB.Items[0].ToString() == "Default") { parentControl.tonesLB.Items.Clear(); } } var toneItems = parentControl.tonesLB.Items; var toneNames = new List <string>(); if (isRS2014) { toneNames.AddRange(parentControl.tonesLB.Items.OfType <Tone2014>().Select(t => t.Name)); } else { toneNames.AddRange(parentControl.tonesLB.Items.OfType <Tone>().Select(t => t.Name)); } //Check if autotone tones are present and add it's if not. if (!toneNames.Contains(arr.ToneBase) && !String.IsNullOrEmpty(arr.ToneBase)) { toneItems.Add(parentControl.CreateNewTone(arr.ToneBase)); toneNames.Add(arr.ToneBase); } if (!toneNames.Contains(arr.ToneA) && !String.IsNullOrEmpty(arr.ToneA)) { toneItems.Add(parentControl.CreateNewTone(arr.ToneA)); toneNames.Add(arr.ToneA); } if (!toneNames.Contains(arr.ToneB) && !String.IsNullOrEmpty(arr.ToneB)) { toneItems.Add(parentControl.CreateNewTone(arr.ToneB)); toneNames.Add(arr.ToneB); } if (!toneNames.Contains(arr.ToneC) && !String.IsNullOrEmpty(arr.ToneC)) { toneItems.Add(parentControl.CreateNewTone(arr.ToneC)); toneNames.Add(arr.ToneC); } if (!toneNames.Contains(arr.ToneD) && !String.IsNullOrEmpty(arr.ToneD)) { toneItems.Add(parentControl.CreateNewTone(arr.ToneD)); toneNames.Add(arr.ToneD); } // FILL TONE COMBO FillToneCombo(toneBaseCombo, toneNames, true); FillToneCombo(toneACombo, toneNames, false); FillToneCombo(toneBCombo, toneNames, false); FillToneCombo(toneCCombo, toneNames, false); FillToneCombo(toneDCombo, toneNames, false); // SELECTING TONES toneBaseCombo.Enabled = true; if (!String.IsNullOrEmpty(arr.ToneBase)) { toneBaseCombo.SelectedItem = arr.ToneBase; } if (!String.IsNullOrEmpty(arr.ToneA)) { toneACombo.SelectedItem = arr.ToneA; } if (!String.IsNullOrEmpty(arr.ToneB)) { toneBCombo.SelectedItem = arr.ToneB; } if (!String.IsNullOrEmpty(arr.ToneC)) { toneCCombo.SelectedItem = arr.ToneC; } if (!String.IsNullOrEmpty(arr.ToneD)) { toneDCombo.SelectedItem = arr.ToneD; } // If have ToneBase and ToneB is setup it's because auto tone are setup in EoF, so, disable edit to prevent errors. disableTonesCheckbox.Checked = (!String.IsNullOrEmpty(arr.ToneBase) && !String.IsNullOrEmpty(arr.ToneB)); if (disableTonesCheckbox.Checked && !EditMode) { disableTonesCheckbox.Enabled = false; } }
/// <summary> /// Fill toneCombo with autotone values or BaseOnly. /// Get tones, fill combo, select tones. /// </summary> /// <param name="arr"></param> private void SetupTones(Arrangement arr) { disableTonesCheckbox.Checked = false; bool isRS2014 = parentControl.CurrentGameVersion != GameVersion.RS2012; if (!String.IsNullOrEmpty(arr.ToneBase)) { if (parentControl.tonesLB.Items.Count == 1 && parentControl.tonesLB.Items[0].ToString() == "Default") { parentControl.tonesLB.Items.Clear(); } } var toneItems = parentControl.tonesLB.Items; var toneNames = new List <string>(); if (isRS2014) { toneNames.AddRange(parentControl.tonesLB.Items.OfType <Tone2014>().Select(t => t.Name)); } else { toneNames.AddRange(parentControl.tonesLB.Items.OfType <Tone>().Select(t => t.Name)); } //Check if autotone tones are present and add it's if not. if (!toneNames.Contains(arr.ToneBase) && !String.IsNullOrEmpty(arr.ToneBase)) { toneItems.Add(parentControl.CreateNewTone(arr.ToneBase)); toneNames.Add(arr.ToneBase); } if (!toneNames.Contains(arr.ToneA) && !String.IsNullOrEmpty(arr.ToneA)) { toneItems.Add(parentControl.CreateNewTone(arr.ToneA)); toneNames.Add(arr.ToneA); } if (!toneNames.Contains(arr.ToneB) && !String.IsNullOrEmpty(arr.ToneB)) { toneItems.Add(parentControl.CreateNewTone(arr.ToneB)); toneNames.Add(arr.ToneB); } if (!toneNames.Contains(arr.ToneC) && !String.IsNullOrEmpty(arr.ToneC)) { toneItems.Add(parentControl.CreateNewTone(arr.ToneC)); toneNames.Add(arr.ToneC); } if (!toneNames.Contains(arr.ToneD) && !String.IsNullOrEmpty(arr.ToneD)) { toneItems.Add(parentControl.CreateNewTone(arr.ToneD)); toneNames.Add(arr.ToneD); } // FILL TONE COMBO FillToneCombo(toneBaseCombo, toneNames, true); FillToneCombo(toneACombo, toneNames, false); FillToneCombo(toneBCombo, toneNames, false); FillToneCombo(toneCCombo, toneNames, false); FillToneCombo(toneDCombo, toneNames, false); // SELECTING TONES toneBaseCombo.Enabled = true; if (!String.IsNullOrEmpty(arr.ToneBase)) { toneBaseCombo.SelectedItem = arr.ToneBase; } if (!String.IsNullOrEmpty(arr.ToneA)) { toneACombo.SelectedItem = arr.ToneA; } if (!String.IsNullOrEmpty(arr.ToneB)) { toneBCombo.SelectedItem = arr.ToneB; } if (!String.IsNullOrEmpty(arr.ToneC)) { toneCCombo.SelectedItem = arr.ToneC; } if (!String.IsNullOrEmpty(arr.ToneD)) { toneDCombo.SelectedItem = arr.ToneD; } // If have ToneBase and ToneB is setup it's because auto tone are setup in EoF, so, disable edit to prevent errors. disableTonesCheckbox.Checked = (!String.IsNullOrEmpty(arr.ToneBase) && !String.IsNullOrEmpty(arr.ToneB)); if (disableTonesCheckbox.Checked && !EditMode) { // disableTonesCheckbox.Enabled = false; tt.IsBalloon = true; tt.AutoPopDelay = 9000; // tt remains visible if the point is stationary tt.InitialDelay = 100; // time that passes before tt appears tt.ReshowDelay = 100; // time before next tt window appears tt.ShowAlways = true; // force tt display even if parent is not active tt.SetToolTip(disableTonesCheckbox, "For Toolkit Expert Use Only"); } }
/// <summary> /// Fill toneCombo with autotone values or BaseOnly. /// Get tones, fill combo, select tones. /// </summary> /// <param name="arr"></param> private void SetupTones(Arrangement arr) { chkTonesDisabled.Checked = false; bool isRS2014 = _parentControl.CurrentGameVersion != GameVersion.RS2012; if (!String.IsNullOrEmpty(arr.ToneBase)) if (_parentControl.lstTones.Items.Count == 1 && _parentControl.lstTones.Items[0].ToString() == "Default") _parentControl.lstTones.Items.Clear(); var toneItems = _parentControl.lstTones.Items; var toneNames = new List<string>(); if (isRS2014) toneNames.AddRange(_parentControl.lstTones.Items.OfType<Tone2014>().Select(t => t.Name)); else toneNames.AddRange(_parentControl.lstTones.Items.OfType<Tone>().Select(t => t.Name)); //Check if autotone tones are present and add it's if not. if (!toneNames.Contains(arr.ToneBase) && !String.IsNullOrEmpty(arr.ToneBase)) { toneItems.Add(_parentControl.CreateNewTone(arr.ToneBase)); toneNames.Add(arr.ToneBase); } if (!toneNames.Contains(arr.ToneA) && !String.IsNullOrEmpty(arr.ToneA)) { toneItems.Add(_parentControl.CreateNewTone(arr.ToneA)); toneNames.Add(arr.ToneA); } if (!toneNames.Contains(arr.ToneB) && !String.IsNullOrEmpty(arr.ToneB)) { toneItems.Add(_parentControl.CreateNewTone(arr.ToneB)); toneNames.Add(arr.ToneB); } if (!toneNames.Contains(arr.ToneC) && !String.IsNullOrEmpty(arr.ToneC)) { toneItems.Add(_parentControl.CreateNewTone(arr.ToneC)); toneNames.Add(arr.ToneC); } if (!toneNames.Contains(arr.ToneD) && !String.IsNullOrEmpty(arr.ToneD)) { toneItems.Add(_parentControl.CreateNewTone(arr.ToneD)); toneNames.Add(arr.ToneD); } // FILL TONE COMBO FillToneCombo(cmbToneBase, toneNames, true); FillToneCombo(cmbToneA, toneNames, false); FillToneCombo(cmbToneB, toneNames, false); FillToneCombo(cmbToneC, toneNames, false); FillToneCombo(cmbToneD, toneNames, false); // SELECTING TONES cmbToneBase.Enabled = true; if (!String.IsNullOrEmpty(arr.ToneBase)) cmbToneBase.SelectedItem = arr.ToneBase; if (!String.IsNullOrEmpty(arr.ToneA)) cmbToneA.SelectedItem = arr.ToneA; if (!String.IsNullOrEmpty(arr.ToneB)) cmbToneB.SelectedItem = arr.ToneB; if (!String.IsNullOrEmpty(arr.ToneC)) cmbToneC.SelectedItem = arr.ToneC; if (!String.IsNullOrEmpty(arr.ToneD)) cmbToneD.SelectedItem = arr.ToneD; // If have ToneBase and ToneB is setup it's because auto tone are setup in EoF, so, disable edit to prevent errors. chkTonesDisabled.Checked = (!String.IsNullOrEmpty(arr.ToneBase) && !String.IsNullOrEmpty(arr.ToneB)); if (chkTonesDisabled.Checked) // && !EditMode) { // disableTonesCheckbox.Enabled = false; _toolTip.IsBalloon = true; _toolTip.AutoPopDelay = 9000; // tt remains visible if the point is stationary _toolTip.InitialDelay = 100; // time that passes before tt appears _toolTip.ReshowDelay = 100; // time before next tt window appears _toolTip.ShowAlways = true; // force tt display even if parent is not active _toolTip.SetToolTip(chkTonesDisabled, "Expert Toolkit Users Only"); } }
/// <summary> /// Fill toneCombo with autotone values or BaseOnly. /// Get tones, fill combo, select tones. /// </summary> /// <param name="arr"></param> private void SetupTones(Arrangement arr) { var toneNames = new List <string>(); disableTonesCheckbox.Checked = false; if (!String.IsNullOrEmpty(arr.ToneBase)) { if (parentControl.TonesLB.Items.Count == 1 && parentControl.TonesLB.Items[0].ToString() == "Default") { parentControl.TonesLB.Items.Clear(); } } toneNames.AddRange(parentControl.TonesLB.Items.OfType <Tone2014>().Select(t => t.Name)); //Check if autotone tones are present and add if not. if (!toneNames.Contains(arr.ToneBase)) { if (!String.IsNullOrEmpty(arr.ToneBase)) { toneNames.Add(arr.ToneBase); } } if (!toneNames.Contains(arr.ToneA)) { if (!String.IsNullOrEmpty(arr.ToneA)) { toneNames.Add(arr.ToneA); } } if (!toneNames.Contains(arr.ToneB)) { if (!String.IsNullOrEmpty(arr.ToneB)) { toneNames.Add(arr.ToneB); } } if (!toneNames.Contains(arr.ToneC)) { if (!String.IsNullOrEmpty(arr.ToneC)) { toneNames.Add(arr.ToneC); } } if (!toneNames.Contains(arr.ToneD)) { if (!String.IsNullOrEmpty(arr.ToneD)) { toneNames.Add(arr.ToneD); } } // FILL TONE COMBO FillToneCombo(toneBaseCombo, toneNames, true); FillToneCombo(toneBCombo, toneNames, false); FillToneCombo(toneCCombo, toneNames, false); FillToneCombo(toneDCombo, toneNames, false); // SELECTING TONES toneBaseCombo.Enabled = true; if (!String.IsNullOrEmpty(arr.ToneBase)) { toneBaseCombo.SelectedItem = arr.ToneBase; if (!parentControl.TonesLB.Items.OfType <Tone2014>().Any(t => t.Name == arr.ToneBase)) { parentControl.TonesLB.Items.Add(parentControl.CreateNewTone(arr.ToneBase)); } } if (!String.IsNullOrEmpty(arr.ToneB)) { toneBCombo.SelectedItem = arr.ToneB; if (!parentControl.TonesLB.Items.OfType <Tone2014>().Any(t => t.Name == arr.ToneB)) { parentControl.TonesLB.Items.Add(parentControl.CreateNewTone(arr.ToneB)); } } if (!String.IsNullOrEmpty(arr.ToneC)) { toneCCombo.SelectedItem = arr.ToneC; if (!parentControl.TonesLB.Items.OfType <Tone2014>().Any(t => t.Name == arr.ToneC)) { parentControl.TonesLB.Items.Add(parentControl.CreateNewTone(arr.ToneC)); } } if (!String.IsNullOrEmpty(arr.ToneD)) { toneDCombo.SelectedItem = arr.ToneD; if (!parentControl.TonesLB.Items.OfType <Tone2014>().Any(t => t.Name == arr.ToneD)) { parentControl.TonesLB.Items.Add(parentControl.CreateNewTone(arr.ToneD)); } } // If have ToneBase and ToneB is setup it's because auto tone are setup in EoF, so, disable edit to prevent errors. disableTonesCheckbox.Checked = (!String.IsNullOrEmpty(arr.ToneBase) && !String.IsNullOrEmpty(arr.ToneB)); }