Add snap color option for osu!mania

This commit is contained in:
Justus Franklin Tumacder
2021-04-24 16:23:52 +08:00
parent 3b77d02752
commit 7e3a611f95
37 changed files with 314 additions and 99 deletions

View File

@ -1,15 +1,21 @@
// 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 osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Input.Bindings;
using osu.Game.Rulesets.Mania.Configuration;
using osu.Game.Rulesets.Mania.UI;
using osu.Game.Tests.Visual;
namespace osu.Game.Rulesets.Mania.Tests
{
public abstract class ManiaInputTestScene : OsuTestScene
{
[Cached]
protected readonly Bindable<ManiaColourCode> configColourCode = new Bindable<ManiaColourCode>();
private readonly Container<Drawable> content;
protected override Container<Drawable> Content => content ?? base.Content;
@ -18,6 +24,13 @@ namespace osu.Game.Rulesets.Mania.Tests
base.Content.Add(content = new LocalInputManager(keys));
}
[BackgroundDependencyLoader]
private void load(RulesetConfigCache configCache)
{
var config = (ManiaRulesetConfigManager)configCache.GetConfigFor(Ruleset.Value.CreateInstance());
config.BindWith(ManiaRulesetSetting.ColourCode, configColourCode);
}
private class LocalInputManager : ManiaInputManager
{
public LocalInputManager(int variant)