Exemplo n.º 1
0
        /// <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();
            }
        }
Exemplo n.º 2
0
            public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
            {
                ArrayList properties = new ArrayList();

                foreach (KeyValuePair <TKey, TValue> e in _dictionary)
                {
                    if (!_show0 && EquipMe.ToFloat(_dictionary[e.Key].ToString()) == 0)
                    {
                        continue;
                    }
                    properties.Add(new DictionaryPropertyDescriptor <TKey, TValue>(_dictionary, e.Key));
                }

                PropertyDescriptor[] props =
                    (PropertyDescriptor[])properties.ToArray(typeof(PropertyDescriptor));

                return(new PropertyDescriptorCollection(props));
            }
Exemplo n.º 3
0
 private void button4_Click(object sender, EventArgs e)
 {
     foreach (var item in StyxWoW.Me.Inventory.Equipped.Items)
     {
         if (item == null)
         {
             continue;
         }
         EquipMe.Log("Equipped: {0}, score: {1}, inv type: {2}, wep class: {3}", item.Name, EquipMe.CalcScore(item), item.ItemInfo.InventoryType, item.ItemInfo.WeaponClass);
     }
     foreach (var item in StyxWoW.Me.BagItems)
     {
         if (item == null)
         {
             continue;
         }
         EquipMe.Log("Bag: {0}, score: {1}, inv type: {2}, wep class: {3}", item.Name, EquipMe.CalcScore(item), item.ItemInfo.InventoryType, item.ItemInfo.WeaponClass);
     }
 }
Exemplo n.º 4
0
 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);
     }
 }
Exemplo n.º 5
0
 /// <summary>
 /// Returns a settings path updated with current deets
 /// </summary>
 /// <param name="weights">if it's a weights file or otherwise just a settings file</param>
 /// <returns>path to settings</returns>
 public static string GetSettingsPath(SettingsType type, bool pvp)
 {
     return(Logging.ApplicationPath + "\\Settings\\EquipMe\\EquipMe_" + StyxWoW.Me.Name + "_" + EquipMe.GetSpecName() + (pvp && Styx.Logic.Battlegrounds.IsInsideBattleground ? "_PVP" : "") + "_" + type.ToString() + ".xml");
 }
Exemplo n.º 6
0
 private void button2_Click(object sender, EventArgs e)
 {
     EquipMe.Log("Reloading settings from file");
     EquipMeSettings.Instance.LoadSettings();
     UpdatePropertyGrids();
 }
Exemplo n.º 7
0
 private void button1_Click(object sender, EventArgs e)
 {
     EquipMe.Log("Updating weights from wowhead");
     EquipMe.UpdateWowhead();
     UpdatePropertyGrids();
 }