mirror of
https://github.com/ppy/osu
synced 2024-12-17 12:25:19 +00:00
Hide letterbox position sliders
This commit is contained in:
parent
4fa6db6cfa
commit
943bd737c4
@ -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<int> letterboxPositionX;
|
||||
private OptionSlider<int> letterboxPositionY;
|
||||
|
||||
private Bindable<bool> letterboxing;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(FrameworkConfigManager config)
|
||||
{
|
||||
letterboxing = config.GetBindable<bool>(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<bool>(FrameworkConfig.Letterboxing),
|
||||
Bindable = letterboxing,
|
||||
},
|
||||
new OptionSlider<int>
|
||||
letterboxPositionX = new OptionSlider<int>
|
||||
{
|
||||
LabelText = "Horizontal position",
|
||||
Bindable = (BindableInt)config.GetBindable<int>(FrameworkConfig.LetterboxPositionX)
|
||||
},
|
||||
new OptionSlider<int>
|
||||
letterboxPositionY = new OptionSlider<int>
|
||||
{
|
||||
LabelText = "Vertical position",
|
||||
Bindable = (BindableInt)config.GetBindable<int>(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user