mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 12:27:19 +08:00
Cleanup.
This commit is contained in:
parent
d09bcabc8f
commit
680f2e232c
@ -15,7 +15,7 @@ namespace osu.Game.Overlays.OnlineBeatmapSet
|
||||
{
|
||||
public class BasicStats : Container
|
||||
{
|
||||
private readonly Statistic length, bpm, circleCount, sliderCount;
|
||||
private readonly Statistic length, circleCount, sliderCount;
|
||||
|
||||
private BeatmapInfo beatmap;
|
||||
public BeatmapInfo Beatmap
|
||||
@ -43,7 +43,7 @@ namespace osu.Game.Overlays.OnlineBeatmapSet
|
||||
Children = new[]
|
||||
{
|
||||
length = new Statistic(FontAwesome.fa_clock_o, "Length") { Width = statWidth },
|
||||
bpm = new Statistic(FontAwesome.fa_circle, "BPM")
|
||||
new Statistic(FontAwesome.fa_circle, "BPM")
|
||||
{
|
||||
Width = statWidth,
|
||||
Value = set.OnlineInfo.BPM.ToString(@"0.##"),
|
||||
|
@ -152,7 +152,6 @@ namespace osu.Game.Overlays.OnlineBeatmapSet
|
||||
public BeatmapTile(BeatmapInfo beatmap, Bindable<BeatmapInfo> bindable)
|
||||
{
|
||||
this.beatmap = beatmap;
|
||||
this.bindable.BindTo(bindable);
|
||||
Size = new Vector2(size);
|
||||
Margin = new MarginPadding { Horizontal = tile_spacing / 2 };
|
||||
|
||||
@ -179,7 +178,8 @@ namespace osu.Game.Overlays.OnlineBeatmapSet
|
||||
};
|
||||
|
||||
Action = () => this.bindable.Value = beatmap;
|
||||
this.bindable.ValueChanged += bindable_ValueChanged;
|
||||
this.bindable.ValueChanged += beatmapChanged;
|
||||
this.bindable.BindTo(bindable);
|
||||
}
|
||||
|
||||
protected override bool OnHover(InputState state)
|
||||
@ -193,9 +193,10 @@ namespace osu.Game.Overlays.OnlineBeatmapSet
|
||||
{
|
||||
if (bindable.Value != beatmap)
|
||||
fadeOut();
|
||||
base.OnHoverLost(state);
|
||||
}
|
||||
|
||||
private void bindable_ValueChanged(BeatmapInfo value)
|
||||
private void beatmapChanged(BeatmapInfo value)
|
||||
{
|
||||
if (value == beatmap)
|
||||
fadeIn();
|
||||
|
@ -55,9 +55,18 @@ namespace osu.Game.Overlays.OnlineBeatmapSet
|
||||
|
||||
Favourited.ValueChanged += value =>
|
||||
{
|
||||
pink.FadeTo(value ? 1 : 0, 200);
|
||||
icon.Icon = value ? FontAwesome.fa_heart : FontAwesome.fa_heart_o;
|
||||
if (value)
|
||||
{
|
||||
pink.FadeIn(200);
|
||||
icon.Icon = FontAwesome.fa_heart;
|
||||
}
|
||||
else
|
||||
{
|
||||
pink.FadeOut(200);
|
||||
icon.Icon = FontAwesome.fa_heart_o;
|
||||
}
|
||||
};
|
||||
|
||||
Action = () => Favourited.Value = !Favourited.Value;
|
||||
}
|
||||
|
||||
|
@ -14,32 +14,32 @@ namespace osu.Game.Overlays.OnlineBeatmapSet
|
||||
{
|
||||
private readonly Container content;
|
||||
|
||||
protected override Container<Drawable> Content => content;
|
||||
protected override Container<Drawable> Content => content;
|
||||
|
||||
public HeaderButton()
|
||||
public HeaderButton()
|
||||
{
|
||||
CornerRadius = 3;
|
||||
Masking = true;
|
||||
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
CornerRadius = 3;
|
||||
Masking = true;
|
||||
|
||||
InternalChildren = new Drawable[]
|
||||
new Box
|
||||
{
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = OsuColour.FromHex(@"094c5f"),
|
||||
},
|
||||
new Triangles
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
ColourLight = OsuColour.FromHex(@"0f7c9b"),
|
||||
ColourDark = OsuColour.FromHex(@"094c5f"),
|
||||
TriangleScale = 1.5f,
|
||||
},
|
||||
content = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
},
|
||||
};
|
||||
}
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = OsuColour.FromHex(@"094c5f"),
|
||||
},
|
||||
new Triangles
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
ColourLight = OsuColour.FromHex(@"0f7c9b"),
|
||||
ColourDark = OsuColour.FromHex(@"094c5f"),
|
||||
TriangleScale = 1.5f,
|
||||
},
|
||||
content = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ namespace osu.Game.Overlays.OnlineBeatmapSet
|
||||
private AudioManager audio;
|
||||
private Track preview;
|
||||
|
||||
private bool playing = false;
|
||||
private bool playing;
|
||||
public bool Playing
|
||||
{
|
||||
get { return playing; }
|
||||
@ -125,6 +125,7 @@ namespace osu.Game.Overlays.OnlineBeatmapSet
|
||||
protected override void OnHoverLost(InputState state)
|
||||
{
|
||||
bg.FadeColour(Color4.Black.Opacity(0.25f), 100);
|
||||
base.OnHoverLost(state);
|
||||
}
|
||||
|
||||
private void loadPreview()
|
||||
|
@ -106,12 +106,6 @@ namespace osu.Game.Overlays.OnlineBeatmapSet
|
||||
base.UpdateAfterChildren();
|
||||
|
||||
graph.Padding = new MarginPadding { Top = header.DrawHeight };
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
|
||||
percentContainer.Width = successRate.Length;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user