1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 11:35:35 +08:00

Variant 3: cannot change history, cannot reset index (the "default")

This commit is contained in:
Terochi 2022-11-21 09:43:36 +01:00
parent 672e1cd45b
commit 58288275a6
2 changed files with 1 additions and 6 deletions

View File

@ -72,7 +72,7 @@ namespace osu.Game.Tests.Visual.UserInterface
AddStep("Change text", () => box.Text = "New message");
AddStep("Move down", () => InputManager.Key(Key.Down));
AddStep("Move up", () => InputManager.Key(Key.Up));
AddAssert("Changes kept", () => box.Text == "New message");
AddAssert("Changes lost", () => box.Text == "Message 2");
}
[Test]

View File

@ -45,8 +45,6 @@ namespace osu.Game.Graphics.UserInterface
if (selectedIndex == HistoryCount)
originalMessage = Text;
else if (!string.IsNullOrEmpty(Text))
messageHistory[selectedIndex] = Text;
Text = messageHistory[--selectedIndex];
@ -56,9 +54,6 @@ namespace osu.Game.Graphics.UserInterface
if (selectedIndex == HistoryCount)
return true;
if (!string.IsNullOrEmpty(Text))
messageHistory[selectedIndex] = Text;
if (selectedIndex == HistoryCount - 1)
{
selectedIndex = HistoryCount;