mirror of
https://github.com/osukey/osukey.git
synced 2025-05-29 09:27:18 +09:00
Use OverlayColourProfider for VotePill component
This commit is contained in:
parent
f1c97451d9
commit
54d83eff94
@ -7,6 +7,8 @@ using NUnit.Framework;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Overlays.Comments;
|
using osu.Game.Overlays.Comments;
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Game.Overlays;
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual.Online
|
namespace osu.Game.Tests.Visual.Online
|
||||||
{
|
{
|
||||||
@ -18,6 +20,9 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
typeof(VotePill)
|
typeof(VotePill)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
[Cached]
|
||||||
|
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue);
|
||||||
|
|
||||||
private VotePill votePill;
|
private VotePill votePill;
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -33,6 +33,9 @@ namespace osu.Game.Overlays.Comments
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private IAPIProvider api { get; set; }
|
private IAPIProvider api { get; set; }
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private OverlayColourProvider colourProvider { get; set; }
|
||||||
|
|
||||||
private readonly Comment comment;
|
private readonly Comment comment;
|
||||||
private Box background;
|
private Box background;
|
||||||
private Box hoverLayer;
|
private Box hoverLayer;
|
||||||
@ -68,7 +71,7 @@ namespace osu.Game.Overlays.Comments
|
|||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
isVoted.Value = comment.IsVoted;
|
isVoted.Value = comment.IsVoted;
|
||||||
votesCount.Value = comment.VotesCount;
|
votesCount.Value = comment.VotesCount;
|
||||||
isVoted.BindValueChanged(voted => background.Colour = voted.NewValue ? AccentColour : OsuColour.Gray(0.05f), true);
|
isVoted.BindValueChanged(voted => background.Colour = voted.NewValue ? AccentColour : colourProvider.Background6, true);
|
||||||
votesCount.BindValueChanged(count => votesCounter.Text = $"+{count.NewValue}", true);
|
votesCount.BindValueChanged(count => votesCounter.Text = $"+{count.NewValue}", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user