mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 00:09:55 +09:00
Variant 5: cannot change history, edit resets index
This commit is contained in:
@ -22,7 +22,6 @@ namespace osu.Game.Graphics.UserInterface
|
||||
private int selectedIndex;
|
||||
|
||||
private string originalMessage = string.Empty;
|
||||
private bool everythingSelected;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="HistoryTextBox"/>.
|
||||
@ -37,28 +36,13 @@ namespace osu.Game.Graphics.UserInterface
|
||||
|
||||
Current.ValueChanged += text =>
|
||||
{
|
||||
if (string.IsNullOrEmpty(text.NewValue) || everythingSelected)
|
||||
if (selectedIndex != HistoryCount && text.NewValue != messageHistory[selectedIndex])
|
||||
{
|
||||
selectedIndex = HistoryCount;
|
||||
everythingSelected = false;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
protected override void OnTextDeselected()
|
||||
{
|
||||
base.OnTextDeselected();
|
||||
|
||||
everythingSelected = false;
|
||||
}
|
||||
|
||||
protected override void OnTextSelectionChanged(TextSelectionType selectionType)
|
||||
{
|
||||
base.OnTextSelectionChanged(selectionType);
|
||||
|
||||
everythingSelected = SelectedText == Text;
|
||||
}
|
||||
|
||||
protected override bool OnKeyDown(KeyDownEvent e)
|
||||
{
|
||||
switch (e.Key)
|
||||
@ -67,8 +51,6 @@ namespace osu.Game.Graphics.UserInterface
|
||||
if (selectedIndex == 0)
|
||||
return true;
|
||||
|
||||
everythingSelected = false;
|
||||
|
||||
if (selectedIndex == HistoryCount)
|
||||
originalMessage = Text;
|
||||
|
||||
@ -80,8 +62,6 @@ namespace osu.Game.Graphics.UserInterface
|
||||
if (selectedIndex == HistoryCount)
|
||||
return true;
|
||||
|
||||
everythingSelected = false;
|
||||
|
||||
if (selectedIndex == HistoryCount - 1)
|
||||
{
|
||||
selectedIndex = HistoryCount;
|
||||
|
Reference in New Issue
Block a user