mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 20:47:22 +08:00
Merge pull request #15080 from smoogipoo/remove-room-position
Remove stored position from room model
This commit is contained in:
commit
3b766a4568
@ -130,12 +130,6 @@ namespace osu.Game.Online.Rooms
|
|||||||
set => MaxAttempts.Value = value;
|
set => MaxAttempts.Value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The position of this <see cref="Room"/> in the list. This is not read from or written to the API.
|
|
||||||
/// </summary>
|
|
||||||
[JsonIgnore]
|
|
||||||
public readonly Bindable<long> Position = new Bindable<long>(-1); // Todo: This does not need to exist.
|
|
||||||
|
|
||||||
public Room()
|
public Room()
|
||||||
{
|
{
|
||||||
Password.BindValueChanged(p => HasPassword.Value = !string.IsNullOrEmpty(p.NewValue));
|
Password.BindValueChanged(p => HasPassword.Value = !string.IsNullOrEmpty(p.NewValue));
|
||||||
@ -192,8 +186,6 @@ namespace osu.Game.Online.Rooms
|
|||||||
RecentParticipants.Clear();
|
RecentParticipants.Clear();
|
||||||
RecentParticipants.AddRange(other.RecentParticipants);
|
RecentParticipants.AddRange(other.RecentParticipants);
|
||||||
}
|
}
|
||||||
|
|
||||||
Position.Value = other.Position.Value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveExpiredPlaylistItems()
|
public void RemoveExpiredPlaylistItems()
|
||||||
|
@ -116,8 +116,6 @@ namespace osu.Game.Screens.OnlinePlay.Components
|
|||||||
if (ignoredRooms.Contains(room.RoomID.Value.Value))
|
if (ignoredRooms.Contains(room.RoomID.Value.Value))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
room.Position.Value = -room.RoomID.Value.Value;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
foreach (var pi in room.Playlist)
|
foreach (var pi in room.Playlist)
|
||||||
|
@ -129,7 +129,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
|||||||
private void updateSorting()
|
private void updateSorting()
|
||||||
{
|
{
|
||||||
foreach (var room in roomFlow)
|
foreach (var room in roomFlow)
|
||||||
roomFlow.SetLayoutPosition(room, room.Room.Position.Value);
|
roomFlow.SetLayoutPosition(room, -(room.Room.RoomID.Value ?? 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnClick(ClickEvent e)
|
protected override bool OnClick(ClickEvent e)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user