mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 12:57:39 +09:00
Make loadedReplies dictionary private
This commit is contained in:
parent
5201c1c87b
commit
c6f8e157fd
@ -133,7 +133,7 @@ namespace osu.Game.Overlays.Comments
|
|||||||
// We may receive already loaded comments
|
// We may receive already loaded comments
|
||||||
receivedComments.ForEach(c =>
|
receivedComments.ForEach(c =>
|
||||||
{
|
{
|
||||||
if (!drawableComment.LoadedReplies.ContainsKey(c.Id))
|
if (!drawableComment.ContainsReply(c.Id))
|
||||||
uniqueComments.Add(c);
|
uniqueComments.Add(c);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ namespace osu.Game.Overlays.Comments
|
|||||||
|
|
||||||
public readonly BindableBool ShowDeleted = new BindableBool();
|
public readonly BindableBool ShowDeleted = new BindableBool();
|
||||||
public readonly Bindable<CommentsSortCriteria> Sort = new Bindable<CommentsSortCriteria>();
|
public readonly Bindable<CommentsSortCriteria> Sort = new Bindable<CommentsSortCriteria>();
|
||||||
public readonly Dictionary<long, Comment> LoadedReplies = new Dictionary<long, Comment>();
|
private readonly Dictionary<long, Comment> loadedReplies = new Dictionary<long, Comment>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <see cref="DrawableComment"/>s which will be added to this <see cref="DrawableComment"/> as replies on initial load.
|
/// <see cref="DrawableComment"/>s which will be added to this <see cref="DrawableComment"/> as replies on initial load.
|
||||||
@ -290,6 +290,8 @@ namespace osu.Game.Overlays.Comments
|
|||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool ContainsReply(long replyId) => loadedReplies.ContainsKey(replyId);
|
||||||
|
|
||||||
public void AddReplies(IEnumerable<DrawableComment> replies)
|
public void AddReplies(IEnumerable<DrawableComment> replies)
|
||||||
{
|
{
|
||||||
if (LoadState == LoadState.NotLoaded)
|
if (LoadState == LoadState.NotLoaded)
|
||||||
@ -311,7 +313,7 @@ namespace osu.Game.Overlays.Comments
|
|||||||
childCommentsContainer.Add(page);
|
childCommentsContainer.Add(page);
|
||||||
|
|
||||||
var newReplies = replies.Select(reply => reply.Comment);
|
var newReplies = replies.Select(reply => reply.Comment);
|
||||||
newReplies.ForEach(reply => LoadedReplies.Add(reply.Id, reply));
|
newReplies.ForEach(reply => loadedReplies.Add(reply.Id, reply));
|
||||||
deletedCommentsCounter.Count.Value += newReplies.Count(reply => reply.IsDeleted);
|
deletedCommentsCounter.Count.Value += newReplies.Count(reply => reply.IsDeleted);
|
||||||
updateButtonsState();
|
updateButtonsState();
|
||||||
}
|
}
|
||||||
@ -326,7 +328,7 @@ namespace osu.Game.Overlays.Comments
|
|||||||
|
|
||||||
private void updateButtonsState()
|
private void updateButtonsState()
|
||||||
{
|
{
|
||||||
var loadedReplesCount = LoadedReplies.Count;
|
var loadedReplesCount = loadedReplies.Count;
|
||||||
var hasUnloadedReplies = loadedReplesCount != Comment.RepliesCount;
|
var hasUnloadedReplies = loadedReplesCount != Comment.RepliesCount;
|
||||||
|
|
||||||
loadMoreCommentsButton.FadeTo(hasUnloadedReplies && loadedReplesCount == 0 ? 1 : 0);
|
loadMoreCommentsButton.FadeTo(hasUnloadedReplies && loadedReplesCount == 0 ? 1 : 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user