1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-06 07:42:55 +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("Change text", () => box.Text = "New message");
AddStep("Move down", () => InputManager.Key(Key.Down)); AddStep("Move down", () => InputManager.Key(Key.Down));
AddStep("Move up", () => InputManager.Key(Key.Up)); AddStep("Move up", () => InputManager.Key(Key.Up));
AddAssert("Changes kept", () => box.Text == "New message"); AddAssert("Changes lost", () => box.Text == "Message 2");
} }
[Test] [Test]

View File

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