mirror of
https://github.com/osukey/osukey.git
synced 2025-05-21 21:47:31 +09:00
Move and shorten enum names
This commit is contained in:
parent
89320b510c
commit
c2ed6491a9
@ -8,7 +8,6 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Online.API.Requests;
|
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
using osu.Game.Overlays.BeatmapListing;
|
using osu.Game.Overlays.BeatmapListing;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
@ -41,8 +40,8 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new BeatmapSearchRulesetFilterRow(),
|
new BeatmapSearchRulesetFilterRow(),
|
||||||
new BeatmapSearchFilterRow<BeatmapSearchCategory>("Categories"),
|
new BeatmapSearchFilterRow<SearchCategory>("Categories"),
|
||||||
new BeatmapSearchFilterRow<BeatmapSearchCategory>("Header Name")
|
new BeatmapSearchFilterRow<SearchCategory>("Header Name")
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,26 +1,25 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System.ComponentModel;
|
|
||||||
using osu.Framework.IO.Network;
|
using osu.Framework.IO.Network;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
|
using osu.Game.Overlays.BeatmapListing;
|
||||||
using osu.Game.Overlays.Direct;
|
using osu.Game.Overlays.Direct;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Utils;
|
|
||||||
|
|
||||||
namespace osu.Game.Online.API.Requests
|
namespace osu.Game.Online.API.Requests
|
||||||
{
|
{
|
||||||
public class SearchBeatmapSetsRequest : APIRequest<SearchBeatmapSetsResponse>
|
public class SearchBeatmapSetsRequest : APIRequest<SearchBeatmapSetsResponse>
|
||||||
{
|
{
|
||||||
public BeatmapSearchCategory SearchCategory { get; set; }
|
public SearchCategory SearchCategory { get; set; }
|
||||||
|
|
||||||
public DirectSortCriteria SortCriteria { get; set; }
|
public DirectSortCriteria SortCriteria { get; set; }
|
||||||
|
|
||||||
public SortDirection SortDirection { get; set; }
|
public SortDirection SortDirection { get; set; }
|
||||||
|
|
||||||
public BeatmapSearchGenre Genre { get; set; }
|
public SearchGenre Genre { get; set; }
|
||||||
|
|
||||||
public BeatmapSearchLanguage Language { get; set; }
|
public SearchLanguage Language { get; set; }
|
||||||
|
|
||||||
private readonly string query;
|
private readonly string query;
|
||||||
private readonly RulesetInfo ruleset;
|
private readonly RulesetInfo ruleset;
|
||||||
@ -32,11 +31,11 @@ namespace osu.Game.Online.API.Requests
|
|||||||
this.query = string.IsNullOrEmpty(query) ? string.Empty : System.Uri.EscapeDataString(query);
|
this.query = string.IsNullOrEmpty(query) ? string.Empty : System.Uri.EscapeDataString(query);
|
||||||
this.ruleset = ruleset;
|
this.ruleset = ruleset;
|
||||||
|
|
||||||
SearchCategory = BeatmapSearchCategory.Any;
|
SearchCategory = SearchCategory.Any;
|
||||||
SortCriteria = DirectSortCriteria.Ranked;
|
SortCriteria = DirectSortCriteria.Ranked;
|
||||||
SortDirection = SortDirection.Descending;
|
SortDirection = SortDirection.Descending;
|
||||||
Genre = BeatmapSearchGenre.Any;
|
Genre = SearchGenre.Any;
|
||||||
Language = BeatmapSearchLanguage.Any;
|
Language = SearchLanguage.Any;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override WebRequest CreateWebRequest()
|
protected override WebRequest CreateWebRequest()
|
||||||
@ -49,10 +48,10 @@ namespace osu.Game.Online.API.Requests
|
|||||||
|
|
||||||
req.AddParameter("s", SearchCategory.ToString().ToLowerInvariant());
|
req.AddParameter("s", SearchCategory.ToString().ToLowerInvariant());
|
||||||
|
|
||||||
if (Genre != BeatmapSearchGenre.Any)
|
if (Genre != SearchGenre.Any)
|
||||||
req.AddParameter("g", ((int)Genre).ToString());
|
req.AddParameter("g", ((int)Genre).ToString());
|
||||||
|
|
||||||
if (Language != BeatmapSearchLanguage.Any)
|
if (Language != SearchLanguage.Any)
|
||||||
req.AddParameter("l", ((int)Language).ToString());
|
req.AddParameter("l", ((int)Language).ToString());
|
||||||
|
|
||||||
req.AddParameter("sort", $"{SortCriteria.ToString().ToLowerInvariant()}_{directionString}");
|
req.AddParameter("sort", $"{SortCriteria.ToString().ToLowerInvariant()}_{directionString}");
|
||||||
@ -62,81 +61,4 @@ namespace osu.Game.Online.API.Requests
|
|||||||
|
|
||||||
protected override string Target => @"beatmapsets/search";
|
protected override string Target => @"beatmapsets/search";
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum BeatmapSearchCategory
|
|
||||||
{
|
|
||||||
Any,
|
|
||||||
|
|
||||||
[Description("Has Leaderboard")]
|
|
||||||
Leaderboard,
|
|
||||||
Ranked,
|
|
||||||
Qualified,
|
|
||||||
Loved,
|
|
||||||
Favourites,
|
|
||||||
|
|
||||||
[Description("Pending & WIP")]
|
|
||||||
Pending,
|
|
||||||
Graveyard,
|
|
||||||
|
|
||||||
[Description("My Maps")]
|
|
||||||
Mine,
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum BeatmapSearchGenre
|
|
||||||
{
|
|
||||||
Any = 0,
|
|
||||||
Unspecified = 1,
|
|
||||||
|
|
||||||
[Description("Video Game")]
|
|
||||||
VideoGame = 2,
|
|
||||||
Anime = 3,
|
|
||||||
Rock = 4,
|
|
||||||
Pop = 5,
|
|
||||||
Other = 6,
|
|
||||||
Novelty = 7,
|
|
||||||
|
|
||||||
[Description("Hip Hop")]
|
|
||||||
HipHop = 9,
|
|
||||||
Electronic = 10
|
|
||||||
}
|
|
||||||
|
|
||||||
[HasOrderedElements]
|
|
||||||
public enum BeatmapSearchLanguage
|
|
||||||
{
|
|
||||||
[Order(0)]
|
|
||||||
Any,
|
|
||||||
|
|
||||||
[Order(11)]
|
|
||||||
Other,
|
|
||||||
|
|
||||||
[Order(1)]
|
|
||||||
English,
|
|
||||||
|
|
||||||
[Order(6)]
|
|
||||||
Japanese,
|
|
||||||
|
|
||||||
[Order(2)]
|
|
||||||
Chinese,
|
|
||||||
|
|
||||||
[Order(10)]
|
|
||||||
Instrumental,
|
|
||||||
|
|
||||||
[Order(7)]
|
|
||||||
Korean,
|
|
||||||
|
|
||||||
[Order(3)]
|
|
||||||
French,
|
|
||||||
|
|
||||||
[Order(4)]
|
|
||||||
German,
|
|
||||||
|
|
||||||
[Order(9)]
|
|
||||||
Swedish,
|
|
||||||
|
|
||||||
[Order(8)]
|
|
||||||
Spanish,
|
|
||||||
|
|
||||||
[Order(5)]
|
|
||||||
Italian
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Game.Online.API.Requests;
|
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Game.Beatmaps.Drawables;
|
using osu.Game.Beatmaps.Drawables;
|
||||||
@ -23,11 +22,11 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
|
|
||||||
public Bindable<RulesetInfo> Ruleset => modeFilter.Current;
|
public Bindable<RulesetInfo> Ruleset => modeFilter.Current;
|
||||||
|
|
||||||
public Bindable<BeatmapSearchCategory> Category => categoryFilter.Current;
|
public Bindable<SearchCategory> Category => categoryFilter.Current;
|
||||||
|
|
||||||
public Bindable<BeatmapSearchGenre> Genre => genreFilter.Current;
|
public Bindable<SearchGenre> Genre => genreFilter.Current;
|
||||||
|
|
||||||
public Bindable<BeatmapSearchLanguage> Language => languageFilter.Current;
|
public Bindable<SearchLanguage> Language => languageFilter.Current;
|
||||||
|
|
||||||
public BeatmapSetInfo BeatmapSet
|
public BeatmapSetInfo BeatmapSet
|
||||||
{
|
{
|
||||||
@ -46,9 +45,9 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
|
|
||||||
private readonly BeatmapSearchTextBox textBox;
|
private readonly BeatmapSearchTextBox textBox;
|
||||||
private readonly BeatmapSearchRulesetFilterRow modeFilter;
|
private readonly BeatmapSearchRulesetFilterRow modeFilter;
|
||||||
private readonly BeatmapSearchFilterRow<BeatmapSearchCategory> categoryFilter;
|
private readonly BeatmapSearchFilterRow<SearchCategory> categoryFilter;
|
||||||
private readonly BeatmapSearchFilterRow<BeatmapSearchGenre> genreFilter;
|
private readonly BeatmapSearchFilterRow<SearchGenre> genreFilter;
|
||||||
private readonly BeatmapSearchFilterRow<BeatmapSearchLanguage> languageFilter;
|
private readonly BeatmapSearchFilterRow<SearchLanguage> languageFilter;
|
||||||
|
|
||||||
private readonly Box background;
|
private readonly Box background;
|
||||||
private readonly UpdateableBeatmapSetCover beatmapCover;
|
private readonly UpdateableBeatmapSetCover beatmapCover;
|
||||||
@ -103,9 +102,9 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
modeFilter = new BeatmapSearchRulesetFilterRow(),
|
modeFilter = new BeatmapSearchRulesetFilterRow(),
|
||||||
categoryFilter = new BeatmapSearchFilterRow<BeatmapSearchCategory>(@"Categories"),
|
categoryFilter = new BeatmapSearchFilterRow<SearchCategory>(@"Categories"),
|
||||||
genreFilter = new BeatmapSearchFilterRow<BeatmapSearchGenre>(@"Genre"),
|
genreFilter = new BeatmapSearchFilterRow<SearchGenre>(@"Genre"),
|
||||||
languageFilter = new BeatmapSearchFilterRow<BeatmapSearchLanguage>(@"Language"),
|
languageFilter = new BeatmapSearchFilterRow<SearchLanguage>(@"Language"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -113,7 +112,7 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
categoryFilter.Current.Value = BeatmapSearchCategory.Leaderboard;
|
categoryFilter.Current.Value = SearchCategory.Leaderboard;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
|
26
osu.Game/Overlays/BeatmapListing/SearchCategory.cs
Normal file
26
osu.Game/Overlays/BeatmapListing/SearchCategory.cs
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System.ComponentModel;
|
||||||
|
|
||||||
|
namespace osu.Game.Overlays.BeatmapListing
|
||||||
|
{
|
||||||
|
public enum SearchCategory
|
||||||
|
{
|
||||||
|
Any,
|
||||||
|
|
||||||
|
[Description("Has Leaderboard")]
|
||||||
|
Leaderboard,
|
||||||
|
Ranked,
|
||||||
|
Qualified,
|
||||||
|
Loved,
|
||||||
|
Favourites,
|
||||||
|
|
||||||
|
[Description("Pending & WIP")]
|
||||||
|
Pending,
|
||||||
|
Graveyard,
|
||||||
|
|
||||||
|
[Description("My Maps")]
|
||||||
|
Mine,
|
||||||
|
}
|
||||||
|
}
|
25
osu.Game/Overlays/BeatmapListing/SearchGenre.cs
Normal file
25
osu.Game/Overlays/BeatmapListing/SearchGenre.cs
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System.ComponentModel;
|
||||||
|
|
||||||
|
namespace osu.Game.Overlays.BeatmapListing
|
||||||
|
{
|
||||||
|
public enum SearchGenre
|
||||||
|
{
|
||||||
|
Any = 0,
|
||||||
|
Unspecified = 1,
|
||||||
|
|
||||||
|
[Description("Video Game")]
|
||||||
|
VideoGame = 2,
|
||||||
|
Anime = 3,
|
||||||
|
Rock = 4,
|
||||||
|
Pop = 5,
|
||||||
|
Other = 6,
|
||||||
|
Novelty = 7,
|
||||||
|
|
||||||
|
[Description("Hip Hop")]
|
||||||
|
HipHop = 9,
|
||||||
|
Electronic = 10
|
||||||
|
}
|
||||||
|
}
|
47
osu.Game/Overlays/BeatmapListing/SearchLanguage.cs
Normal file
47
osu.Game/Overlays/BeatmapListing/SearchLanguage.cs
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using osu.Game.Utils;
|
||||||
|
|
||||||
|
namespace osu.Game.Overlays.BeatmapListing
|
||||||
|
{
|
||||||
|
[HasOrderedElements]
|
||||||
|
public enum SearchLanguage
|
||||||
|
{
|
||||||
|
[Order(0)]
|
||||||
|
Any,
|
||||||
|
|
||||||
|
[Order(11)]
|
||||||
|
Other,
|
||||||
|
|
||||||
|
[Order(1)]
|
||||||
|
English,
|
||||||
|
|
||||||
|
[Order(6)]
|
||||||
|
Japanese,
|
||||||
|
|
||||||
|
[Order(2)]
|
||||||
|
Chinese,
|
||||||
|
|
||||||
|
[Order(10)]
|
||||||
|
Instrumental,
|
||||||
|
|
||||||
|
[Order(7)]
|
||||||
|
Korean,
|
||||||
|
|
||||||
|
[Order(3)]
|
||||||
|
French,
|
||||||
|
|
||||||
|
[Order(4)]
|
||||||
|
German,
|
||||||
|
|
||||||
|
[Order(9)]
|
||||||
|
Swedish,
|
||||||
|
|
||||||
|
[Order(8)]
|
||||||
|
Spanish,
|
||||||
|
|
||||||
|
[Order(5)]
|
||||||
|
Italian
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user