mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 14:46:38 +09:00
Code quality fixes
This commit is contained in:
@ -26,7 +26,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
[Cached]
|
||||
private readonly Bindable<Channel> selected = new Bindable<Channel>();
|
||||
|
||||
private static List<Channel> channels = new List<Channel>
|
||||
private static readonly List<Channel> channels = new List<Channel>
|
||||
{
|
||||
createPublicChannel("#public-channel"),
|
||||
createPublicChannel("#public-channel-long-name"),
|
||||
@ -90,7 +90,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
var item = new ControlItem(channel);
|
||||
flow.Add(item);
|
||||
channelMap.Add(channel, item);
|
||||
item.OnRequestSelect += channel => selected.Value = channel;
|
||||
item.OnRequestSelect += c => selected.Value = c;
|
||||
item.OnRequestLeave += leaveChannel;
|
||||
}
|
||||
});
|
||||
|
@ -95,7 +95,7 @@ namespace osu.Game.Overlays.Chat.ChannelControl
|
||||
},
|
||||
Content = new[]
|
||||
{
|
||||
new Drawable[]
|
||||
new[]
|
||||
{
|
||||
createAvatar(),
|
||||
text = new ControlItemText(channel)
|
||||
|
@ -15,7 +15,8 @@ namespace osu.Game.Overlays.Chat.ChannelControl
|
||||
{
|
||||
public class ControlItemMention : CircularContainer
|
||||
{
|
||||
private int mentionCount = 0;
|
||||
private int mentionCount;
|
||||
|
||||
public int MentionCount
|
||||
{
|
||||
get => mentionCount;
|
||||
@ -63,15 +64,12 @@ namespace osu.Game.Overlays.Chat.ChannelControl
|
||||
|
||||
private void updateText()
|
||||
{
|
||||
if (mentionCount > 99)
|
||||
countText!.Text = "99+";
|
||||
else
|
||||
countText!.Text = mentionCount.ToString();
|
||||
countText!.Text = MentionCount > 99 ? "99+" : MentionCount.ToString();
|
||||
|
||||
if (mentionCount > 0)
|
||||
this.Show();
|
||||
Show();
|
||||
else
|
||||
this.Hide();
|
||||
Hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,8 @@ namespace osu.Game.Overlays.Chat.ChannelControl
|
||||
{
|
||||
public class ControlItemText : Container
|
||||
{
|
||||
private bool hasUnread;
|
||||
|
||||
public bool HasUnread
|
||||
{
|
||||
get => hasUnread;
|
||||
@ -27,7 +29,6 @@ namespace osu.Game.Overlays.Chat.ChannelControl
|
||||
}
|
||||
}
|
||||
|
||||
private bool hasUnread = false;
|
||||
private OsuSpriteText? text;
|
||||
|
||||
[Resolved]
|
||||
|
Reference in New Issue
Block a user