/// <summary> /// (re)loads settings /// </summary> public void LoadSettings(bool constructor) { _currentSpec = null; BlacklistedInventoryItems.Clear(); NextPulse = DateTime.Now + TimeSpan.FromSeconds(1); // try { base.LoadFromXML(XElement.Load(GetSettingsPath(SettingsType.Settings, UsePVP))); } catch (Exception) { } var _path = GetSettingsPath(SettingsType.Weights, UsePVP); EquipMe.Log("Loading weights from: {0}", _path); var newset = EquipMe.LoadWeightSetFromXML(_path); if (newset != null) { WeightSet_Current = newset; } else { SaveSettings(); } }
private void button3_Click(object sender, EventArgs e) { try { var ofd = new OpenFileDialog(); ofd.InitialDirectory = Logging.ApplicationPath; if (ofd.ShowDialog() == DialogResult.OK) { EquipMe.Log("Loading new weightset data from: {0}", ofd.FileName); var loadedset = EquipMe.LoadWeightSetFromXML(ofd.FileName); if (loadedset == null) { return; } EquipMeSettings.Instance.WeightSet_Current = loadedset; } } catch (Exception ex) { EquipMe.Log("Error loading weighset, exception\n{0}", ex); } }