Пример #1
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();
        }
Пример #2
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), Global.Emulator.VideoProvider());
            //GlobalWin.MainForm.PauseEmulator();
            GlobalWin.MainForm.PauseOnFrame = null;
            Tastudio.RefreshDialog();
        }
Пример #3
0
        private void ScreenShotPopUp(TasBranch branch, int index)
        {
            Point locationOnForm = this.FindForm().PointToClient(
                this.Parent.PointToScreen(this.Location));

            int x = locationOnForm.X - Tastudio.ScreenshotControl.Width;
            int y = locationOnForm.Y + (BranchView.RowHeight * index);

            Tastudio.ScreenshotControl.Location = new Point(x, y);

            Tastudio.ScreenshotControl.Visible = true;
            Tastudio.ScreenshotControl.Branch  = branch;
            Tastudio.ScreenshotControl.Refresh();
        }
        private void UpdateBranchToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (SelectedBranch != null)
            {
                Movie.CurrentBranch = BranchView.SelectedRows.First();

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

                UpdateBranch(SelectedBranch);
                GlobalWin.OSD.AddMessage("Saved branch " + Movie.CurrentBranch.ToString());
            }
        }
Пример #5
0
        public void UpdateValues(TasBranch branch, Point location, int width, int height, int padding)
        {
            _branch        = branch;
            Width          = width;
            Padding        = padding;
            _drawingHeight = height;
            Text           = _branch.UserText;
            Location       = location;

            if (Padding > 0)
            {
                Padding += 2;
            }

            Height = _drawingHeight + Padding;
            Refresh();
        }
        private void LoadBranchToolStripMenuItem_Click(object sender, EventArgs e)
        {
            BackupBranch = CreateBranch();

            var currentHashes = Movie.Branches.Select(b => b.UniqueIdentifier.GetHashCode()).ToList();

            do
            {
                BackupBranch.UniqueIdentifier = Guid.NewGuid();
            }while (currentHashes.Contains(BackupBranch.UniqueIdentifier.GetHashCode()));

            UndoBranchToolStripMenuItem.Enabled = UndoBranchButton.Enabled = true;
            UndoBranchToolStripMenuItem.Text    = "Undo Branch Load";
            toolTip1.SetToolTip(UndoBranchButton, "Undo Branch Load");
            _branchUndo = BranchUndo.Load;

            LoadSelectedBranch();
        }
Пример #7
0
        private void ScreenShotPopUp(TasBranch branch, int index)
        {
            Point locationOnForm = this.FindForm().PointToClient(
                this.Parent.PointToScreen(this.Location));

            int x = locationOnForm.X - Tastudio.ScreenshotControl.Width;
            int y = locationOnForm.Y;             // keep consistent height, helps when conparing screenshots

            if (x < 1)
            {
                x = 1;
            }

            Tastudio.ScreenshotControl.Location = new Point(x, y);
            Tastudio.ScreenshotControl.Visible  = true;
            Tastudio.ScreenshotControl.Branch   = branch;
            Tastudio.ScreenshotControl.RecalculateHeight();
            Tastudio.ScreenshotControl.Refresh();
        }
Пример #8
0
        private void EditBranchTextToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (SelectedBranch != null)
            {
                int    index   = BranchView.SelectedRows.First();
                string oldText = SelectedBranch.UserText;

                if (EditBranchTextPopUp(index))
                {
                    _backupBranch          = SelectedBranch.Clone();
                    _backupBranch.UserText = oldText;
                    UndoBranchToolStripMenuItem.Enabled = UndoBranchButton.Enabled = true;
                    UndoBranchToolStripMenuItem.Text    = "Undo Branch Text Edit";
                    toolTip1.SetToolTip(UndoBranchButton, "Undo Branch Text Edit");
                    _branchUndo = BranchUndo.Text;

                    GlobalWin.OSD.AddMessage("Edited branch " + index.ToString());
                }
            }
        }
Пример #9
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();
        }
Пример #10
0
        public void UpdateValues(TasBranch branch, int width, int height, int padding)
        {
            Branch        = branch;
            Width         = width;
            Padding       = padding;
            DrawingHeight = height;
            Text          = Branch.UserText;

            // Set the screenshot to "1x" resolution of the core
            // cores like n64 and psx are going to still have sizes too big for the control, so cap them
            if (Width > 320)
            {
                double ratio = 320.0 / (double)Width;
                Width         = 320;
                DrawingHeight = (int)((double)(DrawingHeight) * ratio);
            }

            if (Padding > 0)
            {
                Padding += 2;
            }
            Height = DrawingHeight + Padding;
        }
Пример #11
0
		private void UpdateBranch(TasBranch branch)
		{
			Movie.UpdateBranch(branch, CreateBranch());
			Tastudio.RefreshDialog();
			//BranchView.Refresh();
		}
Пример #12
0
 private void UpdateBranch(TasBranch branch)
 {
     Movie.UpdateBranch(branch, CreateBranch());
     Tastudio.RefreshDialog();
 }
Пример #13
0
		private void UpdateBranch(TasBranch branch)
		{
			Movie.UpdateBranch(branch, CreateBranch());
			BranchView.Refresh();
		}
Пример #14
0
		private void ScreenShotPopUp(TasBranch branch, int index)
		{
			Point locationOnForm = this.FindForm().PointToClient(
				this.Parent.PointToScreen(this.Location));

			int x = locationOnForm.X - Tastudio.ScreenshotControl.Width;
			int y = locationOnForm.Y + (BranchView.RowHeight * index);

			Tastudio.ScreenshotControl.Location = new Point(x, y);

			Tastudio.ScreenshotControl.Visible = true;
			Tastudio.ScreenshotControl.Branch = branch;
			Tastudio.ScreenshotControl.Refresh();
		}
Пример #15
0
		private void LoadBranch(TasBranch branch)
		{
			Tastudio.CurrentTasMovie.LoadBranch(branch);
			GlobalWin.DisplayManager.NeedsToPaint = true;
			var stateInfo = new KeyValuePair<int, byte[]>(branch.Frame, branch.CoreData);
			Tastudio.LoadState(stateInfo);
			QuickBmpFile.Copy(new BitmapBufferVideoProvider(branch.OSDFrameBuffer), Global.Emulator.VideoProvider());
			GlobalWin.MainForm.PauseEmulator();
			GlobalWin.MainForm.PauseOnFrame = null;
			Tastudio.RefreshDialog();
		}
Пример #16
0
        private void UpdateBranch(TasBranch branch)
        {
            var index = Branches.IndexOf(branch);

            var newbranch = CreateBranch();
            Branches.Insert(index, newbranch);

            Branches.Remove(branch);
            CurrentBranch = index;
            BranchView.Refresh();
        }
Пример #17
0
 private void UpdateBranch(TasBranch branch)
 {
     Movie.UpdateBranch(branch, CreateBranch());
     BranchView.Refresh();
 }
Пример #18
0
		public void UpdateBranch(TasBranch old, TasBranch newBranch)
		{
			int index = Branches.IndexOf(old);
			Branches[index] = newBranch;
			TasStateManager.UpdateBranch(index);
		}
Пример #19
0
		public void AddBranch(TasBranch branch)
		{
			Branches.Add(branch);
			TasStateManager.AddBranch();
		}
Пример #20
0
		public void RemoveBranch(TasBranch branch)
		{
			TasStateManager.RemoveBranch(Branches.IndexOf(branch));
			Branches.Remove(branch);
			Changes = true;
		}
Пример #21
0
		public void LoadBranch(TasBranch branch)
		{
			int? divergentPoint = DivergentPoint(_log, branch.InputLog);

			if (_log != null) _log.Dispose();
				_log = branch.InputLog.Clone();
			//_changes = true;

			// if there are branch states, they will be loaded anyway
			// but if there's none, or only *after* divergent point, don't invalidate the entire movie anymore
			if (divergentPoint.HasValue)
			{
				StateManager.Invalidate(divergentPoint.Value);
				LagLog.FromLagLog(branch.LagLog); // don't truncate LagLog if the branch's one is shorter, but input is the same
			}
			else
				StateManager.Invalidate(branch.InputLog.Count);

			StateManager.LoadBranch(Branches.IndexOf(branch));

			StateManager.SetState(branch.Frame, branch.CoreData);

			//ChangeLog = branch.ChangeLog;
			Markers = branch.Markers;
			Changes = true;
		}
Пример #22
0
        public void LoadBranch(TasBranch branch)
        {
            int? divergentPoint = DivergantPoint(_log, branch.InputLog);

            _log = branch.InputLog.ToList();
            _changes = true;
            LagLog.FromLagLog(branch.LagLog);

            if (divergentPoint.HasValue)
            {
                StateManager.Invalidate(divergentPoint.Value);

                // For now, even though we loaded the lag log, we are invalidating it the same as savestates to show the user the space isn't navigatable without re-emulating
                LagLog.RemoveFrom(divergentPoint.Value);
            }
            else
            {
                StateManager.Invalidate(branch.InputLog.Count);
            }

            StateManager.SetState(branch.Frame, branch.CoreData);

            // TODO: we save the changelog, but not to disk, also this may not be intended behavior
            //ChangeLog = branch.ChangeLog;
        }
Пример #23
0
        public void LoadBranch(TasBranch branch)
        {
            int? divergentPoint = DivergantPoint(_log, branch.InputLog);

            _log = branch.InputLog;
            _changes = true;
            LagLog.FromLagLog(branch.LagLog);

            if (divergentPoint.HasValue)
                StateManager.Invalidate(divergentPoint.Value);
            else
                StateManager.Invalidate(branch.InputLog.Count);

            StateManager.SetState(branch.Frame, branch.CoreData);

            ChangeLog = branch.ChangeLog;
        }
Пример #24
0
		public void AddBranch(TasBranch branch)
		{
			Branches.Add(branch);
			TasStateManager.AddBranch();
			Changes = true;
		}
Пример #25
0
		private void ScreenShotPopUp(TasBranch branch, int index)
		{
			Point locationOnForm = this.FindForm().PointToClient(
				this.Parent.PointToScreen(this.Location));

			int x = locationOnForm.X - Tastudio.ScreenshotControl.Width;
			int y = locationOnForm.Y; // keep consistent height, helps when conparing screenshots

			if (x < 1) x = 1;

			Tastudio.ScreenshotControl.Location = new Point(x, y);
			Tastudio.ScreenshotControl.Visible = true;
			Tastudio.ScreenshotControl.Branch = branch;
			Tastudio.ScreenshotControl.RecalculateHeight();
			Tastudio.ScreenshotControl.Refresh();
		}
Пример #26
0
		public void UpdateBranch(TasBranch old, TasBranch newBranch)
		{
			int index = Branches.IndexOf(old);
			newBranch.UniqueIdentifier = old.UniqueIdentifier;
			Branches[index] = newBranch;
			TasStateManager.UpdateBranch(index);
			Changes = true;
		}
Пример #27
0
		public void LoadBranch(TasBranch branch)
		{
			int? divergentPoint = DivergantPoint(_log, branch.InputLog);

			_log = branch.InputLog.ToList();
			_changes = true;
			LagLog.FromLagLog(branch.LagLog);

			StateManager.LoadBranch(Branches.IndexOf(branch));

			StateManager.SetState(branch.Frame, branch.CoreData);

			ChangeLog = branch.ChangeLog;
			Markers = branch.Markers;
		}