Added tab completion to lobby chat.

Also fixes accidental reversion of one word logic during cleanup.
Fields that could be readonly are now readonly.
This commit is contained in:
Alexander Fast
2014-08-19 22:48:51 +02:00
parent ab61830d0f
commit 3160fa40f6
2 changed files with 67 additions and 13 deletions

View File

@@ -190,10 +190,10 @@ namespace OpenRA.Mods.RA.Widgets.Logic
}
else
{
var oneWord = chatText.Text.Contains(' ');
var oneWord = !chatText.Text.Contains(' ');
var toComplete = oneWord
? chatText.Text.Substring(chatText.Text.LastIndexOf(' ') + 1)
: chatText.Text;
? chatText.Text
: chatText.Text.Substring(chatText.Text.LastIndexOf(' ') + 1);
suggestion = playerNames.FirstOrDefault(x => x.StartsWith(toComplete, StringComparison.InvariantCultureIgnoreCase));
if (suggestion == null)