コード例 #1
0
        private bool InitializeOnLoad()
        {
            Mainform.PauseOnFrame = null;
            Mainform.PauseEmulator();

            // Start Scenario 0: snes9x needs a nag (copied from RecordMovieMenuItem_Click())
            if (Emulator is Snes9x)
            {
                var box = new CustomControls.MsgBox(
                    "While the Snes9x core is faster, it is not nearly as accurate as bsnes. \nIt is recommended that you switch to the bsnes core for movie recording\nSwitch to bsnes?",
                    "Accuracy Warning",
                    MessageBoxIcon.Warning);

                box.SetButtons(
                    new[] { "Switch", "Continue" },
                    new[] { DialogResult.Yes, DialogResult.Cancel });

                box.MaximumSize = new Size(475, 350);
                box.SetMessageToAutoSize();
                var result = box.ShowDialog();

                if (result == DialogResult.Yes)
                {
                    Global.Config.SNES_InSnes9x = false;
                    Mainform.RebootCore();
                }
                else if (result == DialogResult.Cancel)
                {
                    //return false;
                }
            }
            else if (Emulator is QuickNES)             // Copy pasta of unsustainable logic, even better
            {
                var box = new CustomControls.MsgBox(
                    "While the QuickNes core is faster, it is not nearly as accurate as NesHawk. \nIt is recommended that you switch to the NesHawk core for movie recording\nSwitch to NesHawk?",
                    "Accuracy Warning",
                    MessageBoxIcon.Warning);

                box.SetButtons(
                    new[] { "Switch", "Continue" },
                    new[] { DialogResult.Yes, DialogResult.Cancel });

                box.MaximumSize = new Size(475, 350);
                box.SetMessageToAutoSize();
                var result = box.ShowDialog();

                if (result == DialogResult.Yes)
                {
                    Global.Config.NES_InQuickNES = false;
                    Mainform.RebootCore();
                }
                else if (result == DialogResult.Cancel)
                {
                    //return false;
                }
            }

            // Start Scenario 1: A regular movie is active
            if (Global.MovieSession.Movie.IsActive && !(Global.MovieSession.Movie is TasMovie))
            {
                var result = MessageBox.Show("In order to use Tastudio, a new project must be created from the current movie\nThe current movie will be saved and closed, and a new project file will be created\nProceed?", "Convert movie", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
                if (result == DialogResult.OK)
                {
                    ConvertCurrentMovieToTasproj();
                    StartNewMovieWrapper(false);
                    SetUpColumns();
                }
                else
                {
                    return(false);
                }
            }

            // Start Scenario 2: A tasproj is already active
            else if (Global.MovieSession.Movie.IsActive && Global.MovieSession.Movie is TasMovie)
            {
                bool result = LoadFile(new FileInfo(CurrentTasMovie.Filename), gotoFrame: Emulator.Frame);
                if (!result)
                {
                    TasView.AllColumns.Clear();
                    StartNewTasMovie();
                }
            }

            // Start Scenario 3: No movie, but user wants to autoload their last project
            else if (Settings.RecentTas.AutoLoad && !string.IsNullOrEmpty(Settings.RecentTas.MostRecent))
            {
                bool result = LoadFile(new FileInfo(Settings.RecentTas.MostRecent));
                if (!result)
                {
                    TasView.AllColumns.Clear();
                    StartNewTasMovie();
                }
            }

            // Start Scenario 4: No movie, default behavior of engaging tastudio with a new default project
            else
            {
                StartNewTasMovie();
            }

            if (Global.Emulator is NullEmulator)
            {
                DisengageTastudio();
                return(false);
            }

            EngageTastudio();
            return(true);
        }
コード例 #2
0
ファイル: TAStudio.cs プロジェクト: Sprangdeg/BizHawk
        private bool InitializeOnLoad()
        {
            Mainform.PauseOnFrame = null;
            Mainform.PauseEmulator();

            // Start Scenario 0: bsnes in performance mode (copied from RecordMovieMenuItem_Click())
            if (Emulator is BizHawk.Emulation.Cores.Nintendo.SNES.LibsnesCore)
            {
                var snes = (BizHawk.Emulation.Cores.Nintendo.SNES.LibsnesCore)Emulator;
                if (snes.CurrentProfile == "Performance")
                {
                    var box = new CustomControls.MsgBox(
                        "While the performance core is faster, it is not stable enough for movie recording\n\nSwitch to Compatibility?",
                        "Stability Warning",
                        MessageBoxIcon.Warning);

                    box.SetButtons(
                        new[] { "Switch", "Cancel" },
                        new[] { DialogResult.Yes, DialogResult.Cancel });

                    box.MaximumSize = new Size(450, 350);
                    box.SetMessageToAutoSize();
                    var result = box.ShowDialog();

                    if (result == DialogResult.Yes)
                    {
                        var ss = snes.GetSyncSettings();
                        ss.Profile = "Compatibility";
                        snes.PutSyncSettings(ss);
                        Mainform.RebootCore();
                    }
                    else if (result == DialogResult.Cancel)
                    {
                        return(false);
                    }
                }
            }

            // Start Scenario 1: A regular movie is active
            if (Global.MovieSession.Movie.IsActive && !(Global.MovieSession.Movie is TasMovie))
            {
                var result = MessageBox.Show("In order to use Tastudio, a new project must be created from the current movie\nThe current movie will be saved and closed, and a new project file will be created\nProceed?", "Convert movie", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
                if (result == DialogResult.OK)
                {
                    ConvertCurrentMovieToTasproj();
                    StartNewMovieWrapper(false);
                    SetUpColumns();
                }
                else
                {
                    return(false);
                }
            }

            // Start Scenario 2: A tasproj is already active
            else if (Global.MovieSession.Movie.IsActive && Global.MovieSession.Movie is TasMovie)
            {
                bool result = LoadFile(new FileInfo(CurrentTasMovie.Filename), gotoFrame: Emulator.Frame);
                if (!result)
                {
                    TasView.AllColumns.Clear();
                    StartNewTasMovie();
                }
            }

            // Start Scenario 3: No movie, but user wants to autload their last project
            else if (Settings.RecentTas.AutoLoad && !string.IsNullOrEmpty(Settings.RecentTas.MostRecent))
            {
                bool result = LoadFile(new FileInfo(Settings.RecentTas.MostRecent));
                if (!result)
                {
                    TasView.AllColumns.Clear();
                    StartNewTasMovie();
                }
            }

            // Start Scenario 4: No movie, default behavior of engaging tastudio with a new default project
            else
            {
                StartNewTasMovie();
            }

            EngageTastudio();
            return(true);
        }