Merge pull request #7955 from Game4all/chart-button-rankings

Open Rankings when clicking on charts button
This commit is contained in:
Dan Balasescu 2020-02-26 09:30:55 +09:00 committed by GitHub
commit 8bdeac248c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 28 deletions

View File

@ -138,6 +138,12 @@ namespace osu.Game.Overlays
Country.Value = requested;
}
public void ShowSpotlights()
{
Scope.Value = RankingsScope.Spotlights;
Show();
}
private void loadNewContent()
{
loading.Show();

View File

@ -1,9 +0,0 @@
// 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.
namespace osu.Game.Screens.Charts
{
public class ChartInfo : ScreenWhiteBox
{
}
}

View File

@ -1,16 +0,0 @@
// 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 System;
using System.Collections.Generic;
namespace osu.Game.Screens.Charts
{
public class ChartListing : ScreenWhiteBox
{
protected override IEnumerable<Type> PossibleChildren => new[]
{
typeof(ChartInfo)
};
}
}

View File

@ -18,7 +18,6 @@ using osu.Game.Online.API;
using osu.Game.Overlays;
using osu.Game.Overlays.Dialog;
using osu.Game.Screens.Backgrounds;
using osu.Game.Screens.Charts;
using osu.Game.Screens.Edit;
using osu.Game.Screens.Multi;
using osu.Game.Screens.Select;
@ -73,7 +72,7 @@ namespace osu.Game.Screens.Menu
private SongTicker songTicker;
[BackgroundDependencyLoader(true)]
private void load(DirectOverlay direct, SettingsOverlay settings, OsuConfigManager config, SessionStatics statics)
private void load(DirectOverlay direct, SettingsOverlay settings, RankingsOverlay rankings, OsuConfigManager config, SessionStatics statics)
{
holdDelay = config.GetBindable<float>(OsuSetting.UIHoldActivationDelay);
loginDisplayed = statics.GetBindable<bool>(Static.LoginOverlayDisplayed);
@ -101,7 +100,6 @@ namespace osu.Game.Screens.Menu
{
buttons = new ButtonSystem
{
OnChart = delegate { this.Push(new ChartListing()); },
OnEdit = delegate { this.Push(new Editor()); },
OnSolo = onSolo,
OnMulti = delegate { this.Push(new Multiplayer()); },
@ -136,6 +134,7 @@ namespace osu.Game.Screens.Menu
buttons.OnSettings = () => settings?.ToggleVisibility();
buttons.OnDirect = () => direct?.ToggleVisibility();
buttons.OnChart = () => rankings?.ShowSpotlights();
LoadComponentAsync(background = new BackgroundScreenDefault());
preloadSongSelect();