Added tab completion to in-game chat.

Both player names and chat commands can be completed.
Names of local players and bots are not candidates for completion.
If a completed name is the first word ": " is appended to the end.
The hotkey for toggling team/all chat has been moved to left Alt.
This commit is contained in:
Alexander Fast
2014-08-19 17:10:04 +02:00
parent 520df8242d
commit 034625c2ea
2 changed files with 57 additions and 2 deletions

View File

@@ -30,6 +30,7 @@ namespace OpenRA.Widgets
public Func<bool> OnEnterKey = () => false;
public Func<bool> OnTabKey = () => false;
public Func<bool> OnEscKey = () => false;
public Func<bool> OnAltKey = () => false;
public Action OnLoseFocus = () => { };
public Action OnTextEdited = () => { };
public int CursorPosition { get; set; }
@@ -121,6 +122,9 @@ namespace OpenRA.Widgets
if (e.Key == Keycode.ESCAPE && OnEscKey())
return true;
if (e.Key == Keycode.LALT && OnAltKey())
return true;
if (e.Key == Keycode.LEFT)
{
if (CursorPosition > 0)