Beispiel #1
0
    protected virtual void UpdateTracks(DirectorControlState state, Rect header, Rect content, Rect controlArea)
    {
        SortedDictionary <int, TimelineTrackWrapper> sortedDictionary = new SortedDictionary <int, TimelineTrackWrapper>();

        foreach (TimelineTrackWrapper current in timelineTrackMap.Keys)
        {
            timelineTrackMap[current].TargetTrack = current;
            sortedDictionary.Add(current.Ordinal, current);
        }
        float num = header.y + 17f;

        foreach (int current2 in sortedDictionary.Keys)
        {
            TimelineTrackWrapper timelineTrackWrapper = sortedDictionary[current2];
            TimelineTrackControl timelineTrackControl = timelineTrackMap[timelineTrackWrapper];
            timelineTrackControl.Ordinal = new []
            {
                trackGroup.Ordinal,
                current2
            };
            float height           = timelineTrackControl.Rect.height;
            Rect  rect             = new Rect(content.x, num, content.width, height);
            Rect  headerBackground = new Rect(header.x, num, header.width, height);
            Rect  rect2            = new Rect(header.x, num, header.width - sortingOptionsWidth - 4f, height);
            Rect  rect3            = new Rect(rect2.x + rect2.width, num, sortingOptionsWidth / 2f, 16f);
            Rect  arg_225_0        = new Rect(rect3.x + sortingOptionsWidth / 2f, num, sortingOptionsWidth / 2f, 16f);
            timelineTrackControl.UpdateTrackBodyBackground(rect);
            timelineTrackControl.UpdateHeaderBackground(headerBackground, current2);
            GUILayout.BeginArea(rect);
            timelineTrackControl.UpdateTrackContents(state, rect, controlArea);
            GUILayout.EndArea();
            timelineTrackControl.UpdateHeaderContents(state, rect2, headerBackground);
            GUI.enabled = (current2 > 0);
            if (GUI.Button(rect3, string.Empty, DirectorControl.DirectorControlStyles.UpArrowIcon))
            {
                TimelineTrackWrapper expr_1CE = timelineTrackWrapper;
                int ordinal = expr_1CE.Ordinal;
                expr_1CE.Ordinal = ordinal - 1;
                TimelineTrackWrapper expr_1F9 = timelineTrackMap[sortedDictionary[current2 - 1]].TargetTrack;
                ordinal          = expr_1F9.Ordinal;
                expr_1F9.Ordinal = ordinal + 1;
            }
            GUI.enabled = (current2 < sortedDictionary.Count - 1);
            if (GUI.Button(arg_225_0, string.Empty, DirectorControl.DirectorControlStyles.DownArrowIcon))
            {
                TimelineTrackWrapper expr_22E = timelineTrackWrapper;
                int ordinal = expr_22E.Ordinal;
                expr_22E.Ordinal = ordinal + 1;
                TimelineTrackWrapper expr_259 = timelineTrackMap[sortedDictionary[current2 + 1]].TargetTrack;
                ordinal          = expr_259.Ordinal;
                expr_259.Ordinal = ordinal - 1;
            }
            GUI.enabled = (true);
            num        += height;
        }
    }
Beispiel #2
0
    protected virtual void UpdateTracks(DirectorControlState state, Rect header, Rect content)
    {
        SortedDictionary <int, TimelineTrackWrapper> dictionary = new SortedDictionary <int, TimelineTrackWrapper>();

        foreach (TimelineTrackWrapper wrapper in this.timelineTrackMap.Keys)
        {
            this.timelineTrackMap[wrapper].TargetTrack = wrapper;
            dictionary.Add(wrapper.Ordinal, wrapper);
        }
        float num = header.y + 17f;

        foreach (int num2 in dictionary.Keys)
        {
            TimelineTrackWrapper wrapper2 = dictionary[num2];
            TimelineTrackControl control  = this.timelineTrackMap[wrapper2];
            control.Ordinal = new int[] { this.trackGroup.Ordinal, num2 };
            float num3         = control.Rect.height;
            Rect  position     = new Rect(content.x, num, content.width, num3);
            Rect  rect2        = new Rect(header.x, num, header.width, num3);
            Rect  rect3        = new Rect(header.x, num, (header.width - this.sortingOptionsWidth) - 4f, num3);
            float introduced17 = rect3.x;
            Rect  rect4        = new Rect(introduced17 + rect3.width, num, this.sortingOptionsWidth / 2f, 16f);
            control.UpdateTrackBodyBackground(position);
            control.UpdateHeaderBackground(rect2, num2);
            GUILayout.BeginArea(position);
            Rect rect5 = position;
            control.UpdateTrackContents(state, rect5);
            GUILayout.EndArea();
            control.UpdateHeaderContents(state, rect3, rect2);
            GUI.enabled = (num2 > 0);
            if (GUI.Button(rect4, string.Empty, DirectorControl.DirectorControlStyles.UpArrowIcon))
            {
                wrapper2.Ordinal--;
                TimelineTrackWrapper targetTrack = this.timelineTrackMap[dictionary[num2 - 1]].TargetTrack;
                targetTrack.Ordinal++;
            }
            GUI.enabled = (num2 < (dictionary.Count - 1));
            if (GUI.Button(new Rect(rect4.x + (this.sortingOptionsWidth / 2f), num, this.sortingOptionsWidth / 2f, 16f), string.Empty, DirectorControl.DirectorControlStyles.DownArrowIcon))
            {
                wrapper2.Ordinal++;
                TimelineTrackWrapper wrapper3 = this.timelineTrackMap[dictionary[num2 + 1]].TargetTrack;
                wrapper3.Ordinal--;
            }
            GUI.enabled = (true);
            num        += num3;
        }
    }