private void ClearFramesMenuItem_Click(object sender, EventArgs e)
        {
            if (TasView.AnyRowsSelected)
            {
                bool wasPaused       = GlobalWin.MainForm.EmulatorPaused;
                bool needsToRollback = !(TasView.FirstSelectedIndex > Emulator.Frame);
                int  rollBackFrame   = TasView.FirstSelectedIndex.Value;

                CurrentTasMovie.ChangeLog.BeginNewBatch("Clear frames " + TasView.SelectedRows.Min() + "-" + TasView.SelectedRows.Max());
                foreach (int frame in TasView.SelectedRows)
                {
                    CurrentTasMovie.ClearFrame(frame);
                }
                CurrentTasMovie.ChangeLog.EndBatch();

                if (needsToRollback)
                {
                    GoToLastEmulatedFrameIfNecessary(rollBackFrame);
                    if (wasPaused)
                    {
                        DoAutoRestore();
                    }
                    else
                    {
                        GlobalWin.MainForm.UnpauseEmulator();
                    }
                }
                else
                {
                    RefreshDialog();
                }
            }
        }
        private void ClearMenuItem_Click(object sender, EventArgs e)
        {
            if (TasView.SelectedRows.Any())
            {
                var wasPaused       = GlobalWin.MainForm.EmulatorPaused;
                var needsToRollback = !(TasView.FirstSelectedIndex > Emulator.Frame);
                var rollBackFrame   = TasView.FirstSelectedIndex.Value;

                foreach (var frame in TasView.SelectedRows)
                {
                    CurrentTasMovie.ClearFrame(frame);
                }

                if (needsToRollback)
                {
                    GoToLastEmulatedFrameIfNecessary(rollBackFrame);
                    if (wasPaused)
                    {
                        DoAutoRestore();
                    }
                    else
                    {
                        GlobalWin.MainForm.UnpauseEmulator();
                    }
                }
                else
                {
                    RefreshDialog();
                }
            }
        }
Beispiel #3
0
        public void ClearFrames(int beginningFrame, int numberOfFrames)
        {
            if (beginningFrame < CurrentTasMovie.InputLogLength)
            {
                bool needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame;
                int  last            = Math.Min(beginningFrame + numberOfFrames, CurrentTasMovie.InputLogLength);
                for (int i = beginningFrame; i < last; i++)
                {
                    CurrentTasMovie.ClearFrame(i);
                }

                if (needsToRollback)
                {
                    GoToLastEmulatedFrameIfNecessary(beginningFrame);
                    DoAutoRestore();
                }
                else
                {
                    RefreshDialog();
                }
            }
        }