1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-25 03:03:20 +08:00
osu-lazer/osu.Game/Rulesets/UI/ReplayAnalysisSettings.cs
Sheppsu 26f1596150 move replay analysis settings creation point
replay analysis settings is created in the respective drawable that's adding it, instead of adding it from `DrawableRuleset`
for this, it adds a virtual method in Ruleset that uses a non-ruleset-specific `ReplayAnalysisSettings` (the osu specific one was renamed to `OsuReplayAnalysisSettings`).
2024-09-21 02:02:55 -04:00

43 lines
1.2 KiB
C#

// 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.
#nullable disable
using osu.Framework.Allocation;
using osu.Game.Configuration;
using osu.Game.Rulesets.Configuration;
using osu.Game.Screens.Play.PlayerSettings;
namespace osu.Game.Rulesets.UI
{
public partial class ReplayAnalysisSettings : PlayerSettingsGroup
{
private readonly Ruleset ruleset;
protected IRulesetConfigManager Config;
public ReplayAnalysisSettings(Ruleset ruleset)
: base("Analysis Settings")
{
this.ruleset = ruleset;
}
[BackgroundDependencyLoader]
private void load()
{
AddRange(this.CreateSettingsControls());
}
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
{
var dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
Config = dependencies.Get<IRulesetConfigCache>().GetConfigFor(ruleset);
if (Config is not null)
dependencies.Cache(Config);
return dependencies;
}
}
}