Add bindable mods and autoplay support.

This commit is contained in:
Dean Herbert
2017-03-06 14:52:37 +09:00
parent 1ea21daa91
commit 76ef8c1a6c
5 changed files with 32 additions and 9 deletions

View File

@ -17,6 +17,7 @@ using osu.Game.Configuration;
using osu.Framework.Configuration;
using System;
using System.Linq;
using osu.Framework.Extensions.IEnumerableExtensions;
using OpenTK.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Transforms;
@ -66,6 +67,17 @@ namespace osu.Game.Screens.Play
[BackgroundDependencyLoader]
private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuGameBase game, OsuConfigManager config)
{
var beatmap = Beatmap.Beatmap;
if (beatmap.BeatmapInfo?.Mode > PlayMode.Osu)
{
//we only support osu! mode for now because the hitobject parsing is crappy and needs a refactor.
Exit();
return;
}
Beatmap.Mods.Value.ForEach(m => m.PlayerLoading(this));
dimLevel = config.GetBindable<int>(OsuConfig.DimLevel);
mouseWheelDisabled = config.GetBindable<bool>(OsuConfig.MouseDisableWheel);
@ -102,15 +114,6 @@ namespace osu.Game.Screens.Play
sourceClock.Reset();
});
var beatmap = Beatmap.Beatmap;
if (beatmap.BeatmapInfo?.Mode > PlayMode.Osu)
{
//we only support osu! mode for now because the hitobject parsing is crappy and needs a refactor.
Exit();
return;
}
ruleset = Ruleset.GetRuleset(Beatmap.PlayMode);
scoreOverlay = ruleset.CreateScoreOverlay();