mirror of
https://github.com/ppy/osu.git
synced 2025-03-22 22:17:46 +08:00
Merge pull request #18431 from Joehuu/fix-scores-container-visibility
Fix beatmap info scores container not hiding when there's no leaderboard
This commit is contained in:
commit
198afb6aa7
@ -13,6 +13,7 @@ using System.Linq;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Beatmaps.Drawables;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Overlays.BeatmapSet.Scores;
|
||||
using APIUser = osu.Game.Online.API.Requests.Responses.APIUser;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Online
|
||||
@ -105,10 +106,12 @@ namespace osu.Game.Tests.Visual.Online
|
||||
downloadAssert(true);
|
||||
|
||||
AddAssert("status is loved", () => overlay.ChildrenOfType<BeatmapSetOnlineStatusPill>().Single().Status == BeatmapOnlineStatus.Loved);
|
||||
AddAssert("scores container is visible", () => overlay.ChildrenOfType<ScoresContainer>().Single().Alpha == 1);
|
||||
|
||||
AddStep("go to second beatmap", () => overlay.ChildrenOfType<BeatmapPicker.DifficultySelectorButton>().ElementAt(1).TriggerClick());
|
||||
|
||||
AddAssert("status is graveyard", () => overlay.ChildrenOfType<BeatmapSetOnlineStatusPill>().Single().Status == BeatmapOnlineStatus.Graveyard);
|
||||
AddAssert("scores container is hidden", () => overlay.ChildrenOfType<ScoresContainer>().Single().Alpha == 0);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -253,7 +253,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
|
||||
noScoresPlaceholder.Hide();
|
||||
|
||||
if (Beatmap.Value == null || Beatmap.Value.OnlineID <= 0 || (Beatmap.Value.BeatmapSet as IBeatmapSetOnlineInfo)?.Status <= BeatmapOnlineStatus.Pending)
|
||||
if (Beatmap.Value == null || Beatmap.Value.OnlineID <= 0 || (Beatmap.Value.Status <= BeatmapOnlineStatus.Pending))
|
||||
{
|
||||
Scores = null;
|
||||
Hide();
|
||||
|
@ -35,6 +35,7 @@ namespace osu.Game.Tests.Beatmaps
|
||||
BeatmapInfo.Length = 75000;
|
||||
BeatmapInfo.OnlineInfo = new APIBeatmap();
|
||||
BeatmapInfo.OnlineID = Interlocked.Increment(ref onlineBeatmapID);
|
||||
BeatmapInfo.Status = BeatmapOnlineStatus.Ranked;
|
||||
|
||||
Debug.Assert(BeatmapInfo.BeatmapSet != null);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user