mirror of
https://github.com/ppy/osu
synced 2025-03-19 09:34:49 +00:00
Merge remote-tracking branch 'upstream/master' into fix-video-fill-mode
This commit is contained in:
commit
e1de0b0537
@ -61,10 +61,17 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
FullName = "Belarus"
|
FullName = "Belarus"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var unknownCountry = new Country
|
||||||
|
{
|
||||||
|
FlagName = "CK",
|
||||||
|
FullName = "Cook Islands"
|
||||||
|
};
|
||||||
|
|
||||||
AddStep("Set country", () => countryBindable.Value = country);
|
AddStep("Set country", () => countryBindable.Value = country);
|
||||||
AddAssert("Check scope is Performance", () => scope.Value == RankingsScope.Performance);
|
AddAssert("Check scope is Performance", () => scope.Value == RankingsScope.Performance);
|
||||||
AddStep("Set scope to Score", () => scope.Value = RankingsScope.Score);
|
AddStep("Set scope to Score", () => scope.Value = RankingsScope.Score);
|
||||||
AddAssert("Check country is Null", () => countryBindable.Value == null);
|
AddAssert("Check country is Null", () => countryBindable.Value == null);
|
||||||
|
AddStep("Set country with no flag", () => countryBindable.Value = unknownCountry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -83,12 +83,20 @@ namespace osu.Game.Graphics
|
|||||||
const int frames_to_wait = 3;
|
const int frames_to_wait = 3;
|
||||||
|
|
||||||
int framesWaited = 0;
|
int framesWaited = 0;
|
||||||
ScheduledDelegate waitDelegate = host.DrawThread.Scheduler.AddDelayed(() => framesWaited++, 0, true);
|
|
||||||
while (framesWaited < frames_to_wait)
|
|
||||||
Thread.Sleep(10);
|
|
||||||
|
|
||||||
|
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();
|
waitDelegate.Cancel();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
using (var image = await host.TakeScreenshotAsync())
|
using (var image = await host.TakeScreenshotAsync())
|
||||||
{
|
{
|
||||||
|
@ -18,7 +18,6 @@ namespace osu.Game.Overlays.Rankings
|
|||||||
public class RankingsHeader : CompositeDrawable
|
public class RankingsHeader : CompositeDrawable
|
||||||
{
|
{
|
||||||
private const int content_height = 250;
|
private const int content_height = 250;
|
||||||
private const int dropdown_height = 50;
|
|
||||||
|
|
||||||
public IEnumerable<Spotlight> Spotlights
|
public IEnumerable<Spotlight> Spotlights
|
||||||
{
|
{
|
||||||
@ -31,7 +30,6 @@ namespace osu.Game.Overlays.Rankings
|
|||||||
public readonly Bindable<Country> Country = new Bindable<Country>();
|
public readonly Bindable<Country> Country = new Bindable<Country>();
|
||||||
public readonly Bindable<Spotlight> Spotlight = new Bindable<Spotlight>();
|
public readonly Bindable<Spotlight> Spotlight = new Bindable<Spotlight>();
|
||||||
|
|
||||||
private readonly Container dropdownPlaceholder;
|
|
||||||
private readonly OsuDropdown<Spotlight> dropdown;
|
private readonly OsuDropdown<Spotlight> dropdown;
|
||||||
|
|
||||||
public RankingsHeader()
|
public RankingsHeader()
|
||||||
@ -86,21 +84,15 @@ namespace osu.Game.Overlays.Rankings
|
|||||||
Scope = { BindTarget = Scope },
|
Scope = { BindTarget = Scope },
|
||||||
Country = { BindTarget = Country },
|
Country = { BindTarget = Country },
|
||||||
},
|
},
|
||||||
dropdownPlaceholder = new Container
|
dropdown = new OsuDropdown<Spotlight>
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Height = dropdown_height,
|
|
||||||
Width = 0.8f,
|
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) =>
|
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
|
private class HeaderBackground : Sprite
|
||||||
{
|
{
|
||||||
|
@ -26,7 +26,7 @@ namespace osu.Game.Users.Drawables
|
|||||||
if (ts == null)
|
if (ts == null)
|
||||||
throw new ArgumentNullException(nameof(ts));
|
throw new ArgumentNullException(nameof(ts));
|
||||||
|
|
||||||
Texture = ts.Get($@"Flags/{country?.FlagName ?? @"__"}");
|
Texture = ts.Get($@"Flags/{country?.FlagName ?? @"__"}") ?? ts.Get(@"Flags/__");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user