1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-19 05:52:55 +08:00

Added Events for checkboxes

This commit is contained in:
Andrey Zavadskiy 2016-12-24 09:09:01 +03:00
parent 9f202ecba8
commit ba1d0b3a84

View File

@ -83,6 +83,22 @@ namespace osu.Game.Overlays.Options.General
private CheckBoxOption saveUsername;
private CheckBoxOption savePassword;
private void eventPassword()
{
if (savePassword.State == CheckBoxState.Checked)
{
saveUsername.State = CheckBoxState.Checked;
}
}
private void eventUsername()
{
if (savePassword.State == CheckBoxState.Checked)
{
if(saveUsername.State == CheckBoxState.Unchecked)
savePassword.State = CheckBoxState.Unchecked;
}
}
private void performLogin()
{
if (!string.IsNullOrEmpty(username.Text) && !string.IsNullOrEmpty(password.Text))
@ -135,6 +151,8 @@ namespace osu.Game.Overlays.Options.General
//Action = registerLink
}
};
config.GetBindable<bool>(OsuConfig.SavePassword).ValueChanged += delegate { eventPassword(); };
config.GetBindable<bool>(OsuConfig.SaveUsername).ValueChanged += delegate { eventUsername(); };
}
}
}