From 01d84893a09022b4c0d4feb504f35d2764c8c7ae Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Wed, 20 Sep 2017 15:55:23 +0900 Subject: [PATCH] Cleanup + commenting --- .../Visual/TestCaseEditorMiniTimeline.cs | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/osu.Game/Tests/Visual/TestCaseEditorMiniTimeline.cs b/osu.Game/Tests/Visual/TestCaseEditorMiniTimeline.cs index ecf6d90cef..f33c7301d5 100644 --- a/osu.Game/Tests/Visual/TestCaseEditorMiniTimeline.cs +++ b/osu.Game/Tests/Visual/TestCaseEditorMiniTimeline.cs @@ -49,6 +49,9 @@ namespace osu.Game.Tests.Visual osuGame.Beatmap.Value = beatmaps.GetWorkingBeatmap(setInfo.Beatmaps[0]); } + /// + /// The timeline that sits at the bottom of the editor. + /// private class MiniTimeline : CompositeDrawable { private const float corner_radius = 5; @@ -180,21 +183,23 @@ namespace osu.Game.Tests.Visual } protected override bool OnDragStart(InputState state) => true; - + protected override bool OnDragEnd(InputState state) => true; protected override bool OnDrag(InputState state) { seekToPosition(state.Mouse.NativeState.Position); return true; } - protected override bool OnDragEnd(InputState state) => true; - protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) { seekToPosition(state.Mouse.NativeState.Position); return true; } + /// + /// Seeks the to the time closest to a position on the screen relative to the . + /// + /// The position in screen coordinates. private void seekToPosition(Vector2 screenPosition) { float markerPos = MathHelper.Clamp(markerContainer.ToLocalSpace(screenPosition).X, 0, markerContainer.DrawWidth); @@ -206,10 +211,12 @@ namespace osu.Game.Tests.Visual protected override void Update() { base.Update(); - marker.X = (float)beatmap.Value.Track.CurrentTime; } + /// + /// The part of the timeline that displays the control points. + /// private class ControlPointTimeline : Timeline { protected override void LoadBeatmap(WorkingBeatmap beatmap) @@ -265,6 +272,9 @@ namespace osu.Game.Tests.Visual } } + /// + /// The part of the timeline that displays bookmarks. + /// private class BookmarkTimeline : Timeline { protected override void LoadBeatmap(WorkingBeatmap beatmap) @@ -285,6 +295,9 @@ namespace osu.Game.Tests.Visual } } + /// + /// The part of the timeline that displays breaks in the song. + /// private class BreakTimeline : Timeline { protected override void LoadBeatmap(WorkingBeatmap beatmap) @@ -305,6 +318,9 @@ namespace osu.Game.Tests.Visual } } + /// + /// Represents a part of the editor timeline. + /// private abstract class Timeline : CompositeDrawable { private readonly Container timeline; @@ -334,6 +350,9 @@ namespace osu.Game.Tests.Visual protected abstract void LoadBeatmap(WorkingBeatmap beatmap); } + /// + /// Represents a singular point on a . + /// private class PointVisualisation : Box { public readonly double StartTime; @@ -353,6 +372,9 @@ namespace osu.Game.Tests.Visual } } + /// + /// Represents a spanning point on a . + /// private class DurationVisualisation : Container { public readonly double StartTime;