1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-11 23:13:06 +08:00

Move InputSettings children creation code to BDL

- Avoids now obsolete variable name
- Makes changing to touch detection easier (access to session statics in BDL)
This commit is contained in:
Susko3 2023-11-07 00:17:15 +01:00
parent 05d9418718
commit 7385c3c97b

View File

@ -11,22 +11,23 @@ namespace osu.Game.Screens.Play.PlayerSettings
{
public partial class InputSettings : PlayerSettingsGroup
{
private readonly PlayerCheckbox mouseButtonsCheckbox;
public InputSettings()
: base("Input Settings")
{
Children = new Drawable[]
{
mouseButtonsCheckbox = new PlayerCheckbox
{
// TODO: change to touchscreen detection once https://github.com/ppy/osu/pull/25348 makes it in
LabelText = RuntimeInfo.IsDesktop ? MouseSettingsStrings.DisableClicksDuringGameplay : TouchSettingsStrings.DisableTapsDuringGameplay
}
};
}
[BackgroundDependencyLoader]
private void load(OsuConfigManager config) => mouseButtonsCheckbox.Current = config.GetBindable<bool>(RuntimeInfo.IsDesktop ? OsuSetting.MouseDisableButtons : OsuSetting.DisableTapsDuringGameplay);
private void load(OsuConfigManager config)
{
Children = new Drawable[]
{
new PlayerCheckbox
{
// TODO: change to touchscreen detection once https://github.com/ppy/osu/pull/25348 makes it in
LabelText = RuntimeInfo.IsDesktop ? MouseSettingsStrings.DisableClicksDuringGameplay : TouchSettingsStrings.DisableTapsDuringGameplay,
Current = config.GetBindable<bool>(RuntimeInfo.IsDesktop ? OsuSetting.MouseDisableButtons : OsuSetting.TouchDisableGameplayTaps)
}
};
}
}
}