mirror of
https://github.com/ppy/osu
synced 2025-01-11 16:49:39 +00:00
Fix editor not using beatmap combo colours initially on load
This commit is contained in:
parent
8562020eba
commit
c38cd50723
@ -94,6 +94,7 @@ namespace osu.Game.Screens.Edit
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
LoadComponentAsync(CreateMainContent(), content =>
|
LoadComponentAsync(CreateMainContent(), content =>
|
||||||
{
|
{
|
||||||
spinner.State.Value = Visibility.Hidden;
|
spinner.State.Value = Visibility.Hidden;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Game.Audio;
|
using osu.Game.Audio;
|
||||||
@ -13,25 +14,62 @@ namespace osu.Game.Skinning
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class BeatmapSkinProvidingContainer : SkinProvidingContainer
|
public class BeatmapSkinProvidingContainer : SkinProvidingContainer
|
||||||
{
|
{
|
||||||
private readonly Bindable<bool> beatmapSkins = new Bindable<bool>();
|
private Bindable<bool> beatmapSkins;
|
||||||
private readonly Bindable<bool> beatmapHitsounds = new Bindable<bool>();
|
private Bindable<bool> beatmapHitsounds;
|
||||||
|
|
||||||
protected override bool AllowConfigurationLookup => beatmapSkins.Value;
|
protected override bool AllowConfigurationLookup
|
||||||
protected override bool AllowDrawableLookup(ISkinComponent component) => beatmapSkins.Value;
|
{
|
||||||
protected override bool AllowTextureLookup(string componentName) => beatmapSkins.Value;
|
get
|
||||||
protected override bool AllowSampleLookup(ISampleInfo componentName) => beatmapHitsounds.Value;
|
{
|
||||||
|
if (beatmapSkins == null)
|
||||||
|
throw new InvalidOperationException($"{nameof(BeatmapSkinProvidingContainer)} needs to be loaded before being consumed.");
|
||||||
|
|
||||||
|
return beatmapSkins.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override bool AllowDrawableLookup(ISkinComponent component)
|
||||||
|
{
|
||||||
|
if (beatmapSkins == null)
|
||||||
|
throw new InvalidOperationException($"{nameof(BeatmapSkinProvidingContainer)} needs to be loaded before being consumed.");
|
||||||
|
|
||||||
|
return beatmapSkins.Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override bool AllowTextureLookup(string componentName)
|
||||||
|
{
|
||||||
|
if (beatmapSkins == null)
|
||||||
|
throw new InvalidOperationException($"{nameof(BeatmapSkinProvidingContainer)} needs to be loaded before being consumed.");
|
||||||
|
|
||||||
|
return beatmapSkins.Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override bool AllowSampleLookup(ISampleInfo componentName)
|
||||||
|
{
|
||||||
|
if (beatmapSkins == null)
|
||||||
|
throw new InvalidOperationException($"{nameof(BeatmapSkinProvidingContainer)} needs to be loaded before being consumed.");
|
||||||
|
|
||||||
|
return beatmapHitsounds.Value;
|
||||||
|
}
|
||||||
|
|
||||||
public BeatmapSkinProvidingContainer(ISkin skin)
|
public BeatmapSkinProvidingContainer(ISkin skin)
|
||||||
: base(skin)
|
: base(skin)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
|
||||||
private void load(OsuConfigManager config)
|
|
||||||
{
|
{
|
||||||
config.BindWith(OsuSetting.BeatmapSkins, beatmapSkins);
|
var config = parent.Get<OsuConfigManager>();
|
||||||
config.BindWith(OsuSetting.BeatmapHitsounds, beatmapHitsounds);
|
|
||||||
|
|
||||||
|
beatmapSkins = config.GetBindable<bool>(OsuSetting.BeatmapSkins);
|
||||||
|
beatmapHitsounds = config.GetBindable<bool>(OsuSetting.BeatmapHitsounds);
|
||||||
|
|
||||||
|
return base.CreateChildDependencies(parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load()
|
||||||
|
{
|
||||||
beatmapSkins.BindValueChanged(_ => TriggerSourceChanged());
|
beatmapSkins.BindValueChanged(_ => TriggerSourceChanged());
|
||||||
beatmapHitsounds.BindValueChanged(_ => TriggerSourceChanged());
|
beatmapHitsounds.BindValueChanged(_ => TriggerSourceChanged());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user