1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 10:42:55 +08:00

Allow Player to load from BeatmapInfo.

This commit is contained in:
Dean Herbert 2016-10-27 17:53:37 +09:00
parent d664c97279
commit 9074bc3396
2 changed files with 9 additions and 9 deletions

View File

@ -105,7 +105,7 @@ namespace osu.Game.GameModes.Play
Width = 100,
Text = "Play",
Colour = new Color4(238, 51, 153, 255),
Action = () => Push(new Player { Beatmap = this.database.GetBeatmap(selectedBeatmap) }),
Action = () => Push(new Player { BeatmapInfo = selectedBeatmap }),
},
}
}

View File

@ -11,6 +11,7 @@ using osu.Game.GameModes.Play.Mania;
using osu.Game.GameModes.Play.Osu;
using osu.Game.GameModes.Play.Taiko;
using osu.Framework;
using osu.Game.Database;
namespace osu.Game.GameModes.Play
{
@ -18,6 +19,7 @@ namespace osu.Game.GameModes.Play
{
protected override BackgroundMode CreateBackground() => new BackgroundModeCustom(@"Backgrounds/bg4");
public BeatmapInfo BeatmapInfo;
public Beatmap Beatmap;
public PlayMode PlayMode;
@ -26,10 +28,8 @@ namespace osu.Game.GameModes.Play
{
base.Load(game);
Beatmap beatmap = new Beatmap
{
HitObjects = Beatmap?.HitObjects ?? new List<HitObject>()
};
if (Beatmap == null)
Beatmap = ((OsuGame)game).Beatmaps.GetBeatmap(BeatmapInfo);
HitRenderer hitRenderer;
ScoreOverlay scoreOverlay;
@ -41,7 +41,7 @@ namespace osu.Game.GameModes.Play
hitRenderer = new OsuHitRenderer
{
Objects = beatmap.HitObjects,
Objects = Beatmap.HitObjects,
Anchor = Anchor.Centre,
Origin = Anchor.Centre
};
@ -51,7 +51,7 @@ namespace osu.Game.GameModes.Play
hitRenderer = new TaikoHitRenderer
{
Objects = beatmap.HitObjects,
Objects = Beatmap.HitObjects,
Anchor = Anchor.Centre,
Origin = Anchor.Centre
};
@ -61,7 +61,7 @@ namespace osu.Game.GameModes.Play
hitRenderer = new CatchHitRenderer
{
Objects = beatmap.HitObjects,
Objects = Beatmap.HitObjects,
Anchor = Anchor.Centre,
Origin = Anchor.Centre
};
@ -71,7 +71,7 @@ namespace osu.Game.GameModes.Play
hitRenderer = new ManiaHitRenderer
{
Objects = beatmap.HitObjects,
Objects = Beatmap.HitObjects,
Anchor = Anchor.Centre,
Origin = Anchor.Centre
};