mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Remove gameplay_order, use existing playlist_order
This commit is contained in:
@ -742,7 +742,7 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
Beatmap = { Value = apiBeatmap },
|
Beatmap = { Value = apiBeatmap },
|
||||||
Ruleset = { Value = ruleset },
|
Ruleset = { Value = ruleset },
|
||||||
Expired = item.Expired,
|
Expired = item.Expired,
|
||||||
GameplayOrder = item.GameplayOrder
|
PlaylistOrder = item.PlaylistOrder
|
||||||
};
|
};
|
||||||
|
|
||||||
playlistItem.RequiredMods.AddRange(item.RequiredMods.Select(m => m.ToMod(rulesetInstance)));
|
playlistItem.RequiredMods.AddRange(item.RequiredMods.Select(m => m.ToMod(rulesetInstance)));
|
||||||
|
@ -43,7 +43,7 @@ namespace osu.Game.Online.Rooms
|
|||||||
/// The order in which this <see cref="MultiplayerPlaylistItem"/> will be played, starting from 0 and increasing for items which will be played later.
|
/// The order in which this <see cref="MultiplayerPlaylistItem"/> will be played, starting from 0 and increasing for items which will be played later.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Key(8)]
|
[Key(8)]
|
||||||
public int GameplayOrder { get; set; }
|
public ushort PlaylistOrder { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The date when this <see cref="MultiplayerPlaylistItem"/> was last updated.
|
/// The date when this <see cref="MultiplayerPlaylistItem"/> was last updated.
|
||||||
@ -65,7 +65,7 @@ namespace osu.Game.Online.Rooms
|
|||||||
RequiredMods = item.RequiredMods.Select(m => new APIMod(m)).ToArray();
|
RequiredMods = item.RequiredMods.Select(m => new APIMod(m)).ToArray();
|
||||||
AllowedMods = item.AllowedMods.Select(m => new APIMod(m)).ToArray();
|
AllowedMods = item.AllowedMods.Select(m => new APIMod(m)).ToArray();
|
||||||
Expired = item.Expired;
|
Expired = item.Expired;
|
||||||
GameplayOrder = item.GameplayOrder;
|
PlaylistOrder = item.PlaylistOrder ?? 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,8 +33,8 @@ namespace osu.Game.Online.Rooms
|
|||||||
[JsonProperty("expired")]
|
[JsonProperty("expired")]
|
||||||
public bool Expired { get; set; }
|
public bool Expired { get; set; }
|
||||||
|
|
||||||
[JsonProperty("gameplay_order")]
|
[JsonProperty("playlist_order")]
|
||||||
public int GameplayOrder { get; set; }
|
public ushort? PlaylistOrder { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public IBindable<bool> Valid => valid;
|
public IBindable<bool> Valid => valid;
|
||||||
|
@ -27,7 +27,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match.Playlist
|
|||||||
|
|
||||||
private class HistoryFillFlowContainer : FillFlowContainer<RearrangeableListItem<PlaylistItem>>
|
private class HistoryFillFlowContainer : FillFlowContainer<RearrangeableListItem<PlaylistItem>>
|
||||||
{
|
{
|
||||||
public override IEnumerable<Drawable> FlowingChildren => base.FlowingChildren.OfType<RearrangeableListItem<PlaylistItem>>().OrderByDescending(item => item.Model.GameplayOrder);
|
public override IEnumerable<Drawable> FlowingChildren => base.FlowingChildren.OfType<RearrangeableListItem<PlaylistItem>>().OrderByDescending(item => item.Model.PlaylistOrder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match.Playlist
|
|||||||
roomPlaylist.BindCollectionChanged((_, __) => InvalidateLayout());
|
roomPlaylist.BindCollectionChanged((_, __) => InvalidateLayout());
|
||||||
}
|
}
|
||||||
|
|
||||||
public override IEnumerable<Drawable> FlowingChildren => base.FlowingChildren.OfType<RearrangeableListItem<PlaylistItem>>().OrderBy(item => item.Model.GameplayOrder);
|
public override IEnumerable<Drawable> FlowingChildren => base.FlowingChildren.OfType<RearrangeableListItem<PlaylistItem>>().OrderBy(item => item.Model.PlaylistOrder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -316,7 +316,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
case QueueMode.HostOnly:
|
case QueueMode.HostOnly:
|
||||||
// In host-only mode, the current item is re-used.
|
// In host-only mode, the current item is re-used.
|
||||||
item.ID = currentItem.ID;
|
item.ID = currentItem.ID;
|
||||||
item.GameplayOrder = currentItem.GameplayOrder;
|
item.PlaylistOrder = currentItem.PlaylistOrder;
|
||||||
|
|
||||||
serverSidePlaylist[currentIndex] = item;
|
serverSidePlaylist[currentIndex] = item;
|
||||||
await ((IMultiplayerClient)this).PlaylistItemChanged(item).ConfigureAwait(false);
|
await ((IMultiplayerClient)this).PlaylistItemChanged(item).ConfigureAwait(false);
|
||||||
@ -488,10 +488,10 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
for (int i = 0; i < orderedItems.Count; i++)
|
for (int i = 0; i < orderedItems.Count; i++)
|
||||||
{
|
{
|
||||||
// Items which are already ordered correct don't need to be updated.
|
// Items which are already ordered correct don't need to be updated.
|
||||||
if (orderedItems[i].GameplayOrder == i)
|
if (orderedItems[i].PlaylistOrder == i)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
orderedItems[i].GameplayOrder = i;
|
orderedItems[i].PlaylistOrder = (ushort)i;
|
||||||
|
|
||||||
// Items which have an ID of 0 are not in the database, so avoid propagating database/hub events for them.
|
// Items which have an ID of 0 are not in the database, so avoid propagating database/hub events for them.
|
||||||
if (orderedItems[i].ID <= 0)
|
if (orderedItems[i].ID <= 0)
|
||||||
|
Reference in New Issue
Block a user