mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 10:18:22 +08:00
Rename BeatmapSetOnlineStatus
to BeatmapOnlineStatus
This variable is used at more than just a set level.
This commit is contained in:
parent
5ff62a8e04
commit
183b95cbc2
@ -596,7 +596,7 @@ namespace osu.Game.Tests.Beatmaps.IO
|
||||
{
|
||||
OnlineID = 2,
|
||||
Metadata = metadata,
|
||||
Status = BeatmapSetOnlineStatus.Loved,
|
||||
Status = BeatmapOnlineStatus.Loved,
|
||||
BaseDifficulty = difficulty
|
||||
}
|
||||
}
|
||||
|
@ -550,7 +550,7 @@ namespace osu.Game.Tests.Database
|
||||
new RealmBeatmap(ruleset, new RealmBeatmapDifficulty(), metadata)
|
||||
{
|
||||
OnlineID = 2,
|
||||
Status = BeatmapSetOnlineStatus.Loved,
|
||||
Status = BeatmapOnlineStatus.Loved,
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -38,7 +38,7 @@ namespace osu.Game.Tests.NonVisual.Filtering
|
||||
Length = 2500,
|
||||
BPM = 160,
|
||||
BeatDivisor = 12,
|
||||
Status = BeatmapSetOnlineStatus.Loved
|
||||
Status = BeatmapOnlineStatus.Loved
|
||||
};
|
||||
|
||||
[Test]
|
||||
|
@ -162,9 +162,9 @@ namespace osu.Game.Tests.NonVisual.Filtering
|
||||
FilterQueryParser.ApplyQueries(filterCriteria, query);
|
||||
Assert.AreEqual("I want the pp", filterCriteria.SearchText.Trim());
|
||||
Assert.AreEqual(4, filterCriteria.SearchTerms.Length);
|
||||
Assert.AreEqual(BeatmapSetOnlineStatus.Ranked, filterCriteria.OnlineStatus.Min);
|
||||
Assert.AreEqual(BeatmapOnlineStatus.Ranked, filterCriteria.OnlineStatus.Min);
|
||||
Assert.IsTrue(filterCriteria.OnlineStatus.IsLowerInclusive);
|
||||
Assert.AreEqual(BeatmapSetOnlineStatus.Ranked, filterCriteria.OnlineStatus.Max);
|
||||
Assert.AreEqual(BeatmapOnlineStatus.Ranked, filterCriteria.OnlineStatus.Max);
|
||||
Assert.IsTrue(filterCriteria.OnlineStatus.IsUpperInclusive);
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ namespace osu.Game.Tests.Visual.Beatmaps
|
||||
|
||||
var withStatistics = CreateAPIBeatmapSet(Ruleset.Value);
|
||||
withStatistics.Title = withStatistics.TitleUnicode = "play favourite stats";
|
||||
withStatistics.Status = BeatmapSetOnlineStatus.Approved;
|
||||
withStatistics.Status = BeatmapOnlineStatus.Approved;
|
||||
withStatistics.FavouriteCount = 284_239;
|
||||
withStatistics.PlayCount = 999_001;
|
||||
withStatistics.Ranked = DateTimeOffset.Now.AddDays(-45);
|
||||
@ -63,7 +63,7 @@ namespace osu.Game.Tests.Visual.Beatmaps
|
||||
var someDifficulties = getManyDifficultiesBeatmapSet(11);
|
||||
someDifficulties.Title = someDifficulties.TitleUnicode = "favourited";
|
||||
someDifficulties.Title = someDifficulties.TitleUnicode = "some difficulties";
|
||||
someDifficulties.Status = BeatmapSetOnlineStatus.Qualified;
|
||||
someDifficulties.Status = BeatmapOnlineStatus.Qualified;
|
||||
someDifficulties.HasFavourited = true;
|
||||
someDifficulties.FavouriteCount = 1;
|
||||
someDifficulties.NominationStatus = new BeatmapSetNominationStatus
|
||||
@ -73,7 +73,7 @@ namespace osu.Game.Tests.Visual.Beatmaps
|
||||
};
|
||||
|
||||
var manyDifficulties = getManyDifficultiesBeatmapSet(100);
|
||||
manyDifficulties.Status = BeatmapSetOnlineStatus.Pending;
|
||||
manyDifficulties.Status = BeatmapOnlineStatus.Pending;
|
||||
|
||||
var explicitMap = CreateAPIBeatmapSet(Ruleset.Value);
|
||||
explicitMap.Title = someDifficulties.TitleUnicode = "explicit beatmap";
|
||||
|
@ -26,7 +26,7 @@ namespace osu.Game.Tests.Visual.Beatmaps
|
||||
Origin = Anchor.Centre,
|
||||
Direction = FillDirection.Vertical,
|
||||
Spacing = new Vector2(0, 10),
|
||||
ChildrenEnumerable = Enum.GetValues(typeof(BeatmapSetOnlineStatus)).Cast<BeatmapSetOnlineStatus>().Select(status => new BeatmapSetOnlineStatusPill
|
||||
ChildrenEnumerable = Enum.GetValues(typeof(BeatmapOnlineStatus)).Cast<BeatmapOnlineStatus>().Select(status => new BeatmapSetOnlineStatusPill
|
||||
{
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Anchor = Anchor.Centre,
|
||||
|
@ -57,7 +57,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
}
|
||||
},
|
||||
Ratings = Enumerable.Range(0, 11).Select(_ => RNG.Next(10)).ToArray(),
|
||||
Status = BeatmapSetOnlineStatus.Ranked
|
||||
Status = BeatmapOnlineStatus.Ranked
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -338,7 +338,7 @@ namespace osu.Game.Tests.Visual.Ranking
|
||||
: base(score, true)
|
||||
{
|
||||
Score.BeatmapInfo.OnlineID = 0;
|
||||
Score.BeatmapInfo.Status = BeatmapSetOnlineStatus.Pending;
|
||||
Score.BeatmapInfo.Status = BeatmapOnlineStatus.Pending;
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
|
@ -220,7 +220,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
Title = "Verrrrry long Title"
|
||||
},
|
||||
DifficultyName = "Verrrrrrrrrrrrrrrrrrrrrrrrrrrrry long Version",
|
||||
Status = BeatmapSetOnlineStatus.Graveyard,
|
||||
Status = BeatmapOnlineStatus.Graveyard,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
@ -121,7 +121,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
[Test]
|
||||
public void TestBeatmapStates()
|
||||
{
|
||||
foreach (BeatmapSetOnlineStatus status in Enum.GetValues(typeof(BeatmapSetOnlineStatus)))
|
||||
foreach (BeatmapOnlineStatus status in Enum.GetValues(typeof(BeatmapOnlineStatus)))
|
||||
AddStep($"{status} beatmap", () => showBeatmapWithStatus(status));
|
||||
}
|
||||
|
||||
@ -384,7 +384,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
};
|
||||
}
|
||||
|
||||
private void showBeatmapWithStatus(BeatmapSetOnlineStatus status)
|
||||
private void showBeatmapWithStatus(BeatmapOnlineStatus status)
|
||||
{
|
||||
leaderboard.BeatmapInfo = new BeatmapInfo
|
||||
{
|
||||
|
@ -25,7 +25,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
|
||||
[Test]
|
||||
public void TestLabelledEnumDropdown()
|
||||
=> AddStep(@"create dropdown", () => Child = new LabelledEnumDropdown<BeatmapSetOnlineStatus>
|
||||
=> AddStep(@"create dropdown", () => Child = new LabelledEnumDropdown<BeatmapOnlineStatus>
|
||||
{
|
||||
Label = @"Beatmap status",
|
||||
Description = @"This is a description"
|
||||
|
@ -10,7 +10,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
public class TestSceneOsuDropdown : ThemeComparisonTestScene
|
||||
{
|
||||
protected override Drawable CreateContent() =>
|
||||
new OsuEnumDropdown<BeatmapSetOnlineStatus>
|
||||
new OsuEnumDropdown<BeatmapOnlineStatus>
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
|
@ -35,7 +35,7 @@ namespace osu.Game.Beatmaps
|
||||
[JsonIgnore]
|
||||
public int BeatmapSetInfoID { get; set; }
|
||||
|
||||
public BeatmapSetOnlineStatus Status { get; set; } = BeatmapSetOnlineStatus.None;
|
||||
public BeatmapOnlineStatus Status { get; set; } = BeatmapOnlineStatus.None;
|
||||
|
||||
[Required]
|
||||
public BeatmapSetInfo BeatmapSet { get; set; }
|
||||
|
@ -83,7 +83,7 @@ namespace osu.Game.Beatmaps
|
||||
if (res != null)
|
||||
{
|
||||
beatmapInfo.Status = res.Status;
|
||||
beatmapInfo.BeatmapSet.Status = res.BeatmapSet?.Status ?? BeatmapSetOnlineStatus.None;
|
||||
beatmapInfo.BeatmapSet.Status = res.BeatmapSet?.Status ?? BeatmapOnlineStatus.None;
|
||||
beatmapInfo.BeatmapSet.OnlineID = res.OnlineBeatmapSetID;
|
||||
beatmapInfo.OnlineID = res.OnlineID;
|
||||
|
||||
@ -182,7 +182,7 @@ namespace osu.Game.Beatmaps
|
||||
{
|
||||
if (reader.Read())
|
||||
{
|
||||
var status = (BeatmapSetOnlineStatus)reader.GetByte(2);
|
||||
var status = (BeatmapOnlineStatus)reader.GetByte(2);
|
||||
|
||||
beatmapInfo.Status = status;
|
||||
beatmapInfo.BeatmapSet.Status = status;
|
||||
|
@ -6,7 +6,7 @@ using osu.Game.Resources.Localisation.Web;
|
||||
|
||||
namespace osu.Game.Beatmaps
|
||||
{
|
||||
public enum BeatmapSetOnlineStatus
|
||||
public enum BeatmapOnlineStatus
|
||||
{
|
||||
None = -3,
|
||||
|
||||
@ -34,7 +34,7 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
public static class BeatmapSetOnlineStatusExtensions
|
||||
{
|
||||
public static bool GrantsPerformancePoints(this BeatmapSetOnlineStatus status)
|
||||
=> status == BeatmapSetOnlineStatus.Ranked || status == BeatmapSetOnlineStatus.Approved;
|
||||
public static bool GrantsPerformancePoints(this BeatmapOnlineStatus status)
|
||||
=> status == BeatmapOnlineStatus.Ranked || status == BeatmapOnlineStatus.Approved;
|
||||
}
|
||||
}
|
@ -34,7 +34,7 @@ namespace osu.Game.Beatmaps
|
||||
[NotNull]
|
||||
public List<BeatmapInfo> Beatmaps { get; } = new List<BeatmapInfo>();
|
||||
|
||||
public BeatmapSetOnlineStatus Status { get; set; } = BeatmapSetOnlineStatus.None;
|
||||
public BeatmapOnlineStatus Status { get; set; } = BeatmapOnlineStatus.None;
|
||||
|
||||
[NotNull]
|
||||
public List<BeatmapSetFileInfo> Files { get; set; } = new List<BeatmapSetFileInfo>();
|
||||
|
@ -18,9 +18,9 @@ namespace osu.Game.Beatmaps.Drawables
|
||||
{
|
||||
public class BeatmapSetOnlineStatusPill : CircularContainer
|
||||
{
|
||||
private BeatmapSetOnlineStatus status;
|
||||
private BeatmapOnlineStatus status;
|
||||
|
||||
public BeatmapSetOnlineStatus Status
|
||||
public BeatmapOnlineStatus Status
|
||||
{
|
||||
get => status;
|
||||
set
|
||||
@ -75,7 +75,7 @@ namespace osu.Game.Beatmaps.Drawables
|
||||
},
|
||||
};
|
||||
|
||||
Status = BeatmapSetOnlineStatus.None;
|
||||
Status = BeatmapOnlineStatus.None;
|
||||
TextPadding = new MarginPadding { Horizontal = 5, Bottom = 1 };
|
||||
}
|
||||
|
||||
@ -87,14 +87,14 @@ namespace osu.Game.Beatmaps.Drawables
|
||||
|
||||
private void updateState()
|
||||
{
|
||||
Alpha = Status == BeatmapSetOnlineStatus.None ? 0 : 1;
|
||||
Alpha = Status == BeatmapOnlineStatus.None ? 0 : 1;
|
||||
|
||||
statusText.Text = Status.GetLocalisableDescription().ToUpper();
|
||||
|
||||
if (colourProvider != null)
|
||||
statusText.Colour = status == BeatmapSetOnlineStatus.Graveyard ? colourProvider.Background1 : colourProvider.Background3;
|
||||
statusText.Colour = status == BeatmapOnlineStatus.Graveyard ? colourProvider.Background1 : colourProvider.Background3;
|
||||
else
|
||||
statusText.Colour = status == BeatmapSetOnlineStatus.Graveyard ? colours.GreySeafoamLight : Color4.Black;
|
||||
statusText.Colour = status == BeatmapOnlineStatus.Graveyard ? colours.GreySeafoamLight : Color4.Black;
|
||||
|
||||
background.Colour = OsuColour.ForBeatmapSetOnlineStatus(Status) ?? colourProvider?.Light1 ?? colours.GreySeafoamLighter;
|
||||
}
|
||||
|
@ -41,10 +41,10 @@ namespace osu.Game.Beatmaps.Drawables.Cards.Statistics
|
||||
// reference: https://github.com/ppy/osu-web/blob/ef432c11719fd1207bec5f9194b04f0033bdf02c/resources/assets/lib/beatmapset-panel.tsx#L36-L44
|
||||
switch (beatmapSetInfo.Status)
|
||||
{
|
||||
case BeatmapSetOnlineStatus.Ranked:
|
||||
case BeatmapSetOnlineStatus.Approved:
|
||||
case BeatmapSetOnlineStatus.Loved:
|
||||
case BeatmapSetOnlineStatus.Qualified:
|
||||
case BeatmapOnlineStatus.Ranked:
|
||||
case BeatmapOnlineStatus.Approved:
|
||||
case BeatmapOnlineStatus.Loved:
|
||||
case BeatmapOnlineStatus.Qualified:
|
||||
return beatmapSetInfo.Ranked;
|
||||
|
||||
default:
|
||||
|
@ -30,7 +30,7 @@ namespace osu.Game.Beatmaps
|
||||
/// <summary>
|
||||
/// The status of this beatmap set.
|
||||
/// </summary>
|
||||
BeatmapSetOnlineStatus Status { get; }
|
||||
BeatmapOnlineStatus Status { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether or not this beatmap set has explicit content.
|
||||
@ -105,7 +105,7 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
/// <summary>
|
||||
/// Contains the current hype status of the beatmap set.
|
||||
/// Non-null only for <see cref="BeatmapSetOnlineStatus.WIP"/>, <see cref="BeatmapSetOnlineStatus.Pending"/>, and <see cref="BeatmapSetOnlineStatus.Qualified"/> sets.
|
||||
/// Non-null only for <see cref="BeatmapOnlineStatus.WIP"/>, <see cref="BeatmapOnlineStatus.Pending"/>, and <see cref="BeatmapOnlineStatus.Qualified"/> sets.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See: https://github.com/ppy/osu-web/blob/93930cd02cfbd49724929912597c727c9fbadcd1/app/Models/Beatmapset.php#L155
|
||||
|
@ -122,34 +122,34 @@ namespace osu.Game.Graphics
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves a colour for the given <see cref="BeatmapSetOnlineStatus"/>.
|
||||
/// Retrieves a colour for the given <see cref="BeatmapOnlineStatus"/>.
|
||||
/// A <see langword="null"/> value indicates that a "background" shade from the local <see cref="OverlayColourProvider"/>
|
||||
/// (or another fallback colour) should be used.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Sourced from web: https://github.com/ppy/osu-web/blob/007eebb1916ed5cb6a7866d82d8011b1060a945e/resources/assets/less/layout.less#L36-L50
|
||||
/// </remarks>
|
||||
public static Color4? ForBeatmapSetOnlineStatus(BeatmapSetOnlineStatus status)
|
||||
public static Color4? ForBeatmapSetOnlineStatus(BeatmapOnlineStatus status)
|
||||
{
|
||||
switch (status)
|
||||
{
|
||||
case BeatmapSetOnlineStatus.Ranked:
|
||||
case BeatmapSetOnlineStatus.Approved:
|
||||
case BeatmapOnlineStatus.Ranked:
|
||||
case BeatmapOnlineStatus.Approved:
|
||||
return Color4Extensions.FromHex(@"b3ff66");
|
||||
|
||||
case BeatmapSetOnlineStatus.Loved:
|
||||
case BeatmapOnlineStatus.Loved:
|
||||
return Color4Extensions.FromHex(@"ff66ab");
|
||||
|
||||
case BeatmapSetOnlineStatus.Qualified:
|
||||
case BeatmapOnlineStatus.Qualified:
|
||||
return Color4Extensions.FromHex(@"66ccff");
|
||||
|
||||
case BeatmapSetOnlineStatus.Pending:
|
||||
case BeatmapOnlineStatus.Pending:
|
||||
return Color4Extensions.FromHex(@"ffd966");
|
||||
|
||||
case BeatmapSetOnlineStatus.WIP:
|
||||
case BeatmapOnlineStatus.WIP:
|
||||
return Color4Extensions.FromHex(@"ff9966");
|
||||
|
||||
case BeatmapSetOnlineStatus.Graveyard:
|
||||
case BeatmapOnlineStatus.Graveyard:
|
||||
return Color4.Black;
|
||||
|
||||
default:
|
||||
|
@ -39,9 +39,9 @@ namespace osu.Game.Models
|
||||
[Ignored]
|
||||
public RealmNamedFileUsage? File => BeatmapSet?.Files.First(f => f.File.Hash == Hash);
|
||||
|
||||
public BeatmapSetOnlineStatus Status
|
||||
public BeatmapOnlineStatus Status
|
||||
{
|
||||
get => (BeatmapSetOnlineStatus)StatusInt;
|
||||
get => (BeatmapOnlineStatus)StatusInt;
|
||||
set => StatusInt = (int)value;
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
public int OnlineBeatmapSetID { get; set; }
|
||||
|
||||
[JsonProperty(@"status")]
|
||||
public BeatmapSetOnlineStatus Status { get; set; }
|
||||
public BeatmapOnlineStatus Status { get; set; }
|
||||
|
||||
[JsonProperty("checksum")]
|
||||
public string Checksum { get; set; } = string.Empty;
|
||||
|
@ -21,7 +21,7 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
public int OnlineID { get; set; }
|
||||
|
||||
[JsonProperty(@"status")]
|
||||
public BeatmapSetOnlineStatus Status { get; set; }
|
||||
public BeatmapOnlineStatus Status { get; set; }
|
||||
|
||||
[JsonProperty(@"preview_url")]
|
||||
public string Preview { get; set; } = string.Empty;
|
||||
|
@ -244,7 +244,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
|
||||
noScoresPlaceholder.Hide();
|
||||
|
||||
if (Beatmap.Value == null || Beatmap.Value.OnlineID <= 0 || (Beatmap.Value?.BeatmapSet as IBeatmapSetOnlineInfo)?.Status <= BeatmapSetOnlineStatus.Pending)
|
||||
if (Beatmap.Value == null || Beatmap.Value.OnlineID <= 0 || (Beatmap.Value?.BeatmapSet as IBeatmapSetOnlineInfo)?.Status <= BeatmapOnlineStatus.Pending)
|
||||
{
|
||||
Scores = null;
|
||||
Hide();
|
||||
|
@ -27,7 +27,7 @@ namespace osu.Game.Screens.Ranking
|
||||
|
||||
protected override APIRequest FetchScores(Action<IEnumerable<ScoreInfo>> scoresCallback)
|
||||
{
|
||||
if (Score.BeatmapInfo.OnlineID == null || Score.BeatmapInfo.Status <= BeatmapSetOnlineStatus.Pending)
|
||||
if (Score.BeatmapInfo.OnlineID == null || Score.BeatmapInfo.Status <= BeatmapOnlineStatus.Pending)
|
||||
return null;
|
||||
|
||||
getScoreRequest = new GetScoresRequest(Score.BeatmapInfo, Score.Ruleset);
|
||||
|
@ -28,7 +28,7 @@ namespace osu.Game.Screens.Select
|
||||
public OptionalRange<double> Length;
|
||||
public OptionalRange<double> BPM;
|
||||
public OptionalRange<int> BeatDivisor;
|
||||
public OptionalRange<BeatmapSetOnlineStatus> OnlineStatus;
|
||||
public OptionalRange<BeatmapOnlineStatus> OnlineStatus;
|
||||
public OptionalTextFilter Creator;
|
||||
public OptionalTextFilter Artist;
|
||||
|
||||
|
@ -154,7 +154,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
return null;
|
||||
}
|
||||
|
||||
if (BeatmapInfo.OnlineID == null || BeatmapInfo?.Status <= BeatmapSetOnlineStatus.Pending)
|
||||
if (BeatmapInfo.OnlineID == null || BeatmapInfo?.Status <= BeatmapOnlineStatus.Pending)
|
||||
{
|
||||
PlaceholderState = PlaceholderState.Unavailable;
|
||||
return null;
|
||||
|
@ -226,7 +226,7 @@ namespace osu.Game.Tests.Visual
|
||||
return new APIBeatmapSet
|
||||
{
|
||||
OnlineID = ((IBeatmapSetInfo)beatmap.BeatmapSet).OnlineID,
|
||||
Status = BeatmapSetOnlineStatus.Ranked,
|
||||
Status = BeatmapOnlineStatus.Ranked,
|
||||
Covers = new BeatmapSetOnlineCovers
|
||||
{
|
||||
Cover = "https://assets.ppy.sh/beatmaps/163112/covers/cover.jpg",
|
||||
|
Loading…
Reference in New Issue
Block a user