mirror of
https://github.com/ppy/osu
synced 2025-01-01 11:52:20 +00:00
Add featured artist playlist category
This commit is contained in:
parent
5657cb757d
commit
ef47b380c6
@ -124,6 +124,12 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
Status = { Value = new RoomStatusOpen() },
|
||||
Category = { Value = RoomCategory.Spotlight },
|
||||
}),
|
||||
createLoungeRoom(new Room
|
||||
{
|
||||
Name = { Value = "Featured artist room" },
|
||||
Status = { Value = new RoomStatusOpen() },
|
||||
Category = { Value = RoomCategory.FeaturedArtist },
|
||||
}),
|
||||
}
|
||||
};
|
||||
});
|
||||
|
@ -1,6 +1,8 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace osu.Game.Online.Rooms
|
||||
{
|
||||
public enum RoomCategory
|
||||
@ -8,5 +10,8 @@ namespace osu.Game.Online.Rooms
|
||||
// used for osu-web deserialization so names shouldn't be changed.
|
||||
Normal,
|
||||
Spotlight,
|
||||
|
||||
[Description("Featured Artist")]
|
||||
FeaturedArtist,
|
||||
}
|
||||
}
|
||||
|
@ -237,7 +237,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
||||
roomCategory.BindTo(Room.Category);
|
||||
roomCategory.BindValueChanged(c =>
|
||||
{
|
||||
if (c.NewValue == RoomCategory.Spotlight)
|
||||
if (c.NewValue > RoomCategory.Normal)
|
||||
specialCategoryPill.Show();
|
||||
else
|
||||
specialCategoryPill.Hide();
|
||||
|
@ -128,7 +128,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
||||
{
|
||||
foreach (var room in roomFlow)
|
||||
{
|
||||
roomFlow.SetLayoutPosition(room, room.Room.Category.Value == RoomCategory.Spotlight
|
||||
roomFlow.SetLayoutPosition(room, room.Room.Category.Value > RoomCategory.Normal
|
||||
// Always show spotlight playlists at the top of the listing.
|
||||
? float.MinValue
|
||||
: -(room.Room.RoomID.Value ?? 0));
|
||||
|
@ -2,6 +2,7 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
@ -49,6 +50,10 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
|
||||
case PlaylistsCategory.Spotlight:
|
||||
criteria.Category = @"spotlight";
|
||||
break;
|
||||
|
||||
case PlaylistsCategory.FeaturedArtist:
|
||||
criteria.Category = @"featured_artist";
|
||||
break;
|
||||
}
|
||||
|
||||
return criteria;
|
||||
@ -73,7 +78,10 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
|
||||
{
|
||||
Any,
|
||||
Normal,
|
||||
Spotlight
|
||||
Spotlight,
|
||||
|
||||
[Description("Featured Artist")]
|
||||
FeaturedArtist,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user