Пример #1
0
        private void UpdateRemoteVersionsField()
        {
            preventLocaleReload = true;
            if (Program.Settings.UseRemote)
            {
                ComboBox field = UI_RemoteVersion_Field;
                field.Enabled = true;
                field.Items.Clear();

                foreach (WoWVersion version in Constants.WOW_VERSIONS)
                {
                    field.Items.Add(version);
                    WoWVersion defaultVersion = Program.Settings.RemoteClientVersion;

                    if (defaultVersion != null && defaultVersion.Equals(version))
                    {
                        field.SelectedIndex = field.Items.IndexOf(version);
                    }
                }
            }
            else
            {
                UI_RemoteVersion_Field.Enabled = false;
            }
            preventLocaleReload = false;
        }
Пример #2
0
        public static string GetAddonsFolder(WoWVersion addonType)
        {
            var path       = Settings.Default.WoWRetailPath;
            var addonsPath = Path.Combine(path, addonType == WoWVersion.Retail ? _wowRetailPath : _wowClassicPath);

            return(addonsPath);
        }
Пример #3
0
 public Settings()
 {
     // Set default values.
     AutomaticUpdates            = true;
     UseRemote                   = false;
     ShowSourceSelector          = true;
     WoWDirectory                = null;
     RemoteHost                  = null;
     RemoteHostPath              = null;
     RemoteClientVersion         = new WoWVersion("wow", "Live (Retail)");
     SoundPlayerVolume           = 100;
     FileLocale                  = Locale.Default.ID;
     AllowMultipleSoundPlayers   = false;
     FirstTime                   = true;
     ModelViewerBackgroundColour = -3680008;
 }
Пример #4
0
        private void btnImport_Click(object sender, EventArgs e)
        {
            if (cbWoWVersion.SelectedItem == null)
            {
                ShowErrorMessage("WoW Version not selected");
                return;
            }

            // Check learning order
            int[] ls = null;
            if (tbLearningOrder.Text.Equals(""))
            {
                ls = new int[] { 1, 2, 3 }
            }
            ;
            else
            {
                string[] lorder = tbLearningOrder.Text.Split(',');
                int      ll     = lorder.Length;
                if (ll > 3)
                {
                    ShowErrorMessage("Invalid learning sequence '" + tbLearningOrder.Text +
                                     "'. Number of tabs exceed 3");
                    return;
                }

                // convert each tab to int
                ls = new int[ll];

                try
                {
                    for (int i = 0; i < ll; i++)
                    {
                        ls[i] = Convert.ToInt32(lorder[i]);
                    }
                } catch {
                    ShowErrorMessage("Invalid Tab Id parameter in learning sequence '" +
                                     tbLearningOrder.Text + "'");
                    return;
                }
            }

            // Finally process URL
            try
            {
                string url = tbTalentURL.Text;
                // Check for class id
                Match m = trex.Match(url);

                if (m.Success && (m.Groups.Count == 3))
                {
                    string s   = m.Groups[1].ToString();
                    byte   cid = Convert.ToByte(s);
                    string ts  = m.Groups[2].ToString();

                    // string response = ReadURL(url);

                    // Find class
                    WoWVersion cur_version = (WoWVersion)cbWoWVersion.SelectedItem;
                    CharClass  cc          = cur_version.Classes.FindClassByArmoryId(cid);

                    // Check if Class defined
                    if (cc == null)
                    {
                        ShowErrorMessage("Unable find class for Armory ID " + cid);
                        return;
                    }

                    // Check size of talents
                    int cc_total = cc.TotalTalentSum;
                    if (cc_total != ts.Length)
                    {
                        ShowErrorMessage("Length of talent's URL parameter " + ts.Length +
                                         " different from class parameter length " + cc_total +
                                         " configured in WoWData.xml");
                        return;
                    }


                    byte[] tabs_len = cc.Tabs;

                    // Convert talent list to byte array
                    byte[] tlist = new byte[cc_total];
                    for (int i = 0; i < cc_total; i++)
                    {
                        tlist[i] = Convert.ToByte(ts.Substring(i, 1));
                    }

                    byte num = cur_version.TalentConfig.StartLevel;

                    // Select class
                    cbClass.SelectedItem = cc;
                    cbClass.Enabled      = false;

                    // Clear CurTalents
                    if (CurTalents == null)
                    {
                        CurTalents = new Talents();
                    }
                    else
                    {
                        btnReset_Click(sender, e);
                    }

                    BindLevels();

                    for (int i = 0; i < ls.Length; i++)
                    {
                        int cur_tab_id = ls[i];
                        int offset     = 0;
                        for (int j = 0; j < cur_tab_id - 1; j++)
                        {
                            offset += tabs_len[j];
                        }

                        int cur_tab_len = tabs_len[cur_tab_id - 1];
                        for (int j = 0; j < cur_tab_len; j++)
                        {
                            byte ct = tlist[offset + j];
                            // Added current talent with all ranks
                            for (int k = 1; k <= ct; k++)
                            {
                                CurTalents.AddLevel(new Level(num, cur_tab_id, j + 1, k));
                                num++;
                                RefreshLevelList();
                            }
                        }
                    }
                }
                else
                {
                    ShowErrorMessage(string.Format(
                                         "Invalid URL. '{0}' excpected", trex.ToString()));
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Unable read URL: " + ex.Message);
            }
        }
Пример #5
0
        public void InitCore(CallBackEvent e)
        {
            // Can't run this more than once
            if (inited) return;

            // We need to be able to Log stuff
            //if (l == null) return;
            if (e == null) return;

            //Log = l;
            Event = e;

            Log.WriteLine(netLogic.Shared.LogType.Debug, "netLogic.dll Initializing...");

            // Initialize everything
            try
            {
                if (!File.Exists(Environment.CurrentDirectory + "/" + BoogieBotConfigFileName))
                    throw new FileNotFoundException("Configuration file not found.", BoogieBotConfigFileName);

                configFile = new IniReader(Environment.CurrentDirectory + "/netLogic.ini");

                // NOTE: Set any OS specific variables so things can be done differently later, ie. Windows or Linux, etc.
                OperatingSystem os = Environment.OSVersion;
                switch (os.Platform)
                {
                    case PlatformID.Win32Windows:
                        Log.WriteLine(netLogic.Shared.LogType.Debug, "> Operating System: Windows");
                        break;
                    case PlatformID.Win32NT:
                        Log.WriteLine(netLogic.Shared.LogType.Debug, "> Operating System: Windows NT");
                        break;
                    case PlatformID.Unix:
                        Log.WriteLine(netLogic.Shared.LogType.Debug, "> Operating System: Unix");
                        break;
                }
                Log.WriteLine(netLogic.Shared.LogType.Debug, "> OS Version: {0}.{1}  (Build: {2})  ({3})", os.Version.Major, os.Version.Minor, os.Version.Build, os.ServicePack);

                // Find WoW's Folder
                wowPath = getWowPath();
                Log.WriteLine(netLogic.Shared.LogType.Debug, "> WowPath: {0}", wowPath);

                // Find WoW's Version
                wowVersion = getWoWVersion();
                Log.WriteLine(netLogic.Shared.LogType.Debug, "> WoW Version: World of Warcraft {0}.{1}.{2}.{3} ({4}) Found!  Emulating this version.", wowVersion.major, wowVersion.minor, wowVersion.update, wowVersion.build, netInstance.WowTypeString);

                //objectMgr = new ObjectMgr();
                GameObject _objects = new GameObject("objMgr");
                _objects.AddComponent<ObjMgr>();
                objMgr = _objects.GetComponent<ObjMgr>();
                DontDestroyOnLoad(objMgr);

                //movementMgr = new MovementMgr(netLogicCore.ObjectMgr);
                //combatMgr = new CombatMgr(ObjectMgr,MovementMgr);
                //terrainMgr = new TerrainMgr();
            //
                UpdateFieldsLoader.LoadUpdateFields(wowVersion.build);

                //areaTable = new AreaTable();
                //mapTable = new MapTable();
            }
            catch (Exception ex)
            {
                // Bot Start up Failed. Log why, and rethrow the exception.
                Log.WriteLine(netLogic.Shared.LogType.Debug, ex.Message);
                Log.WriteLine(netLogic.Shared.LogType.Debug, ex.StackTrace);

                throw new Exception("BoogieBot.dll Init Failure.", ex);
            }

            inited = true;
            Log.WriteLine(netLogic.Shared.LogType.Debug, "BoogieBot.dll Initialized.");
        }
Пример #6
0
        public static List <DirectoryInfo> GetAddonsDirectories(WoWVersion addonType)
        {
            var info = new DirectoryInfo(GetAddonsFolder(addonType));

            return(info.GetDirectories().ToList());
        }
Пример #7
0
        public static bool IfAddonExist(string name, WoWVersion addonType)
        {
            var addonPath = Path.Combine(GetAddonsFolder(addonType), name);

            return(Directory.Exists(addonPath));
        }