mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 02:22:56 +08:00
Simplify colour provider caching
This commit is contained in:
parent
8e470678c7
commit
1305634c52
@ -17,11 +17,12 @@ namespace osu.Game.Overlays
|
||||
[Resolved]
|
||||
protected IAPIProvider API { get; private set; }
|
||||
|
||||
private readonly OverlayColourScheme colourScheme;
|
||||
[Cached]
|
||||
private OverlayColourProvider colourProvider;
|
||||
|
||||
protected FullscreenOverlay(OverlayColourScheme colourScheme)
|
||||
{
|
||||
this.colourScheme = colourScheme;
|
||||
colourProvider = new OverlayColourProvider(colourScheme);
|
||||
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
RelativePositionAxes = Axes.Both;
|
||||
@ -39,17 +40,9 @@ namespace osu.Game.Overlays
|
||||
};
|
||||
}
|
||||
|
||||
private DependencyContainer dependencies;
|
||||
|
||||
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) =>
|
||||
dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
OverlayColourProvider colourProvider;
|
||||
dependencies.Cache(colourProvider = new OverlayColourProvider(colourScheme));
|
||||
|
||||
Waves.FirstWaveColour = colourProvider.Highlight1;
|
||||
Waves.SecondWaveColour = colourProvider.Light4;
|
||||
Waves.ThirdWaveColour = colourProvider.Dark3;
|
||||
|
Loading…
Reference in New Issue
Block a user