diff --git a/osu.Android.props b/osu.Android.props index 1774ea0bb4..939d179b1d 100644 --- a/osu.Android.props +++ b/osu.Android.props @@ -54,6 +54,6 @@ - + diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 100730d40d..a73d5b57c4 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -598,6 +598,7 @@ namespace osu.Game //overlay elements loadComponentSingleFile(direct = new DirectOverlay(), overlayContent.Add, true); loadComponentSingleFile(social = new SocialOverlay(), overlayContent.Add, true); + var rankingsOverlay = loadComponentSingleFile(new RankingsOverlay(), overlayContent.Add, true); loadComponentSingleFile(channelManager = new ChannelManager(), AddInternal, true); loadComponentSingleFile(chatOverlay = new ChatOverlay(), overlayContent.Add, true); loadComponentSingleFile(Settings = new SettingsOverlay { GetToolbarHeight = () => ToolbarOffset }, leftFloatingOverlayContent.Add, true); @@ -654,7 +655,7 @@ namespace osu.Game } // ensure only one of these overlays are open at once. - var singleDisplayOverlays = new OverlayContainer[] { chatOverlay, social, direct, changelogOverlay }; + var singleDisplayOverlays = new OverlayContainer[] { chatOverlay, social, direct, changelogOverlay, rankingsOverlay }; foreach (var overlay in singleDisplayOverlays) { diff --git a/osu.Game/Overlays/Rankings/RankingsOverlayHeader.cs b/osu.Game/Overlays/Rankings/RankingsOverlayHeader.cs index a89360bd3c..99325aa1da 100644 --- a/osu.Game/Overlays/Rankings/RankingsOverlayHeader.cs +++ b/osu.Game/Overlays/Rankings/RankingsOverlayHeader.cs @@ -27,6 +27,8 @@ namespace osu.Game.Overlays.Rankings protected override Drawable CreateContent() => countryFilter = new CountryFilter(); + protected override Drawable CreateBackground() => new OverlayHeaderBackground(@"Headers/rankings"); + private class RankingsTitle : ScreenTitle { public readonly Bindable Scope = new Bindable(); diff --git a/osu.Game/Overlays/RankingsOverlay.cs b/osu.Game/Overlays/RankingsOverlay.cs index b372511bd2..3304c6ebec 100644 --- a/osu.Game/Overlays/RankingsOverlay.cs +++ b/osu.Game/Overlays/RankingsOverlay.cs @@ -23,8 +23,6 @@ namespace osu.Game.Overlays protected Bindable Scope => header.Current; - private Bindable ruleset => header.Ruleset; - private readonly BasicScrollContainer scrollFlow; private readonly Container contentContainer; private readonly LoadingLayer loading; @@ -92,10 +90,15 @@ namespace osu.Game.Overlays background.Colour = ColourProvider.Background5; } + [Resolved] + private Bindable ruleset { get; set; } + protected override void LoadComplete() { base.LoadComplete(); + header.Ruleset.BindTo(ruleset); + Country.BindValueChanged(_ => { // if a country is requested, force performance scope. @@ -121,6 +124,8 @@ namespace osu.Game.Overlays Scheduler.AddOnce(loadNewContent); }); + + Scheduler.AddOnce(loadNewContent); } public void ShowCountry(Country requested) diff --git a/osu.Game/Overlays/Toolbar/Toolbar.cs b/osu.Game/Overlays/Toolbar/Toolbar.cs index b044bc4de0..897587d198 100644 --- a/osu.Game/Overlays/Toolbar/Toolbar.cs +++ b/osu.Game/Overlays/Toolbar/Toolbar.cs @@ -70,6 +70,7 @@ namespace osu.Game.Overlays.Toolbar Children = new Drawable[] { new ToolbarChangelogButton(), + new ToolbarRankingsButton(), new ToolbarDirectButton(), new ToolbarChatButton(), new ToolbarSocialButton(), diff --git a/osu.Game/Overlays/Toolbar/ToolbarRankingsButton.cs b/osu.Game/Overlays/Toolbar/ToolbarRankingsButton.cs new file mode 100644 index 0000000000..cbd097696d --- /dev/null +++ b/osu.Game/Overlays/Toolbar/ToolbarRankingsButton.cs @@ -0,0 +1,22 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Allocation; +using osu.Framework.Graphics.Sprites; + +namespace osu.Game.Overlays.Toolbar +{ + public class ToolbarRankingsButton : ToolbarOverlayToggleButton + { + public ToolbarRankingsButton() + { + SetIcon(FontAwesome.Regular.ChartBar); + } + + [BackgroundDependencyLoader(true)] + private void load(RankingsOverlay rankings) + { + StateContainer = rankings; + } + } +} diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index c034fb6567..24ee25c4de 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -23,7 +23,7 @@ - + diff --git a/osu.iOS.props b/osu.iOS.props index 7f99338c6e..3743138c1a 100644 --- a/osu.iOS.props +++ b/osu.iOS.props @@ -74,7 +74,7 @@ - + @@ -82,7 +82,7 @@ - +