mirror of
https://github.com/ppy/osu
synced 2025-03-19 01:24:34 +00:00
Merge pull request #7592 from EVAST9919/comments-counter-integration
Add TotalCommentsCounter to CommentsContainer
This commit is contained in:
commit
4bab8bcdcc
@ -38,6 +38,7 @@ namespace osu.Game.Overlays.Comments
|
||||
private readonly FillFlowContainer content;
|
||||
private readonly DeletedChildrenPlaceholder deletedChildrenPlaceholder;
|
||||
private readonly CommentsShowMoreButton moreButton;
|
||||
private readonly TotalCommentsCounter commentCounter;
|
||||
|
||||
public CommentsContainer()
|
||||
{
|
||||
@ -56,6 +57,7 @@ namespace osu.Game.Overlays.Comments
|
||||
Direction = FillDirection.Vertical,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
commentCounter = new TotalCommentsCounter(),
|
||||
new CommentsHeader
|
||||
{
|
||||
Sort = { BindTarget = Sort },
|
||||
@ -133,6 +135,9 @@ namespace osu.Game.Overlays.Comments
|
||||
if (!IsLoaded)
|
||||
return;
|
||||
|
||||
// only reset when changing ID/type. other refetch ops are generally just changing sort order.
|
||||
commentCounter.Current.Value = 0;
|
||||
|
||||
refetchComments();
|
||||
}
|
||||
|
||||
@ -199,6 +204,8 @@ namespace osu.Game.Overlays.Comments
|
||||
moreButton.IsLoading = false;
|
||||
}
|
||||
|
||||
commentCounter.Current.Value = response.Total;
|
||||
|
||||
moreButton.FadeTo(response.HasMore ? 1 : 0);
|
||||
}, loadCancellation.Token);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user