示例#1
0
        public void AddMarker(int frame, bool editText = false)
        {
            if (editText)
            {
                var i = new InputPrompt
                {
                    Text          = $"Marker for frame {frame}",
                    TextInputType = InputPrompt.InputType.Text,
                    Message       = "Enter a message",
                    InitialValue  =
                        Markers.IsMarker(frame) ?
                        Markers.PreviousOrCurrent(frame).Message :
                        ""
                };

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

                var result = i.ShowHawkDialog(position: point);
                if (result.IsOk())
                {
                    Markers.Add(new TasMovieMarker(frame, i.PromptText));
                    UpdateTextColumnWidth();
                    UpdateValues();
                }
            }
            else
            {
                Markers.Add(new TasMovieMarker(frame));
                UpdateValues();
            }

            MarkerView.ScrollToIndex(Markers.Count - 1);
            Tastudio.RefreshDialog();
        }
示例#2
0
		public TasMovie()
			: base()
		{
			StateManager = new TasStateManager(this);
			Header[HeaderKeys.MOVIEVERSION] = "BizHawk v2.0 Tasproj v1.0";
			Markers = new TasMovieMarkerList(this);
			Markers.Add(0, StartsFromSavestate ? "Savestate" : "Power on");
		}
示例#3
0
        public TasMovieMarkerList DeepClone()
        {
            var ret = new TasMovieMarkerList(_movie);

            for (int i = 0; i < Count; i++)
            {
                // used to copy markers between branches
                ret.Add(new TasMovieMarker(this[i].Frame, this[i].Message), skipHistory: true);
            }

            return(ret);
        }
示例#4
0
        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)
            {
                var 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));
                    UpdateTextColumnWidth();
                    UpdateValues();
                }
            }
            else
            {
                Markers.Add(new TasMovieMarker(markerFrame));
                UpdateValues();
            }

            MarkerView.ScrollToIndex(Markers.Count - 1);
            Tastudio.RefreshDialog();
        }
示例#5
0
		public TasMovie(bool startsFromSavestate = false, BackgroundWorker progressReportWorker = null)
			: base()
		{
			_progressReportWorker = progressReportWorker;
			if (!Global.Emulator.HasSavestates())
			{
				throw new InvalidOperationException("Cannot create a TasMovie against a core that does not implement IStatable");
			}

			ChangeLog = new TasMovieChangeLog(this);

			StateManager = new TasStateManager(this);
			Header[HeaderKeys.MOVIEVERSION] = "BizHawk v2.0 Tasproj v1.0";
			Markers = new TasMovieMarkerList(this);
			Markers.CollectionChanged += Markers_CollectionChanged;
			Markers.Add(0, startsFromSavestate ? "Savestate" : "Power on");
			
			BindMarkersToInput = true;
		}
示例#6
0
        public void AddMarker(int frame, bool editText = false)
        {
            TasMovieMarker marker;

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

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

                if (!this.ShowDialogWithTempMute(i).IsOk())
                {
                    return;
                }

                UpdateTextColumnWidth();
                marker = new TasMovieMarker(frame, i.PromptText);
            }
            else
            {
                marker = new TasMovieMarker(frame);
            }

            UpdateValues();
            Markers.Add(marker);
            var index = Markers.IndexOf(marker);

            MarkerView.MakeIndexVisible(index);
            Tastudio.RefreshDialog();
        }
示例#7
0
		public TasMovie(string path, bool startsFromSavestate = false, BackgroundWorker progressReportWorker = null)
			: base(path)
		{
			// TODO: how to call the default constructor AND the base(path) constructor?  And is base(path) calling base() ?
			_progressReportWorker = progressReportWorker;
			if (!Global.Emulator.HasSavestates())
			{
				throw new InvalidOperationException("Cannot create a TasMovie against a core that does not implement IStatable");
			}

			ChangeLog = new TasMovieChangeLog(this);

			StateManager = new TasStateManager(this);
			Session = new TasSession(this);
			Header[HeaderKeys.MOVIEVERSION] = "BizHawk v2.0 Tasproj v1.0";
			Markers = new TasMovieMarkerList(this);
			Markers.CollectionChanged += Markers_CollectionChanged;
			Markers.Add(0, startsFromSavestate ? "Savestate" : "Power on");

			BindMarkersToInput = true;
			CurrentBranch = -1;
		}