mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 15:16:38 +09:00
Bind ruleset to toolbar later for safety
This commit is contained in:
@ -58,8 +58,11 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
AlwaysPresent = false;
|
AlwaysPresent = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private Bindable<RulesetInfo> ruleset { get; set; }
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
private void load(OsuGame osuGame, Bindable<RulesetInfo> parentRuleset)
|
private void load(OsuGame osuGame)
|
||||||
{
|
{
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
@ -106,13 +109,17 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Bound after the selector is added to the hierarchy to give it a chance to load the available rulesets
|
|
||||||
rulesetSelector.Current.BindTo(parentRuleset);
|
|
||||||
|
|
||||||
if (osuGame != null)
|
if (osuGame != null)
|
||||||
OverlayActivationMode.BindTo(osuGame.OverlayActivationMode);
|
OverlayActivationMode.BindTo(osuGame.OverlayActivationMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
|
||||||
|
rulesetSelector.Current.BindTo(ruleset);
|
||||||
|
}
|
||||||
|
|
||||||
public class ToolbarBackground : Container
|
public class ToolbarBackground : Container
|
||||||
{
|
{
|
||||||
private readonly Box gradientBackground;
|
private readonly Box gradientBackground;
|
||||||
|
Reference in New Issue
Block a user