1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:07:52 +08:00

Merge remote-tracking branch 'upstream/master' into fix-video-fill-mode

This commit is contained in:
Dean Herbert 2019-09-16 00:19:30 +09:00
commit e1de0b0537
4 changed files with 23 additions and 16 deletions

View File

@ -61,10 +61,17 @@ namespace osu.Game.Tests.Visual.Online
FullName = "Belarus"
};
var unknownCountry = new Country
{
FlagName = "CK",
FullName = "Cook Islands"
};
AddStep("Set country", () => countryBindable.Value = country);
AddAssert("Check scope is Performance", () => scope.Value == RankingsScope.Performance);
AddStep("Set scope to Score", () => scope.Value = RankingsScope.Score);
AddAssert("Check country is Null", () => countryBindable.Value == null);
AddStep("Set country with no flag", () => countryBindable.Value = unknownCountry);
}
}
}

View File

@ -83,11 +83,19 @@ namespace osu.Game.Graphics
const int frames_to_wait = 3;
int framesWaited = 0;
ScheduledDelegate waitDelegate = host.DrawThread.Scheduler.AddDelayed(() => framesWaited++, 0, true);
while (framesWaited < frames_to_wait)
Thread.Sleep(10);
waitDelegate.Cancel();
using (var framesWaitedEvent = new ManualResetEventSlim(false))
{
ScheduledDelegate waitDelegate = host.DrawThread.Scheduler.AddDelayed(() =>
{
if (framesWaited++ < frames_to_wait)
// ReSharper disable once AccessToDisposedClosure
framesWaitedEvent.Set();
}, 10, true);
framesWaitedEvent.Wait();
waitDelegate.Cancel();
}
}
using (var image = await host.TakeScreenshotAsync())

View File

@ -18,7 +18,6 @@ namespace osu.Game.Overlays.Rankings
public class RankingsHeader : CompositeDrawable
{
private const int content_height = 250;
private const int dropdown_height = 50;
public IEnumerable<Spotlight> Spotlights
{
@ -31,7 +30,6 @@ namespace osu.Game.Overlays.Rankings
public readonly Bindable<Country> Country = new Bindable<Country>();
public readonly Bindable<Spotlight> Spotlight = new Bindable<Spotlight>();
private readonly Container dropdownPlaceholder;
private readonly OsuDropdown<Spotlight> dropdown;
public RankingsHeader()
@ -86,19 +84,13 @@ namespace osu.Game.Overlays.Rankings
Scope = { BindTarget = Scope },
Country = { BindTarget = Country },
},
dropdownPlaceholder = new Container
dropdown = new OsuDropdown<Spotlight>
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
RelativeSizeAxes = Axes.X,
Height = dropdown_height,
Width = 0.8f,
AlwaysPresent = true,
Child = dropdown = new OsuDropdown<Spotlight>
{
RelativeSizeAxes = Axes.X,
Current = Spotlight,
}
Current = Spotlight,
}
}
},
@ -115,7 +107,7 @@ namespace osu.Game.Overlays.Rankings
}
private void onScopeChanged(ValueChangedEvent<RankingsScope> scope) =>
dropdownPlaceholder.FadeTo(scope.NewValue == RankingsScope.Spotlights ? 1 : 0, 200, Easing.OutQuint);
dropdown.FadeTo(scope.NewValue == RankingsScope.Spotlights ? 1 : 0, 200, Easing.OutQuint);
private class HeaderBackground : Sprite
{

View File

@ -26,7 +26,7 @@ namespace osu.Game.Users.Drawables
if (ts == null)
throw new ArgumentNullException(nameof(ts));
Texture = ts.Get($@"Flags/{country?.FlagName ?? @"__"}");
Texture = ts.Get($@"Flags/{country?.FlagName ?? @"__"}") ?? ts.Get(@"Flags/__");
}
}
}