mirror of
https://github.com/ppy/osu
synced 2025-01-04 13:22:08 +00:00
Fix warnings
This commit is contained in:
parent
d8620a70fb
commit
e76f8bdd64
@ -35,20 +35,14 @@ namespace osu.Game.Tests.Visual.Editor
|
||||
typeof(CentreMarker)
|
||||
};
|
||||
|
||||
[Cached(typeof(IEditorBeatmap))]
|
||||
private readonly EditorBeatmap<OsuHitObject> editorBeatmap;
|
||||
|
||||
public TestSceneEditorComposeTimeline()
|
||||
{
|
||||
editorBeatmap = new EditorBeatmap<OsuHitObject>(
|
||||
(Beatmap<OsuHitObject>)
|
||||
CreateWorkingBeatmap(new OsuRuleset().RulesetInfo).GetPlayableBeatmap(new OsuRuleset().RulesetInfo, new Mod[] { })
|
||||
);
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(AudioManager audio)
|
||||
{
|
||||
var editorBeatmap = new EditorBeatmap<OsuHitObject>(
|
||||
(Beatmap<OsuHitObject>)
|
||||
CreateWorkingBeatmap(new OsuRuleset().RulesetInfo).GetPlayableBeatmap(new OsuRuleset().RulesetInfo, new Mod[] { })
|
||||
);
|
||||
|
||||
Beatmap.Value = new WaveformTestBeatmap(audio);
|
||||
|
||||
Children = new Drawable[]
|
||||
|
@ -44,7 +44,12 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
d.Expire();
|
||||
}
|
||||
|
||||
private void add(HitObject h) => Add(new TimelineHitObjectRepresentation(h));
|
||||
private void add(HitObject h)
|
||||
{
|
||||
var yOffset = Children.Count(d => d.X == h.StartTime);
|
||||
|
||||
Add(new TimelineHitObjectRepresentation(h) { Y = -yOffset * 4 });
|
||||
}
|
||||
|
||||
private class TimelineHitObjectRepresentation : CompositeDrawable
|
||||
{
|
||||
@ -52,7 +57,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
|
||||
public TimelineHitObjectRepresentation(HitObject hitObject)
|
||||
{
|
||||
this.HitObject = hitObject;
|
||||
HitObject = hitObject;
|
||||
Anchor = Anchor.CentreLeft;
|
||||
Origin = Anchor.CentreLeft;
|
||||
|
||||
@ -63,6 +68,25 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
RelativePositionAxes = Axes.X;
|
||||
RelativeSizeAxes = Axes.X;
|
||||
|
||||
if (hitObject is IHasEndTime)
|
||||
{
|
||||
AddInternal(new Container
|
||||
{
|
||||
CornerRadius = 2,
|
||||
Masking = true,
|
||||
Size = new Vector2(1, 3),
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft,
|
||||
RelativePositionAxes = Axes.X,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Colour = Color4.Black,
|
||||
Child = new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
AddInternal(new Circle
|
||||
{
|
||||
Size = new Vector2(16),
|
||||
@ -71,20 +95,9 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
RelativePositionAxes = Axes.X,
|
||||
AlwaysPresent = true,
|
||||
Colour = Color4.White,
|
||||
BorderColour = Color4.Black,
|
||||
BorderThickness = 3,
|
||||
});
|
||||
|
||||
if (hitObject is IHasEndTime)
|
||||
{
|
||||
AddInternal(new Box
|
||||
{
|
||||
Size = new Vector2(1, 5),
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft,
|
||||
RelativePositionAxes = Axes.X,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Colour = Color4.White,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ namespace osu.Game.Screens.Edit
|
||||
|
||||
protected abstract Drawable CreateMainContent();
|
||||
|
||||
protected virtual Drawable CreateTimelineContent() => new Container { };
|
||||
protected virtual Drawable CreateTimelineContent() => new Container();
|
||||
|
||||
protected TimelineArea CreateTimelineArea() => new TimelineArea { RelativeSizeAxes = Axes.Both };
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user