mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 18:32:56 +08:00
Merge branch 'master' into overlay-header-padding
This commit is contained in:
commit
11f48ee4db
@ -30,12 +30,6 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
Add(selector = new SpotlightSelector());
|
Add(selector = new SpotlightSelector());
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void TestVisibility()
|
|
||||||
{
|
|
||||||
AddStep("Toggle Visibility", selector.ToggleVisibility);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestLocalSpotlights()
|
public void TestLocalSpotlights()
|
||||||
{
|
{
|
||||||
|
@ -18,10 +18,8 @@ using osu.Game.Online.API.Requests;
|
|||||||
|
|
||||||
namespace osu.Game.Overlays.Rankings
|
namespace osu.Game.Overlays.Rankings
|
||||||
{
|
{
|
||||||
public class SpotlightSelector : VisibilityContainer, IHasCurrentValue<APISpotlight>
|
public class SpotlightSelector : CompositeDrawable, IHasCurrentValue<APISpotlight>
|
||||||
{
|
{
|
||||||
private const int duration = 300;
|
|
||||||
|
|
||||||
private readonly BindableWithCurrent<APISpotlight> current = new BindableWithCurrent<APISpotlight>();
|
private readonly BindableWithCurrent<APISpotlight> current = new BindableWithCurrent<APISpotlight>();
|
||||||
public readonly Bindable<RankingsSortCriteria> Sort = new Bindable<RankingsSortCriteria>();
|
public readonly Bindable<RankingsSortCriteria> Sort = new Bindable<RankingsSortCriteria>();
|
||||||
|
|
||||||
@ -37,10 +35,7 @@ namespace osu.Game.Overlays.Rankings
|
|||||||
set => dropdown.Items = value;
|
set => dropdown.Items = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool StartHidden => true;
|
|
||||||
|
|
||||||
private readonly Box background;
|
private readonly Box background;
|
||||||
private readonly Container content;
|
|
||||||
private readonly SpotlightsDropdown dropdown;
|
private readonly SpotlightsDropdown dropdown;
|
||||||
private readonly InfoColumn startDateColumn;
|
private readonly InfoColumn startDateColumn;
|
||||||
private readonly InfoColumn endDateColumn;
|
private readonly InfoColumn endDateColumn;
|
||||||
@ -51,11 +46,7 @@ namespace osu.Game.Overlays.Rankings
|
|||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
AutoSizeAxes = Axes.Y;
|
AutoSizeAxes = Axes.Y;
|
||||||
Add(content = new Container
|
InternalChildren = new Drawable[]
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
AutoSizeAxes = Axes.Y,
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
{
|
||||||
background = new Box
|
background = new Box
|
||||||
{
|
{
|
||||||
@ -116,8 +107,7 @@ namespace osu.Game.Overlays.Rankings
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -134,10 +124,6 @@ namespace osu.Game.Overlays.Rankings
|
|||||||
participantsColumn.Value = response.Spotlight.Participants?.ToString("N0");
|
participantsColumn.Value = response.Spotlight.Participants?.ToString("N0");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void PopIn() => content.FadeIn(duration, Easing.OutQuint);
|
|
||||||
|
|
||||||
protected override void PopOut() => content.FadeOut(duration, Easing.OutQuint);
|
|
||||||
|
|
||||||
private string dateToString(DateTimeOffset date) => date.ToString("yyyy-MM-dd");
|
private string dateToString(DateTimeOffset date) => date.ToString("yyyy-MM-dd");
|
||||||
|
|
||||||
private class InfoColumn : FillFlowContainer
|
private class InfoColumn : FillFlowContainer
|
||||||
|
@ -81,8 +81,6 @@ namespace osu.Game.Overlays.Rankings
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
selector.Show();
|
|
||||||
|
|
||||||
selectedSpotlight.BindValueChanged(_ => onSpotlightChanged());
|
selectedSpotlight.BindValueChanged(_ => onSpotlightChanged());
|
||||||
sort.BindValueChanged(_ => onSpotlightChanged());
|
sort.BindValueChanged(_ => onSpotlightChanged());
|
||||||
Ruleset.BindValueChanged(onRulesetChanged);
|
Ruleset.BindValueChanged(onRulesetChanged);
|
||||||
|
Loading…
Reference in New Issue
Block a user