1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 16:27:26 +08:00

Fix room inspector cover not resetting when no room selected

This commit is contained in:
Dean Herbert 2019-01-17 18:44:22 +09:00
parent 3a7d09d6f2
commit 59f7c5a26e
2 changed files with 20 additions and 19 deletions

View File

@ -93,10 +93,14 @@ namespace osu.Game.Screens.Multi.Lounge.Components
Host.BindValueChanged(v =>
{
hostText.Clear();
hostText.AddText("hosted by ");
hostText.AddLink(v.Username, null, LinkAction.OpenUserProfile, v.Id.ToString(), "Open profile", s => s.Font = "Exo2.0-BoldItalic");
flagContainer.Clear();
flagContainer.Child = new DrawableFlag(v.Country) { RelativeSizeAxes = Axes.Both };
if (v != null)
{
hostText.AddText("hosted by ");
hostText.AddLink(v.Username, null, LinkAction.OpenUserProfile, v.Id.ToString(), "Open profile", s => s.Font = "Exo2.0-BoldItalic");
flagContainer.Child = new DrawableFlag(v.Country) { RelativeSizeAxes = Axes.Both };
}
});
ParticipantCount.BindValueChanged(v => summary.Text = $"{v:#,0}{" participant".Pluralize(v == 1)}");

View File

@ -53,23 +53,20 @@ namespace osu.Game.Screens.Multi
Duration.UnbindFrom(room.Duration);
}
room = value;
room = value ?? new Room();
if (room != null)
{
RoomID.BindTo(room.RoomID);
Name.BindTo(room.Name);
Host.BindTo(room.Host);
Status.BindTo(room.Status);
Type.BindTo(room.Type);
Playlist.BindTo(room.Playlist);
Participants.BindTo(room.Participants);
ParticipantCount.BindTo(room.ParticipantCount);
MaxParticipants.BindTo(room.MaxParticipants);
EndDate.BindTo(room.EndDate);
Availability.BindTo(room.Availability);
Duration.BindTo(room.Duration);
}
RoomID.BindTo(room.RoomID);
Name.BindTo(room.Name);
Host.BindTo(room.Host);
Status.BindTo(room.Status);
Type.BindTo(room.Type);
Playlist.BindTo(room.Playlist);
Participants.BindTo(room.Participants);
ParticipantCount.BindTo(room.ParticipantCount);
MaxParticipants.BindTo(room.MaxParticipants);
EndDate.BindTo(room.EndDate);
Availability.BindTo(room.Availability);
Duration.BindTo(room.Duration);
}
}