Example #1
0
        void TimeCursorGUI(TimelineItemArea area)
        {
            DrawTimeOnSlider();
            if (!CanDrawTimeCursor(area))
            {
                return;
            }

            if (m_PlayHead == null || m_PlayHead.style != styles.timeCursor)
            {
                m_PlayHead = new TimeAreaItem(styles.timeCursor, OnTrackHeadDrag);
                m_PlayHead.AddManipulator(new PlayheadContextMenu(m_PlayHead));
            }

            var headerMode = area == TimelineItemArea.Header;

            DrawTimeCursor(headerMode, !headerMode);
        }
Example #2
0
        bool CanDrawTimeCursor(TimelineItemArea area)
        {
            if (!currentMode.ShouldShowTimeCursor(state))
            {
                return(false);
            }

            if (treeView == null || state.editSequence.asset == null || (state.editSequence.asset != null && state.IsEditingAnEmptyTimeline()))
            {
                return(false);
            }

            if (area == TimelineItemArea.Lines && !state.TimeIsInRange((float)state.editSequence.time))
            {
                return(false);
            }

            return(true);
        }
Example #3
0
        void DurationGUI(TimelineItemArea area, double duration)
        {
            // don't show the duration if the time area is not visible for some other reason.
            if (!currentMode.ShouldShowTimeArea(state))
            {
                return;
            }

            bool headerMode = area == TimelineItemArea.Header;

            if (state.IsEditingASubTimeline())
            {
                if (headerMode)
                {
                    HighlightTimeAreaRange(state.editSequence.GetEvaluableRange(), DirectorStyles.Instance.customSkin.colorSubSequenceDurationLine);
                }

                return;
            }

            // don't show the duration if there's none.
            if (state.editSequence.asset.durationMode == TimelineAsset.DurationMode.BasedOnClips && duration <= 0.0f)
            {
                return;
            }

            if (m_TimelineDuration == null || m_TimelineDuration.style != styles.endmarker)
            {
                m_TimelineDuration = new TimeAreaItem(styles.endmarker, OnTrackDurationDrag)
                {
                    tooltip     = L10n.Tr("End of sequence marker"),
                    boundOffset = new Vector2(0.0f, -DirectorStyles.kDurationGuiThickness)
                };
            }

            DrawDuration(headerMode, !headerMode, duration);
        }
        void PlayRangeGUI(TimelineItemArea area)
        {
            if (!currentMode.ShouldShowPlayRange(state) || treeView == null)
            {
                return;
            }

            if (state.masterSequence.asset != null && !state.masterSequence.asset.GetRootTracks().Any())
            {
                return;
            }

            // left Time Cursor
            if (m_PlayRangeStart == null || m_PlayRangeStart.style != styles.playTimeRangeStart)
            {
                m_PlayRangeStart = new TimeAreaItem(styles.playTimeRangeStart, OnTrackHeadMinSelectDrag);
                Vector2 offset = new Vector2(-2.0f, 0);
                m_PlayRangeStart.boundOffset = offset;
            }

            // right Time Cursor
            if (m_PlayRangeEnd == null || m_PlayRangeEnd.style != styles.playTimeRangeEnd)
            {
                m_PlayRangeEnd = new TimeAreaItem(styles.playTimeRangeEnd, OnTrackHeadMaxSelectDrag);
                Vector2 offset = new Vector2(2.0f, 0);
                m_PlayRangeEnd.boundOffset = offset;
            }

            if (area == TimelineItemArea.Header)
            {
                DrawPlayRange(true, false);
            }
            else if (area == TimelineItemArea.Lines)
            {
                DrawPlayRange(false, true);
            }
        }