mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Moved Config logic to OsuConfigManager
This commit is contained in:
@ -168,9 +168,23 @@ namespace osu.Game.Configuration
|
|||||||
Set(OsuConfig.CanForceOptimusCompatibility, true);
|
Set(OsuConfig.CanForceOptimusCompatibility, true);
|
||||||
Set(OsuConfig.ConfineMouse, Get<bool>(OsuConfig.ConfineMouseToFullscreen) ?
|
Set(OsuConfig.ConfineMouse, Get<bool>(OsuConfig.ConfineMouseToFullscreen) ?
|
||||||
ConfineMouseMode.Fullscreen : ConfineMouseMode.Never);
|
ConfineMouseMode.Fullscreen : ConfineMouseMode.Never);
|
||||||
|
|
||||||
|
GetBindable<bool>(OsuConfig.SavePassword).ValueChanged += delegate { eventPassword(); };
|
||||||
|
GetBindable<bool>(OsuConfig.SaveUsername).ValueChanged += delegate { eventUsername(); };
|
||||||
#pragma warning restore CS0612 // Type or member is obsolete
|
#pragma warning restore CS0612 // Type or member is obsolete
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void eventPassword()
|
||||||
|
{
|
||||||
|
if ((GetBindable<bool>(OsuConfig.SavePassword) == true) && (GetBindable<bool>(OsuConfig.SaveUsername) == false))
|
||||||
|
Set(OsuConfig.SaveUsername, true);
|
||||||
|
}
|
||||||
|
private void eventUsername()
|
||||||
|
{
|
||||||
|
if ((GetBindable<bool>(OsuConfig.SaveUsername) == false) && (GetBindable<bool>(OsuConfig.SavePassword) == true))
|
||||||
|
Set(OsuConfig.SavePassword, false);
|
||||||
|
}
|
||||||
|
|
||||||
//todo: make a UnicodeString class/struct rather than requiring this helper method.
|
//todo: make a UnicodeString class/struct rather than requiring this helper method.
|
||||||
public string GetUnicodeString(string nonunicode, string unicode)
|
public string GetUnicodeString(string nonunicode, string unicode)
|
||||||
=> Get<bool>(OsuConfig.ShowUnicode) ? unicode ?? nonunicode : nonunicode ?? unicode;
|
=> Get<bool>(OsuConfig.ShowUnicode) ? unicode ?? nonunicode : nonunicode ?? unicode;
|
||||||
|
@ -80,17 +80,6 @@ namespace osu.Game.Overlays.Options.General
|
|||||||
private CheckBoxOption saveUsername;
|
private CheckBoxOption saveUsername;
|
||||||
private CheckBoxOption savePassword;
|
private CheckBoxOption savePassword;
|
||||||
|
|
||||||
private void eventPassword()
|
|
||||||
{
|
|
||||||
if ((savePassword.State == CheckBoxState.Checked) && (saveUsername.State == CheckBoxState.Unchecked))
|
|
||||||
saveUsername.State = CheckBoxState.Checked;
|
|
||||||
}
|
|
||||||
private void eventUsername()
|
|
||||||
{
|
|
||||||
if ((saveUsername.State == CheckBoxState.Unchecked) && (savePassword.State == CheckBoxState.Checked))
|
|
||||||
savePassword.State = CheckBoxState.Unchecked;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void performLogin()
|
private void performLogin()
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(username.Text) && !string.IsNullOrEmpty(password.Text))
|
if (!string.IsNullOrEmpty(username.Text) && !string.IsNullOrEmpty(password.Text))
|
||||||
@ -143,8 +132,6 @@ namespace osu.Game.Overlays.Options.General
|
|||||||
//Action = registerLink
|
//Action = registerLink
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
config.GetBindable<bool>(OsuConfig.SavePassword).ValueChanged += delegate { eventPassword(); };
|
|
||||||
config.GetBindable<bool>(OsuConfig.SaveUsername).ValueChanged += delegate { eventUsername(); };
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user