예제 #1
0
        private void DrawSlideNote(Graphics context, double now, Note note)
        {
            float x, y, r;

            if (NotesLayerUtils.IsNoteOnStage(note, now))
            {
                if (note.Helper.IsSlideEnd && NotesLayerUtils.IsNotePassed(note, now))
                {
                    return;
                }
                x = NotesLayerUtils.GetNoteXPosition(context, now, note);
                y = NotesLayerUtils.GetNoteYPosition(context, now, note);
                r = NotesLayerUtils.GetNoteRadius(now, note);
            }
            else if (NotesLayerUtils.IsNotePassed(note, now))
            {
                if (!note.Helper.HasNextSlide || NotesLayerUtils.IsNotePassed(note.Editor.NextSlide, now))
                {
                    return;
                }
                var nextSlideNote = note.Editor.NextSlide;
                if (nextSlideNote == null)
                {
                    // Actually, here is an example of invalid format. :)
                    DrawTapNote(context, now, note);
                    return;
                }
                else
                {
                    var startX = NotesLayerUtils.GetEndXByNotePosition(context.Bounds, note.Basic.FinishPosition);
                    var endX   = NotesLayerUtils.GetEndXByNotePosition(context.Bounds, nextSlideNote.Basic.FinishPosition);
                    y = NotesLayerUtils.GetAvatarYPosition(context.Bounds);
                    x = (float)((now - note.Temporary.HitTiming.TotalSeconds) / (nextSlideNote.Temporary.HitTiming.TotalSeconds - note.Temporary.HitTiming.TotalSeconds)) * (endX - startX) + startX;
                    r = Definitions.AvatarCircleRadius;
                }
            }
            else
            {
                return;
            }

            DrawCommonNoteOutline(context, note, x, y, r);

            var isMidway   = note.Helper.IsSlideMidway;
            var fillColors = isMidway ? SlideNoteShapeFillOuterTranslucentColors : SlideNoteShapeFillOuterColors;
            var r1         = r * Definitions.ScaleFactor1;

            using (var fill = GetFillBrush(x, y, r, fillColors)) {
                context.FillEllipse(fill, x - r1, y - r1, r1 * 2, r1 * 2);
            }
            var r2 = r * Definitions.ScaleFactor3;

            context.FillEllipse(_slideNoteShapeFillInner, x - r2, y - r2, r2 * 2, r2 * 2);
            var l = r * Definitions.SlideNoteStrikeHeightFactor;

            context.FillRectangle(_slideNoteShapeFillInner, x - r1 - 1, y - l, r1 * 2 + 2, l * 2);
        }