Merge remote-tracking branch 'peppy/modular-results-screen' into timeshift-wip

# Conflicts:
#	osu.Game/Screens/Multi/IMultiplayerScreen.cs
#	osu.Game/Screens/Play/Player.cs
#	osu.Game/Screens/Play/SoloResults.cs
#	osu.Game/Screens/Ranking/IResultPageInfo.cs
#	osu.Game/Screens/Ranking/ResultMode.cs
#	osu.Game/Screens/Ranking/ResultModeButton.cs
#	osu.Game/Screens/Ranking/ResultModeTabControl.cs
#	osu.Game/Screens/Ranking/Results.cs
This commit is contained in:
smoogipoo
2018-12-22 16:22:02 +09:00
13 changed files with 200 additions and 206 deletions

View File

@ -28,7 +28,6 @@ using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.UI;
using osu.Game.Scoring;
using osu.Game.Screens.Ranking;
using osu.Game.Skinning;
using osu.Game.Storyboards.Drawables;
@ -288,7 +287,7 @@ namespace osu.Game.Screens.Play
if (RulesetContainer.Replay == null)
scoreManager.Import(score, true);
Push(CreateResults(score));
Push(new SoloResults(score));
onCompletionEvent = null;
});
@ -432,7 +431,5 @@ namespace osu.Game.Screens.Play
if (storyboardVisible && beatmap.Storyboard.ReplacesBackground)
Background?.FadeTo(0, BACKGROUND_FADE_DURATION, Easing.OutQuint);
}
protected virtual Results CreateResults(ScoreInfo score) => new SoloResults(score);
}
}

View File

@ -15,10 +15,10 @@ namespace osu.Game.Screens.Play
{
}
protected override IEnumerable<IResultType> CreateResultTypes() => new IResultType[]
protected override IEnumerable<IResultPageInfo> CreateResultPages() => new IResultPageInfo[]
{
new ScoreResultType(Score, Beatmap),
new RankingResultType(Score, Beatmap)
new ScoreOverviewPageInfo(Score, Beatmap),
new BeatmapLeaderboardPageInfo(Score, Beatmap)
};
}
}

View File

@ -0,0 +1,16 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Graphics;
namespace osu.Game.Screens.Ranking
{
public interface IResultPageInfo
{
FontAwesome Icon { get; }
string Name { get; }
ResultsPage CreatePage();
}
}

View File

@ -14,7 +14,7 @@ using osuTK.Graphics;
namespace osu.Game.Screens.Ranking.Pages
{
public class ResultsPage : Container
public abstract class ResultsPage : Container
{
protected readonly ScoreInfo Score;
protected readonly WorkingBeatmap Beatmap;
@ -23,7 +23,7 @@ namespace osu.Game.Screens.Ranking.Pages
protected override Container<Drawable> Content => content;
public ResultsPage(ScoreInfo score, WorkingBeatmap beatmap)
protected ResultsPage(ScoreInfo score, WorkingBeatmap beatmap)
{
Score = score;
Beatmap = beatmap;

View File

@ -10,18 +10,17 @@ using osu.Game.Graphics;
using osuTK;
using osuTK.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Screens.Ranking.Types;
namespace osu.Game.Screens.Ranking
{
public class ResultModeButton : TabItem<IResultType>
public class ResultModeButton : TabItem<IResultPageInfo>
{
private readonly FontAwesome icon;
private Color4 activeColour;
private Color4 inactiveColour;
private CircularContainer colouredPart;
public ResultModeButton(IResultType mode)
public ResultModeButton(IResultPageInfo mode)
: base(mode)
{
icon = mode.Icon;

View File

@ -3,12 +3,11 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Screens.Ranking.Types;
using osuTK;
namespace osu.Game.Screens.Ranking
{
public class ResultModeTabControl : TabControl<IResultType>
public class ResultModeTabControl : TabControl<IResultPageInfo>
{
public ResultModeTabControl()
{
@ -20,9 +19,9 @@ namespace osu.Game.Screens.Ranking
TabContainer.Padding = new MarginPadding(5);
}
protected override Dropdown<IResultType> CreateDropdown() => null;
protected override Dropdown<IResultPageInfo> CreateDropdown() => null;
protected override TabItem<IResultType> CreateTabItem(IResultType value) => new ResultModeButton(value)
protected override TabItem<IResultPageInfo> CreateTabItem(IResultPageInfo value) => new ResultModeButton(value)
{
Anchor = TabContainer.Anchor,
Origin = TabContainer.Origin

View File

@ -19,7 +19,6 @@ using osu.Game.Graphics.UserInterface;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics.Sprites;
using osu.Game.Scoring;
using osu.Game.Screens.Ranking.Types;
namespace osu.Game.Screens.Ranking
{
@ -265,7 +264,7 @@ namespace osu.Game.Screens.Ranking
},
};
foreach (var t in CreateResultTypes())
foreach (var t in CreateResultPages())
modeChangeButtons.AddItem(t);
modeChangeButtons.Current.Value = modeChangeButtons.Items.FirstOrDefault();
@ -281,6 +280,6 @@ namespace osu.Game.Screens.Ranking
}, true);
}
protected abstract IEnumerable<IResultType> CreateResultTypes();
protected abstract IEnumerable<IResultPageInfo> CreateResultPages();
}
}

View File

@ -0,0 +1,28 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Beatmaps;
using osu.Game.Graphics;
using osu.Game.Scoring;
using osu.Game.Screens.Ranking.Pages;
namespace osu.Game.Screens.Ranking.Types
{
public class BeatmapLeaderboardPageInfo : IResultPageInfo
{
private readonly ScoreInfo score;
private readonly WorkingBeatmap beatmap;
public BeatmapLeaderboardPageInfo(ScoreInfo score, WorkingBeatmap beatmap)
{
this.score = score;
this.beatmap = beatmap;
}
public FontAwesome Icon => FontAwesome.fa_list;
public string Name => @"Beatmap Leaderboard";
public ResultsPage CreatePage() => new RankingResultsPage(score, beatmap);
}
}

View File

@ -0,0 +1,30 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Beatmaps;
using osu.Game.Graphics;
using osu.Game.Scoring;
using osu.Game.Screens.Ranking.Pages;
namespace osu.Game.Screens.Ranking.Types
{
public class ScoreOverviewPageInfo : IResultPageInfo
{
public FontAwesome Icon => FontAwesome.fa_asterisk;
public string Name => "Overview";
private readonly ScoreInfo score;
private readonly WorkingBeatmap beatmap;
public ScoreOverviewPageInfo(ScoreInfo score, WorkingBeatmap beatmap)
{
this.score = score;
this.beatmap = beatmap;
}
public ResultsPage CreatePage()
{
return new ScoreResultsPage(score, beatmap);
}
}
}