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