mirror of
https://github.com/osukey/osukey.git
synced 2025-08-02 22:26:41 +09:00
Make VotePill background transparent for own comments
This commit is contained in:
@ -36,8 +36,10 @@ namespace osu.Game.Overlays.Comments
|
||||
[Resolved]
|
||||
private OverlayColourProvider colourProvider { get; set; }
|
||||
|
||||
protected Box Background { get; private set; }
|
||||
|
||||
private readonly Comment comment;
|
||||
private Box background;
|
||||
|
||||
private Box hoverLayer;
|
||||
private CircularContainer borderContainer;
|
||||
private SpriteText sideNumber;
|
||||
@ -62,8 +64,12 @@ namespace osu.Game.Overlays.Comments
|
||||
AccentColour = borderContainer.BorderColour = sideNumber.Colour = colours.GreenLight;
|
||||
hoverLayer.Colour = Color4.Black.Opacity(0.5f);
|
||||
|
||||
if (api.IsLoggedIn && api.LocalUser.Value.Id != comment.UserId)
|
||||
var ownComment = api.LocalUser.Value.Id == comment.UserId;
|
||||
|
||||
if (api.IsLoggedIn && !ownComment)
|
||||
Action = onAction;
|
||||
|
||||
Background.Alpha = ownComment ? 0 : 1;
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
@ -71,7 +77,7 @@ namespace osu.Game.Overlays.Comments
|
||||
base.LoadComplete();
|
||||
isVoted.Value = comment.IsVoted;
|
||||
votesCount.Value = comment.VotesCount;
|
||||
isVoted.BindValueChanged(voted => background.Colour = voted.NewValue ? AccentColour : colourProvider.Background6, true);
|
||||
isVoted.BindValueChanged(voted => Background.Colour = voted.NewValue ? AccentColour : colourProvider.Background6, true);
|
||||
votesCount.BindValueChanged(count => votesCounter.Text = $"+{count.NewValue}", true);
|
||||
}
|
||||
|
||||
@ -102,7 +108,7 @@ namespace osu.Game.Overlays.Comments
|
||||
Masking = true,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
background = new Box
|
||||
Background = new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both
|
||||
},
|
||||
|
Reference in New Issue
Block a user