mirror of
https://github.com/ppy/osu
synced 2025-03-31 23:58:37 +00:00
Add TotalCommentsCounter to CommentsContainer
This commit is contained in:
parent
f5b280971f
commit
6493f24547
@ -38,6 +38,7 @@ namespace osu.Game.Overlays.Comments
|
|||||||
private readonly FillFlowContainer content;
|
private readonly FillFlowContainer content;
|
||||||
private readonly DeletedChildrenPlaceholder deletedChildrenPlaceholder;
|
private readonly DeletedChildrenPlaceholder deletedChildrenPlaceholder;
|
||||||
private readonly CommentsShowMoreButton moreButton;
|
private readonly CommentsShowMoreButton moreButton;
|
||||||
|
private readonly TotalCommentsCounter commentCounter;
|
||||||
|
|
||||||
public CommentsContainer()
|
public CommentsContainer()
|
||||||
{
|
{
|
||||||
@ -56,6 +57,7 @@ namespace osu.Game.Overlays.Comments
|
|||||||
Direction = FillDirection.Vertical,
|
Direction = FillDirection.Vertical,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
|
commentCounter = new TotalCommentsCounter(),
|
||||||
new CommentsHeader
|
new CommentsHeader
|
||||||
{
|
{
|
||||||
Sort = { BindTarget = Sort },
|
Sort = { BindTarget = Sort },
|
||||||
@ -133,6 +135,7 @@ namespace osu.Game.Overlays.Comments
|
|||||||
if (!IsLoaded)
|
if (!IsLoaded)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
commentCounter.Current.Value = 0;
|
||||||
refetchComments();
|
refetchComments();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,6 +202,8 @@ namespace osu.Game.Overlays.Comments
|
|||||||
moreButton.IsLoading = false;
|
moreButton.IsLoading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
commentCounter.Current.Value = response.Total;
|
||||||
|
|
||||||
moreButton.FadeTo(response.HasMore ? 1 : 0);
|
moreButton.FadeTo(response.HasMore ? 1 : 0);
|
||||||
}, loadCancellation.Token);
|
}, loadCancellation.Token);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user