mirror of
https://github.com/osukey/osukey.git
synced 2025-08-08 00:53:56 +09:00
Merge pull request #7817 from EVAST9919/ingame-rankings
Make RankingsOverlay available in-game
This commit is contained in:
@ -598,6 +598,7 @@ namespace osu.Game
|
|||||||
//overlay elements
|
//overlay elements
|
||||||
loadComponentSingleFile(direct = new DirectOverlay(), overlayContent.Add, true);
|
loadComponentSingleFile(direct = new DirectOverlay(), overlayContent.Add, true);
|
||||||
loadComponentSingleFile(social = new SocialOverlay(), 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(channelManager = new ChannelManager(), AddInternal, true);
|
||||||
loadComponentSingleFile(chatOverlay = new ChatOverlay(), overlayContent.Add, true);
|
loadComponentSingleFile(chatOverlay = new ChatOverlay(), overlayContent.Add, true);
|
||||||
loadComponentSingleFile(Settings = new SettingsOverlay { GetToolbarHeight = () => ToolbarOffset }, leftFloatingOverlayContent.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.
|
// 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)
|
foreach (var overlay in singleDisplayOverlays)
|
||||||
{
|
{
|
||||||
|
@ -27,6 +27,8 @@ namespace osu.Game.Overlays.Rankings
|
|||||||
|
|
||||||
protected override Drawable CreateContent() => countryFilter = new CountryFilter();
|
protected override Drawable CreateContent() => countryFilter = new CountryFilter();
|
||||||
|
|
||||||
|
protected override Drawable CreateBackground() => new OverlayHeaderBackground(@"Headers/rankings");
|
||||||
|
|
||||||
private class RankingsTitle : ScreenTitle
|
private class RankingsTitle : ScreenTitle
|
||||||
{
|
{
|
||||||
public readonly Bindable<RankingsScope> Scope = new Bindable<RankingsScope>();
|
public readonly Bindable<RankingsScope> Scope = new Bindable<RankingsScope>();
|
||||||
|
@ -23,8 +23,6 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
protected Bindable<RankingsScope> Scope => header.Current;
|
protected Bindable<RankingsScope> Scope => header.Current;
|
||||||
|
|
||||||
private Bindable<RulesetInfo> ruleset => header.Ruleset;
|
|
||||||
|
|
||||||
private readonly BasicScrollContainer scrollFlow;
|
private readonly BasicScrollContainer scrollFlow;
|
||||||
private readonly Container contentContainer;
|
private readonly Container contentContainer;
|
||||||
private readonly DimmedLoadingLayer loading;
|
private readonly DimmedLoadingLayer loading;
|
||||||
@ -92,10 +90,15 @@ namespace osu.Game.Overlays
|
|||||||
background.Colour = ColourProvider.Background5;
|
background.Colour = ColourProvider.Background5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private Bindable<RulesetInfo> ruleset { get; set; }
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
|
header.Ruleset.BindTo(ruleset);
|
||||||
|
|
||||||
Country.BindValueChanged(_ =>
|
Country.BindValueChanged(_ =>
|
||||||
{
|
{
|
||||||
// if a country is requested, force performance scope.
|
// if a country is requested, force performance scope.
|
||||||
@ -121,6 +124,8 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
Scheduler.AddOnce(loadNewContent);
|
Scheduler.AddOnce(loadNewContent);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Scheduler.AddOnce(loadNewContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ShowCountry(Country requested)
|
public void ShowCountry(Country requested)
|
||||||
|
@ -70,6 +70,7 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new ToolbarChangelogButton(),
|
new ToolbarChangelogButton(),
|
||||||
|
new ToolbarRankingsButton(),
|
||||||
new ToolbarDirectButton(),
|
new ToolbarDirectButton(),
|
||||||
new ToolbarChatButton(),
|
new ToolbarChatButton(),
|
||||||
new ToolbarSocialButton(),
|
new ToolbarSocialButton(),
|
||||||
|
22
osu.Game/Overlays/Toolbar/ToolbarRankingsButton.cs
Normal file
22
osu.Game/Overlays/Toolbar/ToolbarRankingsButton.cs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user