コード例 #1
0
ファイル: MarkerControl.cs プロジェクト: lenalia/BizHawk
        public void AddMarker(bool editText = false, int?frame = null)
        {
            // feos: we specify the selected frame if we call this from TasView, otherwise marker should be added to the emulated frame
            var markerFrame = frame ?? Tastudio.Emulator.Frame;

            if (editText)
            {
                InputPrompt i = new InputPrompt
                {
                    Text          = "Marker for frame " + markerFrame,
                    TextInputType = InputPrompt.InputType.Text,
                    Message       = "Enter a message",
                    InitialValue  =
                        Markers.IsMarker(markerFrame) ?
                        Markers.PreviousOrCurrent(markerFrame).Message :
                        ""
                };

                var point = Cursor.Position;
                point.Offset(i.Width / -2, i.Height / -2);

                var result = i.ShowHawkDialog(position: point);
                if (result == DialogResult.OK)
                {
                    Markers.Add(new TasMovieMarker(markerFrame, i.PromptText));
                    UpdateValues();
                }
            }
            else
            {
                Markers.Add(new TasMovieMarker(markerFrame, ""));
                UpdateValues();
            }
            Tastudio.RefreshDialog();
        }
コード例 #2
0
        private void RemoveBranchToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (SelectedBranch != null)
            {
                int index = BranchView.SelectedRows.First();
                if (index == Movie.CurrentBranch)
                {
                    Movie.CurrentBranch = -1;
                }
                else if (index < Movie.CurrentBranch)
                {
                    Movie.CurrentBranch--;
                }

                Movie.RemoveBranch(SelectedBranch);
                BranchView.RowCount = Movie.BranchCount;

                if (index == Movie.BranchCount)
                {
                    BranchView.ClearSelectedRows();
                    BranchView.SelectRow(Movie.BranchCount - 1, true);
                }

                //BranchView.Refresh();
                Tastudio.RefreshDialog();
                GlobalWin.OSD.AddMessage("Removed branch " + index.ToString());
            }
        }
コード例 #3
0
        private void UndoBranchToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_branchUndo == BranchUndo.Load)
            {
                LoadBranch(_backupBranch);
                CallLoadedCallback(Tastudio.CurrentTasMovie.Branches.IndexOf(_backupBranch));
                GlobalWin.OSD.AddMessage("Branch Load canceled");
            }
            else if (_branchUndo == BranchUndo.Update)
            {
                Movie.UpdateBranch(Movie.GetBranch(_backupBranch.UniqueIdentifier), _backupBranch);
                CallSavedCallback(Tastudio.CurrentTasMovie.Branches.IndexOf(_backupBranch));
                GlobalWin.OSD.AddMessage("Branch Update canceled");
            }
            else if (_branchUndo == BranchUndo.Text)
            {
                Movie.GetBranch(_backupBranch.UniqueIdentifier).UserText = _backupBranch.UserText;
                GlobalWin.OSD.AddMessage("Branch Text Edit canceled");
            }
            else if (_branchUndo == BranchUndo.Remove)
            {
                Movie.AddBranch(_backupBranch);
                BranchView.RowCount = Movie.BranchCount;
                CallSavedCallback(Tastudio.CurrentTasMovie.Branches.IndexOf(_backupBranch));
                GlobalWin.OSD.AddMessage("Branch Removal canceled");
            }

            UndoBranchToolStripMenuItem.Enabled = UndoBranchButton.Enabled = false;
            BranchView.Refresh();
            Tastudio.RefreshDialog();
        }
コード例 #4
0
        private void RemoveBranchToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (SelectedBranch != null)
            {
                int index = BranchView.SelectedRows.First();
                if (index == Movie.CurrentBranch)
                {
                    Movie.CurrentBranch = -1;
                }
                else if (index < Movie.CurrentBranch)
                {
                    Movie.CurrentBranch--;
                }

                _backupBranch = SelectedBranch.Clone();
                UndoBranchToolStripMenuItem.Enabled = UndoBranchButton.Enabled = true;
                UndoBranchToolStripMenuItem.Text    = "Undo Branch Removal";
                toolTip1.SetToolTip(UndoBranchButton, "Undo Branch Removal");
                _branchUndo = BranchUndo.Remove;

                Movie.RemoveBranch(SelectedBranch);
                BranchView.RowCount = Movie.BranchCount;

                if (index == Movie.BranchCount)
                {
                    BranchView.ClearSelectedRows();
                    BranchView.SelectRow(Movie.BranchCount - 1, true);
                }

                CallRemovedCallback(index);
                Tastudio.RefreshDialog();
                GlobalWin.OSD.AddMessage("Removed branch " + index.ToString());
            }
        }
コード例 #5
0
 private void RemoveBtn_Click(object sender, EventArgs e)
 {
     SelectedMarkers.ForEach(i => Tastudio.CurrentTasMovie.Markers.Remove(i));
     MarkerInputRoll.DeselectAll();
     Tastudio.RefreshDialog();
     MarkerView_SelectedIndexChanged(sender, e);
 }
コード例 #6
0
ファイル: MarkerControl.cs プロジェクト: budzikt/BizHawk
 private void ScrollToMarkerToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (MarkerView.AnyRowsSelected)
     {
         Tastudio.SetVisibleIndex(SelectedMarkerFrame());
         Tastudio.RefreshDialog();
     }
 }
コード例 #7
0
        public void Branch()
        {
            TasBranch branch = CreateBranch();

            Movie.AddBranch(branch);
            BranchView.RowCount = Movie.BranchCount;
            CurrentBranch       = Movie.BranchCount - 1;
            BranchView.Refresh();
            Tastudio.RefreshDialog();
        }
コード例 #8
0
ファイル: MarkerControl.cs プロジェクト: budzikt/BizHawk
 private void RemoveMarkerToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (MarkerView.AnyRowsSelected)
     {
         SelectedMarkers.ForEach(i => Markers.Remove(i));
         MarkerInputRoll.DeselectAll();
         Tastudio.RefreshDialog();
         MarkerView_SelectedIndexChanged(null, null);
     }
 }
コード例 #9
0
        private void LoadBranch(TasBranch branch)
        {
            Tastudio.CurrentTasMovie.LoadBranch(branch);
            var stateInfo = new KeyValuePair <int, byte[]>(branch.Frame, branch.CoreData);

            Tastudio.LoadState(stateInfo);
            QuickBmpFile.Copy(new BitmapBufferVideoProvider(branch.OSDFrameBuffer), Tastudio.VideoProvider);
            GlobalWin.MainForm.PauseOnFrame = null;
            Tastudio.RefreshDialog();
        }
コード例 #10
0
        public void Branch()
        {
            TasBranch branch = CreateBranch();

            Movie.NewBranchText = "";             // reset every time it's used
            Movie.AddBranch(branch);
            BranchView.RowCount = Movie.BranchCount;
            Movie.CurrentBranch = Movie.BranchCount - 1;
            BranchView.Refresh();
            Tastudio.RefreshDialog();
        }
コード例 #11
0
		private void FollowCursorCheckbox_CheckedChanged(object sender, EventArgs e)
		{
			if (!_loading)
			{
				Tastudio.Settings.FollowCursor ^= true;

				if (Tastudio.Settings.FollowCursor)
				{
					Tastudio.SetVisibleIndex();
					Tastudio.RefreshDialog();
				}
			}
		}
コード例 #12
0
        private void LoadBranch(TasBranch branch)
        {
            if (Tastudio.Settings.OldControlSchemeForBranches && !Tastudio.TasPlaybackBox.RecordingMode)
            {
                JumpToBranchToolStripMenuItem_Click(null, null);
                return;
            }

            Tastudio.CurrentTasMovie.LoadBranch(branch);
            var stateInfo = new KeyValuePair <int, byte[]>(branch.Frame, branch.CoreData);

            Tastudio.LoadState(stateInfo);
            QuickBmpFile.Copy(new BitmapBufferVideoProvider(branch.OSDFrameBuffer), Tastudio.VideoProvider);

            if (Tastudio.Settings.OldControlSchemeForBranches && Tastudio.TasPlaybackBox.RecordingMode)
            {
                Tastudio.CurrentTasMovie.Truncate(branch.Frame);
            }

            GlobalWin.MainForm.PauseOnFrame = null;
            Tastudio.RefreshDialog();
        }
コード例 #13
0
 private void UpdateBranch(TasBranch branch)
 {
     Movie.UpdateBranch(branch, CreateBranch());
     Tastudio.RefreshDialog();
 }