mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Update focus handling in line with framework changes
This commit is contained in:
@ -51,9 +51,12 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
||||
Spacing = new Vector2(0f, 5f);
|
||||
}
|
||||
|
||||
private InputManager inputManager;
|
||||
|
||||
[BackgroundDependencyLoader(permitNulls: true)]
|
||||
private void load(OsuColour colours, APIAccess api)
|
||||
private void load(OsuColour colours, APIAccess api, UserInputManager inputManager)
|
||||
{
|
||||
this.inputManager = inputManager;
|
||||
this.colours = colours;
|
||||
api?.Register(this);
|
||||
}
|
||||
@ -160,12 +163,12 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
||||
break;
|
||||
}
|
||||
|
||||
form?.TriggerFocus();
|
||||
if (form != null) inputManager.ChangeFocus(form);
|
||||
}
|
||||
|
||||
protected override bool OnFocus(InputState state)
|
||||
{
|
||||
form?.TriggerFocus();
|
||||
if (form != null) inputManager.ChangeFocus(form);
|
||||
return base.OnFocus(state);
|
||||
}
|
||||
|
||||
@ -174,6 +177,7 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
||||
private TextBox username;
|
||||
private TextBox password;
|
||||
private APIAccess api;
|
||||
private InputManager inputManager;
|
||||
|
||||
private void performLogin()
|
||||
{
|
||||
@ -182,8 +186,9 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader(permitNulls: true)]
|
||||
private void load(APIAccess api, OsuConfigManager config)
|
||||
private void load(APIAccess api, OsuConfigManager config, UserInputManager inputManager)
|
||||
{
|
||||
this.inputManager = inputManager;
|
||||
this.api = api;
|
||||
Direction = FillDirection.Vertical;
|
||||
Spacing = new Vector2(0, 5);
|
||||
@ -235,9 +240,9 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
||||
Schedule(() =>
|
||||
{
|
||||
if (string.IsNullOrEmpty(username.Text))
|
||||
username.TriggerFocus();
|
||||
inputManager.ChangeFocus(username);
|
||||
else
|
||||
password.TriggerFocus();
|
||||
inputManager.ChangeFocus(password);
|
||||
});
|
||||
|
||||
return base.OnFocus(state);
|
||||
|
Reference in New Issue
Block a user