mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 14:12:56 +08:00
Resolve LoungeSubScreen from PasswordEntryPopover
This is preferred over passing down the already-resolved LoungeSubScreen
This commit is contained in:
parent
e018071be4
commit
447001931c
@ -122,7 +122,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
|
||||
}
|
||||
}
|
||||
|
||||
public Popover GetPopover() => new PasswordEntryPopover(Room) { Lounge = lounge };
|
||||
public Popover GetPopover() => new PasswordEntryPopover(Room);
|
||||
|
||||
public MenuItem[] ContextMenuItems => new MenuItem[]
|
||||
{
|
||||
@ -178,7 +178,8 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
|
||||
{
|
||||
private readonly Room room;
|
||||
|
||||
public LoungeSubScreen Lounge;
|
||||
[Resolved(canBeNull: true)]
|
||||
private LoungeSubScreen lounge { get; set; }
|
||||
|
||||
public PasswordEntryPopover(Room room)
|
||||
{
|
||||
@ -219,7 +220,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
|
||||
};
|
||||
Child = shakeContainer;
|
||||
|
||||
joinButton.Action = () => Lounge?.Join(room, passwordTextbox.Text, null, joinFailed);
|
||||
joinButton.Action = () => lounge?.Join(room, passwordTextbox.Text, null, joinFailed);
|
||||
}
|
||||
|
||||
private void joinFailed(string error)
|
||||
@ -234,7 +235,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
|
||||
base.LoadComplete();
|
||||
|
||||
Schedule(() => GetContainingInputManager().ChangeFocus(passwordTextbox));
|
||||
passwordTextbox.OnCommit += (_, __) => Lounge?.Join(room, passwordTextbox.Text, null, joinFailed);
|
||||
passwordTextbox.OnCommit += (_, __) => lounge?.Join(room, passwordTextbox.Text, null, joinFailed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user