No more statics + better unregistration

This commit is contained in:
smoogipoo
2018-01-18 17:40:05 +09:00
parent 89f4bfa7b5
commit dee298c395
4 changed files with 28 additions and 21 deletions

View File

@ -161,11 +161,19 @@ namespace osu.Game.Rulesets.Mania.UI
judgements.Scale = Scale;
}
private Bindable<double> scrollTime;
[BackgroundDependencyLoader]
private void load(OsuColour colours, ManiaConfigManager maniaConfig)
{
maniaConfig.BindWith(ManiaSetting.ScrollTime, VisibleTimeRange);
// Todo: The following two lines shouldn't be required, but is an effect of not having config databased
// 1. ValueChanged is run prior to values being propagated
// 2. We want the config to be saved ASAP, in-case a new ManiaPlayfield is instantiated
scrollTime = maniaConfig.GetBindable<double>(ManiaSetting.ScrollTime);
scrollTime.ValueChanged += v => maniaConfig.Save();
normalColumnColours = new List<Color4>
{
colours.RedDark,