From ba1d0b3a84d419f4205f9d2226aac6b72b4e8717 Mon Sep 17 00:00:00 2001 From: Andrey Zavadskiy Date: Sat, 24 Dec 2016 09:09:01 +0300 Subject: [PATCH] Added Events for checkboxes --- .../Overlays/Options/General/LoginOptions.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/osu.Game/Overlays/Options/General/LoginOptions.cs b/osu.Game/Overlays/Options/General/LoginOptions.cs index 0c4a48b89b..a6e354bbcb 100644 --- a/osu.Game/Overlays/Options/General/LoginOptions.cs +++ b/osu.Game/Overlays/Options/General/LoginOptions.cs @@ -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(OsuConfig.SavePassword).ValueChanged += delegate { eventPassword(); }; + config.GetBindable(OsuConfig.SaveUsername).ValueChanged += delegate { eventUsername(); }; } } }