1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-15 15:27:20 +08:00

Move PreferredPlayMode to WorkingBeatmap.

This commit is contained in:
Dean Herbert 2017-03-05 17:45:40 +09:00
parent 4e4408cd20
commit 7afcac3660
4 changed files with 13 additions and 8 deletions

View File

@ -97,7 +97,6 @@ namespace osu.Desktop.VisualTests.Tests
{
return new Player
{
PreferredPlayMode = PlayMode.Osu,
Beatmap = beatmap
};
}

View File

@ -8,6 +8,7 @@ using osu.Framework.Graphics.Textures;
using osu.Game.Beatmaps.Formats;
using osu.Game.Beatmaps.IO;
using osu.Game.Database;
using osu.Game.Modes;
namespace osu.Game.Beatmaps
{
@ -17,6 +18,14 @@ namespace osu.Game.Beatmaps
public readonly BeatmapSetInfo BeatmapSetInfo;
/// <summary>
/// A play mode that is preferred for this beatmap. This allows for conversion between game modes where feasible,
/// but does not gurantee an outcome.
/// </summary>
public PlayMode PreferredPlayMode;
public PlayMode PlayMode => beatmap?.BeatmapInfo?.Mode > PlayMode.Osu ? beatmap.BeatmapInfo.Mode : PreferredPlayMode;
public readonly bool WithStoryboard;
protected abstract ArchiveReader GetReader();

View File

@ -42,8 +42,6 @@ namespace osu.Game.Screens.Play
public BeatmapInfo BeatmapInfo;
public PlayMode PreferredPlayMode;
private bool isPaused;
public bool IsPaused
{
@ -121,9 +119,7 @@ namespace osu.Game.Screens.Play
return;
}
PlayMode usablePlayMode = beatmap.BeatmapInfo?.Mode > PlayMode.Osu ? beatmap.BeatmapInfo.Mode : PreferredPlayMode;
ruleset = Ruleset.GetRuleset(usablePlayMode);
ruleset = Ruleset.GetRuleset(Beatmap.PlayMode);
scoreOverlay = ruleset.CreateScoreOverlay();
scoreOverlay.BindProcessor(scoreProcessor = ruleset.CreateScoreProcessor(beatmap.HitObjects.Count));

View File

@ -159,10 +159,11 @@ namespace osu.Game.Screens.Select
if (player != null || Beatmap == null)
return;
Beatmap.PreferredPlayMode = playMode.Value;
(player = new PlayerLoader(new Player
{
BeatmapInfo = carousel.SelectedGroup.SelectedPanel.Beatmap,
PreferredPlayMode = playMode.Value
Beatmap = Beatmap, //eagerly set this so it's prsent before push.
})).LoadAsync(Game, l => Push(player));
}
},