Example #1
0
 static void DrawMuteButton(Rect rect, WindowState state)
 {
     if (GUI.Button(rect, GUIContent.none, TimelineWindow.styles.mute))
     {
         TimelineAction.Invoke <ToggleMuteMarkersOnTimeline>(state);
     }
 }
Example #2
0
 static void DrawLockButton(Rect rect, WindowState state)
 {
     if (GUI.Button(rect, GUIContent.none, TimelineWindow.styles.locked))
     {
         TimelineAction.Invoke <ToggleShowMarkersOnTimeline>(state);
     }
 }
Example #3
0
        // CurveEditor uses an hardcoded shortcut to execute the FrameAll action, preventing the ShortcutManager from
        // ever picking it up. We have to hijack it to ensure our code is being run when framing inline curves.
        protected override bool KeyDown(Event evt, WindowState state)
        {
            var inlineCurveEditor = SelectionManager.GetCurrentInlineEditorCurve();

            if (inlineCurveEditor == null || !inlineCurveEditor.inlineCurvesSelected)
            {
                return(false);
            }

            // Not conflicting with the hardcoded value
            if (evt.keyCode != KeyCode.A)
            {
                return(false);
            }

            var combination = ShortcutManager.instance.GetShortcutBinding(Shortcuts.Timeline.frameAll)
                              .keyCombinationSequence.ToList();

            var shortcutCombination = combination.First();
            var currentCombination  = KeyCombination.FromKeyboardInput(evt);

            // User is not actually pressing the correct key combination for FrameAll
            if (combination.Count == 1 && shortcutCombination.Equals(currentCombination))
            {
                TimelineAction.Invoke <FrameAllAction>(state);
            }

            return(true);
        }
Example #4
0
        protected override bool ExecuteCommand(Event evt, WindowState state)
        {
            if (state.IsCurrentEditingASequencerTextField())
            {
                return(false);
            }

            if (evt.commandName == EventCommandNames.SelectAll)
            {
                TimelineAction.Invoke <SelectAllAction>(state);
                return(true);
            }

            if (evt.commandName == EventCommandNames.SoftDelete)
            {
                TimelineAction.Invoke <DeleteAction>(state);
                return(true);
            }

            if (evt.commandName == EventCommandNames.FrameSelected)
            {
                TimelineAction.Invoke <FrameSelectedAction>(state);
                return(true);
            }

            return(TimelineAction.HandleShortcut(state, evt));
        }
Example #5
0
        protected override bool ExecuteCommand(Event evt, WindowState state)
        {
            if (state.IsCurrentEditingASequencerTextField())
            {
                return(false);
            }

            var inlineCurveEditor = SelectionManager.GetCurrentInlineEditorCurve();

            if (inlineCurveEditor == null || !inlineCurveEditor.inlineCurvesSelected)
            {
                return(false);
            }

            if (evt.commandName != EventCommandNames.FrameSelected)
            {
                return(false);
            }

            TimelineAction.Invoke <FrameSelectedAction>(state);
            return(true);
        }