1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 16:07:24 +08:00

Merge pull request #2695 from Joehuu/match-panel-with-web

Add storyboard icon and fix preview button overlap on direct panels
This commit is contained in:
Dean Herbert 2018-06-01 22:49:45 +09:00 committed by GitHub
commit 53b11155d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 13 deletions

@ -1 +1 @@
Subproject commit aebfa5bc5c634c1fd0c103e0c17518e5111a67c7 Subproject commit 804a4b81b89cb4569af5221e6fa2296d559c28fb

View File

@ -36,6 +36,11 @@ namespace osu.Game.Beatmaps
/// </summary> /// </summary>
public bool HasVideo { get; set; } public bool HasVideo { get; set; }
/// <summary>
/// Whether or not this beatmap set has a storyboard.
/// </summary>
public bool HasStoryboard { get; set; }
/// <summary> /// <summary>
/// The different sizes of cover art for this beatmap set. /// The different sizes of cover art for this beatmap set.
/// </summary> /// </summary>

View File

@ -30,6 +30,9 @@ namespace osu.Game.Online.API.Requests
[JsonProperty(@"video")] [JsonProperty(@"video")]
private bool hasVideo { get; set; } private bool hasVideo { get; set; }
[JsonProperty(@"storyboard")]
private bool hasStoryboard { get; set; }
[JsonProperty(@"status")] [JsonProperty(@"status")]
private BeatmapSetOnlineStatus status { get; set; } private BeatmapSetOnlineStatus status { get; set; }
@ -65,6 +68,7 @@ namespace osu.Game.Online.API.Requests
BPM = bpm, BPM = bpm,
Status = status, Status = status,
HasVideo = hasVideo, HasVideo = hasVideo,
HasStoryboard = hasStoryboard,
Submitted = submitted, Submitted = submitted,
Ranked = ranked, Ranked = ranked,
LastUpdated = lastUpdated, LastUpdated = lastUpdated,

View File

@ -149,7 +149,7 @@ namespace osu.Game.Overlays.Direct
{ {
new OsuSpriteText new OsuSpriteText
{ {
Text = $"from {SetInfo.Metadata.Source}", Text = $"{SetInfo.Metadata.Source}",
TextSize = 14, TextSize = 14,
Shadow = false, Shadow = false,
Colour = colours.Gray5, Colour = colours.Gray5,
@ -195,18 +195,18 @@ namespace osu.Game.Overlays.Direct
new Statistic(FontAwesome.fa_heart, SetInfo.OnlineInfo?.FavouriteCount ?? 0), new Statistic(FontAwesome.fa_heart, SetInfo.OnlineInfo?.FavouriteCount ?? 0),
}, },
}, },
playButton = new PlayButton(SetInfo)
{
Margin = new MarginPadding { Top = 5, Left = 10 },
Size = new Vector2(30),
Alpha = 0,
},
statusContainer = new FillFlowContainer statusContainer = new FillFlowContainer
{ {
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Margin = new MarginPadding { Top = 5, Left = 5 }, Margin = new MarginPadding { Top = 5, Left = 5 },
Spacing = new Vector2(5), Spacing = new Vector2(5),
}, },
playButton = new PlayButton(SetInfo)
{
Margin = new MarginPadding { Top = 5, Left = 10 },
Size = new Vector2(30),
Alpha = 0,
},
}); });
if (SetInfo.OnlineInfo?.HasVideo ?? false) if (SetInfo.OnlineInfo?.HasVideo ?? false)
@ -214,24 +214,31 @@ namespace osu.Game.Overlays.Direct
statusContainer.Add(new IconPill(FontAwesome.fa_film)); statusContainer.Add(new IconPill(FontAwesome.fa_film));
} }
if (SetInfo.OnlineInfo?.HasStoryboard ?? false)
{
statusContainer.Add(new IconPill(FontAwesome.fa_image));
}
statusContainer.Add(new BeatmapSetOnlineStatusPill(12, new MarginPadding { Horizontal = 10, Vertical = 5 }) statusContainer.Add(new BeatmapSetOnlineStatusPill(12, new MarginPadding { Horizontal = 10, Vertical = 5 })
{ {
Status = SetInfo.OnlineInfo?.Status ?? BeatmapSetOnlineStatus.None, Status = SetInfo.OnlineInfo?.Status ?? BeatmapSetOnlineStatus.None,
}); });
PreviewPlaying.ValueChanged += _ => updateStatusContainer();
} }
protected override bool OnHover(InputState state) protected override bool OnHover(InputState state)
{ {
statusContainer.FadeOut(120, Easing.InOutQuint); updateStatusContainer();
return base.OnHover(state); return base.OnHover(state);
} }
protected override void OnHoverLost(InputState state) protected override void OnHoverLost(InputState state)
{ {
base.OnHoverLost(state); base.OnHoverLost(state);
updateStatusContainer();
statusContainer.FadeIn(120, Easing.InOutQuint);
} }
private void updateStatusContainer() => statusContainer.FadeTo(IsHovered || PreviewPlaying ? 0 : 1, 120, Easing.InOutQuint);
} }
} }

View File

@ -126,7 +126,7 @@ namespace osu.Game.Overlays.Direct
return; return;
} }
icon.Icon = playing ? FontAwesome.fa_pause : FontAwesome.fa_play; icon.Icon = playing ? FontAwesome.fa_stop : FontAwesome.fa_play;
icon.FadeColour(playing || IsHovered ? hoverColour : Color4.White, 120, Easing.InOutQuint); icon.FadeColour(playing || IsHovered ? hoverColour : Color4.White, 120, Easing.InOutQuint);
if (playing) if (playing)