示例#1
0
        public void DrawTimelines(ScoreComponent auto, float yOffsetPos, float xScrollIndex, float trackWidth)
        {
            var yIndex = yOffsetPos;

            for (var windowIndex = 0; windowIndex < timelineTracks.Count; windowIndex++)
            {
                var timelineTrack = timelineTracks[windowIndex];
                if (!timelineTrack.IsExistTimeline)
                {
                    continue;
                }

                var trackHeight = timelineTrack.DrawTimelineTrack(yOffsetPos, xScrollIndex, yIndex, trackWidth);

                // set next y index.
                yIndex = yIndex + trackHeight + TimeFlowShikiGUISettings.TIMELINE_SPAN;
            }
        }
示例#2
0
        private List <ScoreComponent> LoadScores(Dictionary <string, object> deserialized)
        {
            var newScores = new List <ScoreComponent>();

            var scoresList = deserialized[TimeFlowShikiSettings.TIMEFLOWSHIKI_DATA_SCORES] as List <object>;

            foreach (var score in scoresList)
            {
                var scoreDict      = score as Dictionary <string, object>;
                var scoreId        = scoreDict[TimeFlowShikiSettings.TIMEFLOWSHIKI_DATA_SCORE_ID] as string;
                var scoreTitle     = scoreDict[TimeFlowShikiSettings.TIMEFLOWSHIKI_DATA_SCORE_TITLE] as string;
                var scoreTimelines = scoreDict[TimeFlowShikiSettings.TIMEFLOWSHIKI_DATA_SCORE_TIMELINES] as List <object>;

                var currentTimelines = new List <TimelineTrack>();
                foreach (var scoreTimeline in scoreTimelines)
                {
                    var scoreTimelineDict = scoreTimeline as Dictionary <string, object>;

                    var timelineTitle = scoreTimelineDict[TimeFlowShikiSettings.TIMEFLOWSHIKI_DATA_TIMELINE_TITLE] as string;
                    var timelineTacks = scoreTimelineDict[TimeFlowShikiSettings.TIMEFLOWSHIKI_DATA_TIMELINE_TACKS] as List <object>;

                    var currentTacks = new List <TackPoint>();
                    foreach (var timelineTack in timelineTacks)
                    {
                        var timelineTacksDict = timelineTack as Dictionary <string, object>;

                        var tackTitle = timelineTacksDict[TimeFlowShikiSettings.TIMEFLOWSHIKI_DATA_TACK_TITLE] as string;
                        var tackStart = Convert.ToInt32(timelineTacksDict[TimeFlowShikiSettings.TIMEFLOWSHIKI_DATA_TACK_START]);
                        var tackSpan  = Convert.ToInt32(timelineTacksDict[TimeFlowShikiSettings.TIMEFLOWSHIKI_DATA_TACK_SPAN]);

                        var newTack = new TackPoint(currentTacks.Count, tackTitle, tackStart, tackSpan);

                        currentTacks.Add(newTack);
                    }

                    var newTimeline = new TimelineTrack(currentTimelines.Count, timelineTitle, currentTacks);
                    currentTimelines.Add(newTimeline);
                }
                var newScore = new ScoreComponent(scoreId, scoreTitle, currentTimelines);
                newScores.Add(newScore);
            }
            return(newScores);
        }
示例#3
0
 private void DrawTimelines(ScoreComponent activeAuto, float yOffsetPos, float xScrollIndex, float viewWidth)
 {
     BeginWindows();
     activeAuto.DrawTimelines(activeAuto, yOffsetPos, xScrollIndex, viewWidth);
     EndWindows();
 }