예제 #1
0
        protected override bool OnLoad(Progress progress)
        {
            try
            {
                myBBB.Open(FileName, progress);
            }
            catch (Exception ex)
            {
                FormMain.Instance.ErrorMessage(ex.Message);
            }

            return(true);
        }
예제 #2
0
        private bool Fix()
        {
            string pathLevels = Settings.LevelsDirectory;

            try
            {
                string tasks = "";

                if (!CheckTngLev())
                {
                    // Need to extract this stuff.

                    BBBFile wad = new BBBFile();

                    wad.Open(pathLevels + "FinalAlbion.wad", null);

                    BBBExtractor bbb = new BBBExtractor(wad, Settings.FableDirectory);

                    FormProcess form = new FormProcess(bbb);

                    form.Text = "Extracting...";

                    form.ShowDialog();

                    form.Dispose();

                    wad.Close();

                    tasks += "\tExtracted FinalAlbion.WAD.\r\n";
                }

                if (File.Exists(pathLevels + "FinalAlbion.wad"))
                {
                    // Make sure this doesn't exist.
                    File.Delete(pathLevels + "_FinalAlbion.wad");

                    File.Move(
                        pathLevels + "FinalAlbion.wad",
                        pathLevels + "_FinalAlbion.wad");

                    tasks += "\tRenamed FinalAlbion.WAD.\r\n";
                }

                if (!CheckUserStIni())
                {
                    if (FixUserStIni())
                    {
                        tasks += "\tPatched userst.ini.\r\n";
                    }
                    else
                    {
                        throw new Exception("Failed to update userst.ini.");
                    }
                }

                InfoMessage(
                    "Modding environment successfully updated!\r\n" +
                    "Following tasks were completed:\r\n" +
                    tasks);

                return(true);
            }
            catch (Exception ex)
            {
                ErrorMessage(ex.ToString());
            }

            return(false);
        }