mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 12:57:39 +09:00
Moved and renamed MessageHistoryTextBox.cs for better fit.
This commit is contained in:
parent
b9590320b7
commit
6d83af01e2
@ -3,12 +3,11 @@
|
|||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
using osu.Game.Graphics.UserInterface;
|
|
||||||
using osuTK.Input;
|
using osuTK.Input;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Chat
|
namespace osu.Game.Graphics.UserInterface
|
||||||
{
|
{
|
||||||
public class ChatRecentTextBox : FocusedTextBox
|
public class MessageHistoryTextBox : FocusedTextBox
|
||||||
{
|
{
|
||||||
private readonly List<string> messageHistory = new List<string>();
|
private readonly List<string> messageHistory = new List<string>();
|
||||||
|
|
||||||
@ -16,6 +15,15 @@ namespace osu.Game.Overlays.Chat
|
|||||||
|
|
||||||
private string originalMessage = string.Empty;
|
private string originalMessage = string.Empty;
|
||||||
|
|
||||||
|
public MessageHistoryTextBox()
|
||||||
|
{
|
||||||
|
Current.ValueChanged += text =>
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(text.NewValue))
|
||||||
|
messageIndex = -1;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
protected override bool OnKeyDown(KeyDownEvent e)
|
protected override bool OnKeyDown(KeyDownEvent e)
|
||||||
{
|
{
|
||||||
/* Behavior:
|
/* Behavior:
|
||||||
@ -53,12 +61,7 @@ namespace osu.Game.Overlays.Chat
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool onKeyDown = base.OnKeyDown(e);
|
return base.OnKeyDown(e);
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(Text))
|
|
||||||
messageIndex = -1;
|
|
||||||
|
|
||||||
return onKeyDown;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Commit()
|
protected override void Commit()
|
@ -12,6 +12,7 @@ using osu.Framework.Graphics.Shapes;
|
|||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Overlays.Chat;
|
using osu.Game.Overlays.Chat;
|
||||||
using osu.Game.Resources.Localisation.Web;
|
using osu.Game.Resources.Localisation.Web;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
@ -119,7 +120,7 @@ namespace osu.Game.Online.Chat
|
|||||||
AddInternal(drawableChannel);
|
AddInternal(drawableChannel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ChatTextBox : ChatRecentTextBox
|
public class ChatTextBox : MessageHistoryTextBox
|
||||||
{
|
{
|
||||||
protected override bool OnKeyDown(KeyDownEvent e)
|
protected override bool OnKeyDown(KeyDownEvent e)
|
||||||
{
|
{
|
||||||
|
@ -2,11 +2,12 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Resources.Localisation.Web;
|
using osu.Game.Resources.Localisation.Web;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Chat
|
namespace osu.Game.Overlays.Chat
|
||||||
{
|
{
|
||||||
public class ChatTextBox : ChatRecentTextBox
|
public class ChatTextBox : MessageHistoryTextBox
|
||||||
{
|
{
|
||||||
public readonly BindableBool ShowSearch = new BindableBool();
|
public readonly BindableBool ShowSearch = new BindableBool();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user