mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Add user toggle for application of safe areas
This commit is contained in:
@ -8,6 +8,7 @@ using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Overlays.Settings;
|
||||
using osuTK.Graphics;
|
||||
|
||||
@ -24,6 +25,8 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
private readonly Bindable<float> safeAreaPaddingLeft = new BindableFloat { MinValue = 0, MaxValue = 200 };
|
||||
private readonly Bindable<float> safeAreaPaddingRight = new BindableFloat { MinValue = 0, MaxValue = 200 };
|
||||
|
||||
private readonly Bindable<bool> applySafeAreaConsiderations = new Bindable<bool>(true);
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
@ -84,6 +87,11 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
Current = safeAreaPaddingRight,
|
||||
LabelText = "Right"
|
||||
},
|
||||
new SettingsCheckbox
|
||||
{
|
||||
LabelText = "Apply",
|
||||
Current = applySafeAreaConsiderations,
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -93,6 +101,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
safeAreaPaddingBottom.BindValueChanged(_ => updateSafeArea());
|
||||
safeAreaPaddingLeft.BindValueChanged(_ => updateSafeArea());
|
||||
safeAreaPaddingRight.BindValueChanged(_ => updateSafeArea());
|
||||
applySafeAreaConsiderations.BindValueChanged(_ => updateSafeArea());
|
||||
});
|
||||
|
||||
base.SetUpSteps();
|
||||
@ -107,6 +116,8 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
Left = safeAreaPaddingLeft.Value,
|
||||
Right = safeAreaPaddingRight.Value,
|
||||
};
|
||||
|
||||
Game.LocalConfig.SetValue(OsuSetting.SafeAreaConsiderations, applySafeAreaConsiderations.Value);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
Reference in New Issue
Block a user