mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 15:43:21 +08:00
Wrap main content of DrawableRoom
This commit is contained in:
parent
037b9cfb59
commit
bebb9d7e67
@ -43,6 +43,8 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
||||
private PasswordProtectedIcon passwordIcon;
|
||||
private EndDateInfo endDateInfo;
|
||||
|
||||
private DelayedLoadWrapper wrapper;
|
||||
|
||||
public DrawableRoom(Room room)
|
||||
{
|
||||
Room = room;
|
||||
@ -75,6 +77,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
||||
{
|
||||
d.RelativeSizeAxes = Axes.Both;
|
||||
}),
|
||||
wrapper = new DelayedLoadWrapper(() =>
|
||||
new Container
|
||||
{
|
||||
Name = @"Room content",
|
||||
@ -223,7 +226,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
||||
passwordIcon = new PasswordProtectedIcon { Alpha = 0 }
|
||||
},
|
||||
},
|
||||
},
|
||||
}, 0)
|
||||
};
|
||||
}
|
||||
|
||||
@ -231,6 +234,8 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
wrapper.DelayedLoadComplete += _ =>
|
||||
{
|
||||
roomCategory.BindTo(Room.Category);
|
||||
roomCategory.BindValueChanged(c =>
|
||||
{
|
||||
@ -248,6 +253,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
||||
|
||||
hasPassword.BindTo(Room.HasPassword);
|
||||
hasPassword.BindValueChanged(v => passwordIcon.Alpha = v.NewValue ? 1 : 0, true);
|
||||
};
|
||||
}
|
||||
|
||||
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
|
||||
|
Loading…
Reference in New Issue
Block a user