mirror of
https://github.com/osukey/osukey.git
synced 2025-05-25 23:47:30 +09:00
Use BindTarget
instead of caching for ControlItem
mentions bindable flow
This commit is contained in:
parent
481b8fe80b
commit
49b74d7867
@ -20,7 +20,6 @@ namespace osu.Game.Overlays.Chat.ChannelControl
|
|||||||
public event Action<Channel>? OnRequestSelect;
|
public event Action<Channel>? OnRequestSelect;
|
||||||
public event Action<Channel>? OnRequestLeave;
|
public event Action<Channel>? OnRequestLeave;
|
||||||
|
|
||||||
[Cached]
|
|
||||||
public readonly BindableInt Mentions = new BindableInt();
|
public readonly BindableInt Mentions = new BindableInt();
|
||||||
|
|
||||||
[Cached]
|
[Cached]
|
||||||
@ -92,6 +91,7 @@ namespace osu.Game.Overlays.Chat.ChannelControl
|
|||||||
Anchor = Anchor.CentreLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
Origin = Anchor.CentreLeft,
|
Origin = Anchor.CentreLeft,
|
||||||
Margin = new MarginPadding { Right = 3 },
|
Margin = new MarginPadding { Right = 3 },
|
||||||
|
Mentions = { BindTarget = Mentions },
|
||||||
},
|
},
|
||||||
close = new ControlItemClose
|
close = new ControlItemClose
|
||||||
{
|
{
|
||||||
|
@ -16,10 +16,9 @@ namespace osu.Game.Overlays.Chat.ChannelControl
|
|||||||
{
|
{
|
||||||
public class ControlItemMention : CircularContainer
|
public class ControlItemMention : CircularContainer
|
||||||
{
|
{
|
||||||
private OsuSpriteText? countText;
|
public readonly BindableInt Mentions = new BindableInt();
|
||||||
|
|
||||||
[Resolved]
|
private OsuSpriteText? countText;
|
||||||
private BindableInt mentions { get; set; } = null!;
|
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private OsuColour osuColour { get; set; } = null!;
|
private OsuColour osuColour { get; set; } = null!;
|
||||||
@ -56,7 +55,7 @@ namespace osu.Game.Overlays.Chat.ChannelControl
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
mentions.BindValueChanged(change =>
|
Mentions.BindValueChanged(change =>
|
||||||
{
|
{
|
||||||
int mentionCount = change.NewValue;
|
int mentionCount = change.NewValue;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user