Пример #1
0
        private void UpdateCharacters()
        {
            string        account    = (string)c_lbAccounts.SelectedItem;
            string        realmPaths = Settings.GetWowDirectory(WowVersionEnum.Vanilla) + "WTF\\Account\\" + account;
            var           realms     = Utility.GetDirectoriesInDirectory(realmPaths);
            List <string> characters = new List <string>();

            foreach (var realm in realms)
            {
                string realmName = "";
                StaticValues.RealmNameConverter.TryGetValue(realm, out realmName);
                if ((string)c_ddlRealm.SelectedItem == realmName) //realm != "SavedVariables" &&
                {
                    var realmCharacters = Utility.GetDirectoriesInDirectory(realmPaths + "\\" + realm);
                    foreach (var character in realmCharacters)
                    {
                        characters.Add(character);
                        //characters.Add(realm + "/" + character);
                    }
                }
            }
            c_lbCharacters.Items.Clear();
            c_lbCharacters.Items.AddRange(characters.ToArray());
            if (c_lbCharacters.Items.Count > 0)
            {
                c_lbCharacters.SelectedIndex = 0;
            }
        }
Пример #2
0
        public static AddonsWTF LoadAllAccountAddons(WowVersionEnum _WowVersion)
        {
            var addonsWTF = new AddonsWTF();
            var accounts  = Utility.GetDirectoriesInDirectory(Settings.GetWowDirectory(_WowVersion) + "WTF\\Account");

            foreach (var account in accounts)
            {
                addonsWTF.m_AccountAddons.Add(new AccountAddons(account, _WowVersion));
            }
            return(addonsWTF);
        }
Пример #3
0
        public AccountAddons(string _Account, WowVersionEnum _WowVersion)
        {
            m_Account    = _Account;
            m_WowVersion = _WowVersion;
            var realms = Utility.GetDirectoriesInDirectory(AccountFolder);

            foreach (var realm in realms)
            {
                m_RealmAddons.Add(new RealmAddons(this, realm));
            }
        }
Пример #4
0
        public RealmAddons(AccountAddons _Account, string _Realm)
        {
            m_Account = _Account;
            m_Realm   = _Realm;

            var realmCharacters = Utility.GetDirectoriesInDirectory(RealmFolder);

            foreach (var realmCharacter in realmCharacters)
            {
                m_CharacterAddons.Add(new CharacterAddons(this, realmCharacter));
            }
        }
Пример #5
0
        internal static List <string> GetInstalledAddons(WowVersionEnum _WowVersion)
        {
            var addons = Utility.GetDirectoriesInDirectory(Settings.GetWowDirectory(_WowVersion) + "Interface\\AddOns\\");

            for (int i = 0; i < addons.Count; ++i)
            {
                string addonDirectory = Settings.GetWowDirectory(_WowVersion) + "Interface\\AddOns\\" + addons[i] + "\\";
                if (System.IO.File.Exists(addonDirectory + addons[i] + ".toc") == false)
                {
                    addons.RemoveAt(i);
                    --i;
                }
                //if (addons[i].StartsWith("Blizzard_"))
                //{
                //    addons.RemoveAt(i);
                //    --i;
                //}
            }
            return(addons);
        }
Пример #6
0
        private void UpdateAccounts()
        {
            var accounts = Utility.GetDirectoriesInDirectory(Settings.GetWowDirectory(WowVersionEnum.Vanilla) + "WTF\\Account");

            for (int i = 0; i < accounts.Count; ++i)
            {
                string realmPaths = Settings.GetWowDirectory(WowVersionEnum.Vanilla) + "WTF\\Account\\" + accounts[i];
                var    realms     = Utility.GetDirectoriesInDirectory(realmPaths);
                if (realms.Contains(StaticValues.RealmNameConverter.First((_Value) => _Value.Value == (string)c_ddlRealm.SelectedItem).Key) == false)
                {
                    accounts.Remove(accounts[i]);
                    --i;
                }
            }
            c_lbAccounts.Items.Clear();
            c_lbAccounts.Items.AddRange(accounts.ToArray());
            if (c_lbAccounts.Items.Count > 0)
            {
                c_lbAccounts.SelectedIndex = 0;
            }
        }
Пример #7
0
 public static List <string> GetCharacters(string _Account, string _Realm, WowVersionEnum _WowVersion)
 {
     return(Utility.GetDirectoriesInDirectory(Settings.GetWowDirectory(_WowVersion) + "WTF\\Account\\" + _Account + "\\" + _Realm + "\\"));
 }
Пример #8
0
 public static List <string> GetAccounts(WowVersionEnum _WowVersion)
 {
     return(Utility.GetDirectoriesInDirectory(Settings.GetWowDirectory(_WowVersion) + "WTF\\Account\\"));
 }