mirror of
https://github.com/osukey/osukey.git
synced 2025-05-30 01:47:30 +09:00
Merge pull request #9493 from peppy/highlight-spotlight-rooms
This commit is contained in:
commit
b59183df54
@ -34,7 +34,8 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
RoomID = { Value = i },
|
RoomID = { Value = i },
|
||||||
Name = { Value = $"Room {i}" },
|
Name = { Value = $"Room {i}" },
|
||||||
Host = { Value = new User { Username = "Host" } },
|
Host = { Value = new User { Username = "Host" } },
|
||||||
EndDate = { Value = DateTimeOffset.Now + TimeSpan.FromSeconds(10) }
|
EndDate = { Value = DateTimeOffset.Now + TimeSpan.FromSeconds(10) },
|
||||||
|
Category = { Value = i % 2 == 0 ? RoomCategory.Spotlight : RoomCategory.Normal }
|
||||||
};
|
};
|
||||||
|
|
||||||
if (ruleset != null)
|
if (ruleset != null)
|
||||||
|
@ -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 Humanizer;
|
||||||
using osu.Framework.IO.Network;
|
using osu.Framework.IO.Network;
|
||||||
using osu.Game.Online.Multiplayer;
|
using osu.Game.Online.Multiplayer;
|
||||||
using osu.Game.Screens.Multi.Lounge.Components;
|
using osu.Game.Screens.Multi.Lounge.Components;
|
||||||
@ -23,27 +24,11 @@ namespace osu.Game.Online.API.Requests
|
|||||||
{
|
{
|
||||||
var req = base.CreateWebRequest();
|
var req = base.CreateWebRequest();
|
||||||
|
|
||||||
switch (statusFilter)
|
if (statusFilter != RoomStatusFilter.Open)
|
||||||
{
|
req.AddParameter("mode", statusFilter.ToString().Underscore().ToLowerInvariant());
|
||||||
case RoomStatusFilter.Owned:
|
|
||||||
req.AddParameter("mode", "owned");
|
|
||||||
break;
|
|
||||||
|
|
||||||
case RoomStatusFilter.Participated:
|
if (categoryFilter != RoomCategoryFilter.Any)
|
||||||
req.AddParameter("mode", "participated");
|
req.AddParameter("category", categoryFilter.ToString().Underscore().ToLowerInvariant());
|
||||||
break;
|
|
||||||
|
|
||||||
case RoomStatusFilter.RecentlyEnded:
|
|
||||||
req.AddParameter("mode", "ended");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (categoryFilter)
|
|
||||||
{
|
|
||||||
case RoomCategoryFilter.Spotlight:
|
|
||||||
req.AddParameter("category", "spotlight");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return req;
|
return req;
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,10 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
[JsonProperty("channel_id")]
|
[JsonProperty("channel_id")]
|
||||||
public readonly Bindable<int> ChannelId = new Bindable<int>();
|
public readonly Bindable<int> ChannelId = new Bindable<int>();
|
||||||
|
|
||||||
|
[Cached]
|
||||||
|
[JsonProperty("category")]
|
||||||
|
public readonly Bindable<RoomCategory> Category = new Bindable<RoomCategory>();
|
||||||
|
|
||||||
[Cached]
|
[Cached]
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public readonly Bindable<TimeSpan> Duration = new Bindable<TimeSpan>(TimeSpan.FromMinutes(30));
|
public readonly Bindable<TimeSpan> Duration = new Bindable<TimeSpan>(TimeSpan.FromMinutes(30));
|
||||||
|
11
osu.Game/Online/Multiplayer/RoomCategory.cs
Normal file
11
osu.Game/Online/Multiplayer/RoomCategory.cs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
namespace osu.Game.Online.Multiplayer
|
||||||
|
{
|
||||||
|
public enum RoomCategory
|
||||||
|
{
|
||||||
|
Normal,
|
||||||
|
Spotlight
|
||||||
|
}
|
||||||
|
}
|
@ -17,6 +17,9 @@ namespace osu.Game.Screens.Multi.Components
|
|||||||
[Resolved(typeof(Room), nameof(Room.Status))]
|
[Resolved(typeof(Room), nameof(Room.Status))]
|
||||||
private Bindable<RoomStatus> status { get; set; }
|
private Bindable<RoomStatus> status { get; set; }
|
||||||
|
|
||||||
|
[Resolved(typeof(Room), nameof(Room.Category))]
|
||||||
|
private Bindable<RoomCategory> category { get; set; }
|
||||||
|
|
||||||
public StatusColouredContainer(double transitionDuration = 100)
|
public StatusColouredContainer(double transitionDuration = 100)
|
||||||
{
|
{
|
||||||
this.transitionDuration = transitionDuration;
|
this.transitionDuration = transitionDuration;
|
||||||
@ -25,7 +28,11 @@ namespace osu.Game.Screens.Multi.Components
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
status.BindValueChanged(s => this.FadeColour(s.NewValue.GetAppropriateColour(colours), transitionDuration), true);
|
status.BindValueChanged(s =>
|
||||||
|
{
|
||||||
|
this.FadeColour(category.Value == RoomCategory.Spotlight ? colours.Pink : s.NewValue.GetAppropriateColour(colours)
|
||||||
|
, transitionDuration);
|
||||||
|
}, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -107,6 +107,8 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
|
float stripWidth = side_strip_width * (Room.Category.Value == RoomCategory.Spotlight ? 2 : 1);
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new StatusColouredContainer(transition_duration)
|
new StatusColouredContainer(transition_duration)
|
||||||
@ -139,7 +141,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
new StatusColouredContainer(transition_duration)
|
new StatusColouredContainer(transition_duration)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Y,
|
RelativeSizeAxes = Axes.Y,
|
||||||
Width = side_strip_width,
|
Width = stripWidth,
|
||||||
Child = new Box { RelativeSizeAxes = Axes.Both }
|
Child = new Box { RelativeSizeAxes = Axes.Both }
|
||||||
},
|
},
|
||||||
new Container
|
new Container
|
||||||
@ -147,7 +149,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
RelativeSizeAxes = Axes.Y,
|
RelativeSizeAxes = Axes.Y,
|
||||||
Width = cover_width,
|
Width = cover_width,
|
||||||
Masking = true,
|
Masking = true,
|
||||||
Margin = new MarginPadding { Left = side_strip_width },
|
Margin = new MarginPadding { Left = stripWidth },
|
||||||
Child = new MultiplayerBackgroundSprite(BeatmapSetCoverType.List) { RelativeSizeAxes = Axes.Both }
|
Child = new MultiplayerBackgroundSprite(BeatmapSetCoverType.List) { RelativeSizeAxes = Axes.Both }
|
||||||
},
|
},
|
||||||
new Container
|
new Container
|
||||||
@ -156,7 +158,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
Padding = new MarginPadding
|
Padding = new MarginPadding
|
||||||
{
|
{
|
||||||
Vertical = content_padding,
|
Vertical = content_padding,
|
||||||
Left = side_strip_width + cover_width + content_padding,
|
Left = stripWidth + cover_width + content_padding,
|
||||||
Right = content_padding,
|
Right = content_padding,
|
||||||
},
|
},
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
|
@ -74,7 +74,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
Open,
|
Open,
|
||||||
|
|
||||||
[Description("Recently Ended")]
|
[Description("Recently Ended")]
|
||||||
RecentlyEnded,
|
Ended,
|
||||||
Participated,
|
Participated,
|
||||||
Owned,
|
Owned,
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user