mirror of
https://github.com/ppy/osu.git
synced 2025-03-18 06:27:18 +08:00
Use Action<string>
for event OnChatMessageCommitted
& clear textbox internally
This commit is contained in:
parent
9e152cd3fd
commit
94fa5e2ef2
@ -88,11 +88,10 @@ namespace osu.Game.Tests.Visual.Online
|
||||
},
|
||||
};
|
||||
|
||||
bar.OnChatMessageCommit += (sender, newText) =>
|
||||
bar.OnChatMessageCommitted += text =>
|
||||
{
|
||||
commitText.Text = $"OnChatMessageCommit: {sender.Text}";
|
||||
commitText.Text = $"OnChatMessageCommitted: {text}";
|
||||
commitText.FadeOutFromOne(1000, Easing.InQuint);
|
||||
sender.Text = string.Empty;
|
||||
};
|
||||
|
||||
bar.OnSearchTermsChanged += text =>
|
||||
|
@ -21,7 +21,7 @@ namespace osu.Game.Overlays.Chat
|
||||
{
|
||||
public readonly BindableBool ShowSearch = new BindableBool();
|
||||
|
||||
public event TextBox.OnCommitHandler? OnChatMessageCommit;
|
||||
public event Action<string>? OnChatMessageCommitted;
|
||||
|
||||
public event Action<string>? OnSearchTermsChanged;
|
||||
|
||||
@ -154,7 +154,9 @@ namespace osu.Game.Overlays.Chat
|
||||
private void chatTextBoxCommit(TextBox sender, bool newText)
|
||||
{
|
||||
if (!ShowSearch.Value)
|
||||
OnChatMessageCommit?.Invoke(sender, newText);
|
||||
OnChatMessageCommitted?.Invoke(sender.Text);
|
||||
|
||||
sender.Text = string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user