mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 17:52:56 +08:00
fixup! Convert BadgeDisplay to use bindable
This commit is contained in:
parent
e606c73329
commit
37e989fc64
@ -1,11 +1,12 @@
|
||||
// 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;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace osu.Game.Online.API.Requests.Responses
|
||||
{
|
||||
public class APIUpdateStream
|
||||
public class APIUpdateStream : IEquatable<APIUpdateStream>
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public long Id { get; set; }
|
||||
@ -21,5 +22,13 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
|
||||
[JsonProperty("latest_build")]
|
||||
public APIChangelogBuild LatestBuild { get; set; }
|
||||
|
||||
public bool Equals(APIUpdateStream other)
|
||||
{
|
||||
if (ReferenceEquals(null, other)) return false;
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
|
||||
return Id == other.Id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -64,22 +64,6 @@ namespace osu.Game.Overlays.Changelog
|
||||
}
|
||||
}
|
||||
|
||||
public void SelectNone()
|
||||
{
|
||||
Current.Value = null;
|
||||
|
||||
if (badgesContainer != null)
|
||||
{
|
||||
foreach (StreamBadge streamBadge in badgesContainer)
|
||||
{
|
||||
if (!IsHovered)
|
||||
streamBadge.Activate();
|
||||
else
|
||||
streamBadge.Deactivate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override bool OnHover(HoverEvent e)
|
||||
{
|
||||
foreach (StreamBadge streamBadge in badgesContainer.Children)
|
||||
|
@ -71,7 +71,12 @@ namespace osu.Game.Overlays
|
||||
header.ListingSelected += ShowListing;
|
||||
|
||||
// todo: better
|
||||
badges.Current.ValueChanged += e => ShowBuild(e.NewValue.LatestBuild);
|
||||
badges.Current.ValueChanged += e =>
|
||||
{
|
||||
if (e.NewValue?.LatestBuild != null)
|
||||
ShowBuild(e.NewValue.LatestBuild);
|
||||
};
|
||||
|
||||
listing.BuildSelected += ShowBuild;
|
||||
content.BuildSelected += ShowBuild;
|
||||
|
||||
@ -149,7 +154,7 @@ namespace osu.Game.Overlays
|
||||
header.ShowListing();
|
||||
|
||||
content.Hide();
|
||||
badges.SelectNone();
|
||||
badges.Current.Value = null;
|
||||
listing.Show();
|
||||
scroll.ScrollTo(savedScrollPosition);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user