mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Fix toolbar not respecting current overlay activation mode.
This commit is contained in:
@ -28,7 +28,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
|
||||
private const double transition_time = 500;
|
||||
|
||||
private readonly Bindable<OverlayActivation> overlayActivationMode = new Bindable<OverlayActivation>(OverlayActivation.All);
|
||||
protected readonly Bindable<OverlayActivation> OverlayActivationMode = new Bindable<OverlayActivation>(OverlayActivation.All);
|
||||
|
||||
// Toolbar components like RulesetSelector should receive keyboard input events even when the toolbar is hidden.
|
||||
public override bool PropagateNonPositionalInputSubTree => true;
|
||||
@ -89,14 +89,8 @@ 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);
|
||||
|
||||
State.ValueChanged += visibility =>
|
||||
{
|
||||
if (overlayActivationMode.Value == OverlayActivation.Disabled)
|
||||
Hide();
|
||||
};
|
||||
|
||||
if (osuGame != null)
|
||||
overlayActivationMode.BindTo(osuGame.OverlayActivationMode);
|
||||
OverlayActivationMode.BindTo(osuGame.OverlayActivationMode);
|
||||
}
|
||||
|
||||
public class ToolbarBackground : Container
|
||||
@ -137,6 +131,17 @@ namespace osu.Game.Overlays.Toolbar
|
||||
}
|
||||
}
|
||||
|
||||
protected override void UpdateState(ValueChangedEvent<Visibility> state)
|
||||
{
|
||||
if (state.NewValue == Visibility.Visible && OverlayActivationMode.Value == OverlayActivation.Disabled)
|
||||
{
|
||||
State.Value = Visibility.Hidden;
|
||||
return;
|
||||
}
|
||||
|
||||
base.UpdateState(state);
|
||||
}
|
||||
|
||||
protected override void PopIn()
|
||||
{
|
||||
this.MoveToY(0, transition_time, Easing.OutQuint);
|
||||
|
Reference in New Issue
Block a user