mirror of
https://github.com/ppy/osu.git
synced 2025-02-19 10:43:21 +08:00
More cleanup
This commit is contained in:
parent
b26c8dd1c7
commit
9f36a39c59
@ -23,27 +23,10 @@ namespace osu.Game.Overlays.Direct
|
||||
{
|
||||
private readonly Box tabStrip;
|
||||
private readonly FillFlowContainer<ModeToggleButton> modeButtons;
|
||||
private readonly OsuDropdown<RankStatus> rankStatusDropdown;
|
||||
|
||||
public readonly SearchTextBox Search;
|
||||
|
||||
public enum RankStatus
|
||||
{
|
||||
Any,
|
||||
[Description("Ranked & Approved")]
|
||||
RankedApproved,
|
||||
Approved,
|
||||
Loved,
|
||||
Favourites,
|
||||
[Description("Mod Requests")]
|
||||
ModRequests,
|
||||
Pending,
|
||||
Graveyard,
|
||||
[Description("My Maps")]
|
||||
MyMaps,
|
||||
}
|
||||
|
||||
protected override bool InternalContains(Vector2 screenSpacePos) => true;
|
||||
public readonly SortTabControl SortTabs;
|
||||
public readonly OsuEnumDropdown<RankStatus> RankStatusDropdown;
|
||||
|
||||
public FilterControl()
|
||||
{
|
||||
@ -83,13 +66,13 @@ namespace osu.Game.Overlays.Direct
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Spacing = new Vector2(10f, 0f),
|
||||
},
|
||||
new SortTabControl
|
||||
SortTabs = new SortTabControl
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
},
|
||||
},
|
||||
},
|
||||
rankStatusDropdown = new SlimEnumDropdown<RankStatus>
|
||||
RankStatusDropdown = new SlimEnumDropdown<RankStatus>
|
||||
{
|
||||
Anchor = Anchor.BottomRight,
|
||||
Origin = Anchor.BottomRight,
|
||||
@ -99,14 +82,18 @@ namespace osu.Game.Overlays.Direct
|
||||
},
|
||||
};
|
||||
|
||||
rankStatusDropdown.Current.Value = RankStatus.RankedApproved;
|
||||
RankStatusDropdown.Current.Value = RankStatus.RankedApproved;
|
||||
|
||||
//todo: possibly restore from config instead of always title
|
||||
SortTabs.Current.Value = SortCriteria.Title;
|
||||
SortTabs.Current.TriggerChange();
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(OsuGame game, RulesetDatabase rulesets, OsuColour colours)
|
||||
{
|
||||
tabStrip.Colour = colours.Yellow;
|
||||
rankStatusDropdown.AccentColour = colours.BlueDark;
|
||||
RankStatusDropdown.AccentColour = colours.BlueDark;
|
||||
|
||||
foreach (var r in rulesets.AllRulesets)
|
||||
{
|
||||
@ -209,4 +196,20 @@ namespace osu.Game.Overlays.Direct
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum RankStatus
|
||||
{
|
||||
Any,
|
||||
[Description("Ranked & Approved")]
|
||||
RankedApproved,
|
||||
Approved,
|
||||
Loved,
|
||||
Favourites,
|
||||
[Description("Mod Requests")]
|
||||
ModRequests,
|
||||
Pending,
|
||||
Graveyard,
|
||||
[Description("My Maps")]
|
||||
MyMaps,
|
||||
}
|
||||
}
|
||||
|
@ -21,9 +21,8 @@ namespace osu.Game.Overlays.Direct
|
||||
public class Header : Container
|
||||
{
|
||||
private readonly Box tabStrip;
|
||||
private readonly DirectTabControl tabs;
|
||||
|
||||
public Action<DirectTab> OnSelectTab;
|
||||
public readonly OsuTabControl<DirectTab> Tabs;
|
||||
|
||||
public Header()
|
||||
{
|
||||
@ -71,7 +70,7 @@ namespace osu.Game.Overlays.Direct
|
||||
Width = 282, //todo: make this actually match the tab control's width instead of hardcoding
|
||||
Height = 1,
|
||||
},
|
||||
tabs = new DirectTabControl
|
||||
Tabs = new DirectTabControl
|
||||
{
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Origin = Anchor.BottomLeft,
|
||||
@ -81,7 +80,9 @@ namespace osu.Game.Overlays.Direct
|
||||
},
|
||||
};
|
||||
|
||||
tabs.Current.ValueChanged += (newValue) => OnSelectTab?.Invoke(newValue);
|
||||
//todo: possibly restore from config instead of always search
|
||||
Tabs.Current.Value = DirectTab.Search;
|
||||
Tabs.Current.TriggerChange();
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
@ -114,10 +115,10 @@ namespace osu.Game.Overlays.Direct
|
||||
{
|
||||
Search,
|
||||
[Description("Newest Maps")]
|
||||
New,
|
||||
NewestMaps,
|
||||
[Description("Top Rated")]
|
||||
Top,
|
||||
TopRated,
|
||||
[Description("Most Played")]
|
||||
MostP
|
||||
MostPlayed
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user