1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 16:52:54 +08:00

Merge branch 'master' into ignore_beatmap_skin

This commit is contained in:
Dean Herbert 2018-04-25 15:57:39 +09:00 committed by GitHub
commit c517b73375
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 24 additions and 12 deletions

@ -1 +1 @@
Subproject commit 61e676094d25436bb9e8858946f65c43d15d8e01
Subproject commit 0773d895d9aa0729995cd4a23efc28238e35ceed

View File

@ -52,6 +52,9 @@ namespace osu.Game.Tests.Visual
infoWedge.UpdateBeatmap(beatmap);
});
// select part is redundant, but wait for load isn't
selectBeatmap(beatmap.Value.Beatmap);
AddWaitStep(3);
AddStep("hide", () => { infoWedge.State = Visibility.Hidden; });
@ -63,10 +66,11 @@ namespace osu.Game.Tests.Visual
foreach (var rulesetInfo in rulesets.AvailableRulesets)
{
var ruleset = rulesetInfo.CreateInstance();
beatmaps.Add(createTestBeatmap(rulesetInfo));
var testBeatmap = createTestBeatmap(rulesetInfo);
var name = rulesetInfo.ShortName;
selectBeatmap(name);
beatmaps.Add(testBeatmap);
selectBeatmap(testBeatmap);
// TODO: adjust cases once more info is shown for other gamemodes
switch (ruleset)
@ -108,16 +112,14 @@ namespace osu.Game.Tests.Visual
AddAssert("check no infolabels", () => !infoWedge.Info.InfoLabelContainer.Children.Any());
}
private void selectBeatmap(string name)
private void selectBeatmap(Beatmap b)
{
BeatmapInfoWedge.BufferedWedgeInfo infoBefore = null;
AddStep($"select {name} beatmap", () =>
AddStep($"select {b.Metadata.Title} beatmap", () =>
{
infoBefore = infoWedge.Info;
WorkingBeatmap bm = new TestWorkingBeatmap(beatmaps.First(b => b.BeatmapInfo.Ruleset.ShortName == name));
beatmap.Value = bm;
infoWedge.UpdateBeatmap(beatmap);
infoWedge.UpdateBeatmap(beatmap.Value = new TestWorkingBeatmap(b));
});
AddUntilStep(() => infoWedge.Info != infoBefore, "wait for async load");

View File

@ -307,6 +307,8 @@ namespace osu.Game.Overlays.Chat
{
public override bool IsRemovable => false;
public override bool IsSwitchable => false;
public ChannelSelectorTabItem(Channel value) : base(value)
{
Depth = float.MaxValue;

View File

@ -27,6 +27,11 @@ namespace osu.Game.Screens.Select.Carousel
get
{
var drawables = base.Drawables;
// if we are explicitly not present, don't ever present children.
// without this check, children drawables can potentially be presented without their group header.
if (DrawableRepresentation.Value?.IsPresent == false) return drawables;
foreach (var c in InternalChildren)
drawables.AddRange(c.Drawables);
return drawables;

View File

@ -24,7 +24,7 @@ namespace osu.Game.Screens.Select.Carousel
{
var items = new List<DrawableCarouselItem>();
var self = drawableRepresentation.Value;
var self = DrawableRepresentation.Value;
if (self?.IsPresent == true) items.Add(self);
return items;
@ -35,7 +35,7 @@ namespace osu.Game.Screens.Select.Carousel
protected CarouselItem()
{
drawableRepresentation = new Lazy<DrawableCarouselItem>(CreateDrawableRepresentation);
DrawableRepresentation = new Lazy<DrawableCarouselItem>(CreateDrawableRepresentation);
Filtered.ValueChanged += v =>
{
@ -44,13 +44,16 @@ namespace osu.Game.Screens.Select.Carousel
};
}
private readonly Lazy<DrawableCarouselItem> drawableRepresentation;
protected readonly Lazy<DrawableCarouselItem> DrawableRepresentation;
/// <summary>
/// Used as a default sort method for <see cref="CarouselItem"/>s of differing types.
/// </summary>
internal ulong ChildID;
/// <summary>
/// Create a fresh drawable version of this item. If you wish to consume the current representation, use <see cref="DrawableRepresentation"/> instead.
/// </summary>
protected abstract DrawableCarouselItem CreateDrawableRepresentation();
public virtual void Filter(FilterCriteria criteria)