mirror of
https://github.com/ppy/osu
synced 2025-01-19 20:40:52 +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() },
|
Status = { Value = new RoomStatusOpen() },
|
||||||
Category = { Value = RoomCategory.Spotlight },
|
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.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System.ComponentModel;
|
||||||
|
|
||||||
namespace osu.Game.Online.Rooms
|
namespace osu.Game.Online.Rooms
|
||||||
{
|
{
|
||||||
public enum RoomCategory
|
public enum RoomCategory
|
||||||
@ -8,5 +10,8 @@ namespace osu.Game.Online.Rooms
|
|||||||
// used for osu-web deserialization so names shouldn't be changed.
|
// used for osu-web deserialization so names shouldn't be changed.
|
||||||
Normal,
|
Normal,
|
||||||
Spotlight,
|
Spotlight,
|
||||||
|
|
||||||
|
[Description("Featured Artist")]
|
||||||
|
FeaturedArtist,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -237,7 +237,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
|||||||
roomCategory.BindTo(Room.Category);
|
roomCategory.BindTo(Room.Category);
|
||||||
roomCategory.BindValueChanged(c =>
|
roomCategory.BindValueChanged(c =>
|
||||||
{
|
{
|
||||||
if (c.NewValue == RoomCategory.Spotlight)
|
if (c.NewValue > RoomCategory.Normal)
|
||||||
specialCategoryPill.Show();
|
specialCategoryPill.Show();
|
||||||
else
|
else
|
||||||
specialCategoryPill.Hide();
|
specialCategoryPill.Hide();
|
||||||
|
@ -128,7 +128,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
|||||||
{
|
{
|
||||||
foreach (var room in roomFlow)
|
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.
|
// Always show spotlight playlists at the top of the listing.
|
||||||
? float.MinValue
|
? float.MinValue
|
||||||
: -(room.Room.RoomID.Value ?? 0));
|
: -(room.Room.RoomID.Value ?? 0));
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -49,6 +50,10 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
|
|||||||
case PlaylistsCategory.Spotlight:
|
case PlaylistsCategory.Spotlight:
|
||||||
criteria.Category = @"spotlight";
|
criteria.Category = @"spotlight";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PlaylistsCategory.FeaturedArtist:
|
||||||
|
criteria.Category = @"featured_artist";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return criteria;
|
return criteria;
|
||||||
@ -73,7 +78,10 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
|
|||||||
{
|
{
|
||||||
Any,
|
Any,
|
||||||
Normal,
|
Normal,
|
||||||
Spotlight
|
Spotlight,
|
||||||
|
|
||||||
|
[Description("Featured Artist")]
|
||||||
|
FeaturedArtist,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user