Exemple #1
0
            /// <inheritdoc />
            public override void Hide()
            {
                if (!Visible)
                {
                    return;
                }

                Focus(null);

                if (_isDirty)
                {
                    if (_beforeData != null)
                    {
                        if (_undoContext is Track track)
                        {
                            var after = EditTrackAction.CaptureData(track);
                            if (!Utils.ArraysEqual(_beforeData, after))
                            {
                                _timeline.Undo.AddAction(new EditTrackAction(_timeline, track, _beforeData, after));
                            }
                        }
                        else if (_undoContext is Timeline)
                        {
                            var after = EditTimelineAction.CaptureData(_timeline);
                            if (!Utils.ArraysEqual(_beforeData, after))
                            {
                                _timeline.Undo.AddAction(new EditTimelineAction(_timeline, _beforeData, after));
                            }
                        }
                    }
                    _timeline.MarkAsEdited();
                }

                base.Hide();
            }
Exemple #2
0
            public PropertiesEditPopup(Timeline timeline, object obj, object undoContext)
            {
                const float width  = 280.0f;
                const float height = 160.0f;

                Size = new Vector2(width, height);

                var panel1 = new Panel(ScrollBars.Vertical)
                {
                    Bounds = new Rectangle(0, 0.0f, width, height),
                    Parent = this
                };
                var editor = new CustomEditorPresenter(null);

                editor.Panel.AnchorPreset = AnchorPresets.HorizontalStretchTop;
                editor.Panel.IsScrollable = true;
                editor.Panel.Parent       = panel1;
                editor.Modified          += OnModified;

                editor.Select(obj);

                _timeline = timeline;
                if (timeline.Undo != null && timeline.Undo.Enabled && undoContext != null)
                {
                    _undoContext = undoContext;
                    if (undoContext is Track track)
                    {
                        _beforeData = EditTrackAction.CaptureData(track);
                    }
                    else if (undoContext is Timeline)
                    {
                        _beforeData = EditTimelineAction.CaptureData(timeline);
                    }
                }
            }
        private void OnCurveEditingEnd()
        {
            var after = EditTrackAction.CaptureData(this);

            if (!Utils.ArraysEqual(_curveEditingStartData, after))
            {
                Timeline.AddBatchedUndoAction(new EditTrackAction(Timeline, this, _curveEditingStartData, after));
            }
            _curveEditingStartData = null;
        }
        private void OnKeyframesEditingEnd()
        {
            var after = EditTrackAction.CaptureData(this);

            if (!Utils.ArraysEqual(_keyframesEditingStartData, after))
            {
                Timeline.Undo.AddAction(new EditTrackAction(Timeline, this, _keyframesEditingStartData, after));
            }
            _keyframesEditingStartData = null;
        }
 private void OnCurveEditingStart()
 {
     _curveEditingStartData = EditTrackAction.CaptureData(this);
 }
Exemple #6
0
 private void OnKeyframesEditingStart()
 {
     _keyframesEditingStartData = EditTrackAction.CaptureData(this);
 }
Exemple #7
0
 private void OnEventsEditingStart()
 {
     _eventsEditingStartData = EditTrackAction.CaptureData(this);
 }