mirror of
https://github.com/osukey/osukey.git
synced 2025-05-12 17:17:31 +09: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 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,9 @@ namespace osu.Game.Overlays.Comments
|
|||||||
if (!IsLoaded)
|
if (!IsLoaded)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// only reset when changing ID/type. other refetch ops are generally just changing sort order.
|
||||||
|
commentCounter.Current.Value = 0;
|
||||||
|
|
||||||
refetchComments();
|
refetchComments();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,6 +204,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…
x
Reference in New Issue
Block a user