diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 9bd2ef9f75..5e7c47c9a9 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -279,6 +279,7 @@ namespace osu.Game //central game mode change logic. if (!currentScreen.ShowOverlays) { + options.State = Visibility.Hidden; Toolbar.State = Visibility.Hidden; musicController.State = Visibility.Hidden; chat.State = Visibility.Hidden; diff --git a/osu.Game/Overlays/Options/Sections/Graphics/LayoutOptions.cs b/osu.Game/Overlays/Options/Sections/Graphics/LayoutOptions.cs index a3dbb9c76f..0a2e8f91a4 100644 --- a/osu.Game/Overlays/Options/Sections/Graphics/LayoutOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Graphics/LayoutOptions.cs @@ -5,6 +5,7 @@ using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Game.Graphics.UserInterface; +using System; namespace osu.Game.Overlays.Options.Sections.Graphics { @@ -12,9 +13,16 @@ namespace osu.Game.Overlays.Options.Sections.Graphics { protected override string Header => "Layout"; + private OptionSlider letterboxPositionX; + private OptionSlider letterboxPositionY; + + private Bindable letterboxing; + [BackgroundDependencyLoader] private void load(FrameworkConfigManager config) { + letterboxing = config.GetBindable(FrameworkConfig.Letterboxing); + Children = new Drawable[] { new OptionLabel { Text = "Resolution: TODO dropdown" }, @@ -26,19 +34,36 @@ namespace osu.Game.Overlays.Options.Sections.Graphics new OsuCheckbox { LabelText = "Letterboxing", - Bindable = config.GetBindable(FrameworkConfig.Letterboxing), + Bindable = letterboxing, }, - new OptionSlider + letterboxPositionX = new OptionSlider { LabelText = "Horizontal position", Bindable = (BindableInt)config.GetBindable(FrameworkConfig.LetterboxPositionX) }, - new OptionSlider + letterboxPositionY = new OptionSlider { LabelText = "Vertical position", Bindable = (BindableInt)config.GetBindable(FrameworkConfig.LetterboxPositionY) }, }; + + letterboxing.ValueChanged += visibilityChanged; + letterboxing.TriggerChange(); + } + + private void visibilityChanged(object sender, EventArgs e) + { + if (letterboxing) + { + letterboxPositionX.Show(); + letterboxPositionY.Show(); + } + else + { + letterboxPositionX.Hide(); + letterboxPositionY.Hide(); + } } } } \ No newline at end of file