Example #1
0
 public GizmoAnimationEditor(AnimationEditor editor, GraphicsDevice device,
                             Effect effect, PanelRenderingAnimationEditor control)
     : base(device, effect)
 {
     _editor        = editor;
     _configuration = editor.Tool.Configuration;
     _control       = control;
 }
Example #2
0
        public void Initialize(AnimationEditor editor, bool disableFrameControls = false)
        {
            _editor = editor;
            tbPlaySoundFrame.Enabled  = !disableFrameControls;
            tbFlipEffectFrame.Enabled = !disableFrameControls;

            butPlaySound.Enabled = (_editor.Tool.ReferenceLevel != null &&
                                    _editor.Tool.ReferenceLevel.Settings.GlobalSoundMap.Count > 0);

            ReloadSounds();
        }
Example #3
0
        public FormAnimCommandsEditor(AnimationEditor editor, AnimationNode animation)
        {
            InitializeComponent();
            animCommandEditor.Initialize(editor);
            _editor = editor;
            Initialize(animation);

            _editor.Tool.EditorEventRaised += Tool_EditorEventRaised;

            // Set window property handlers
            Configuration.LoadWindowProperties(this, _editor.Tool.Configuration);
            FormClosing += new FormClosingEventHandler((s, e) => Configuration.SaveWindowProperties(this, _editor.Tool.Configuration));
        }
Example #4
0
        public AnimationUndoInstance(AnimationEditor parent, AnimationNode anim) : base(parent)
        {
            Animation = anim.Clone();

            Valid = () => Parent.Animations.Count == AnimCount &&
                    Animation.DirectXAnimation != null &&
                    Animation.WadAnimation != null &&
                    Animation.Index >= 0 &&
                    Animation.Index < Parent.Animations.Count;

            UndoAction = () =>
            {
                Parent.Animations[Animation.Index] = Animation;
                Parent.Tool.AnimationEditorAnimationChanged(Animation, true);
            };

            RedoInstance = () => new AnimationUndoInstance(Parent, Parent.Animations[Animation.Index]);
        }
Example #5
0
        public FormStateChangesEditor(AnimationEditor editor, AnimationNode animation, WadStateChange newStateChange = null)
        {
            InitializeComponent();

            _editor = editor;

            dgvControls.CreateNewRow = () => new WadStateChangeRow()
            {
                StateName = TrCatalog.GetStateName(_editor.Tool.DestinationWad.GameVersion, _editor.Moveable.Id.TypeId, 0)
            };
            dgvControls.DataGridView = dgvStateChanges;
            dgvControls.Enabled      = true;

            Initialize(animation, newStateChange);
            _editor.Tool.EditorEventRaised += Tool_EditorEventRaised;

            // Set window property handlers
            Configuration.LoadWindowProperties(this, _editor.Tool.Configuration);
            FormClosing += new FormClosingEventHandler((s, e) => Configuration.SaveWindowProperties(this, _editor.Tool.Configuration));
        }
Example #6
0
        public FormReplaceAnimCommands(AnimationEditor editor, WadAnimCommand refCommand = null)
        {
            InitializeComponent();

            _editor = editor;
            aceFind.Initialize(_editor, true);
            aceReplace.Initialize(_editor, true);
            aceFind.Command = refCommand == null ? new WadAnimCommand()
            {
                Type = WadAnimCommandType.SetPosition
            } : refCommand;
            aceReplace.Command = new WadAnimCommand()
            {
                Type = WadAnimCommandType.SetPosition
            };

            // Set window property handlers
            Configuration.LoadWindowProperties(this, _editor.Tool.Configuration);
            FormClosing += new FormClosingEventHandler((s, e) => Configuration.SaveWindowProperties(this, _editor.Tool.Configuration));

            UpdateUI();
        }
Example #7
0
 public void PushAnimationChanged(AnimationEditor editor, List <AnimationNode> anims) => Push(anims.Select(anim => (new AnimationUndoInstance(editor, anim)) as UndoRedoInstance).ToList());
Example #8
0
 public void PushAnimationChanged(AnimationEditor editor, AnimationNode anim) => Push(new AnimationUndoInstance(editor, anim));
Example #9
0
 protected AnimationEditorUndoRedoInstance(AnimationEditor parent)
 {
     Parent = parent; AnimCount = Parent.Animations.Count;
 }