closes #2874: improved ingame chat
This commit is contained in:
@@ -31,6 +31,7 @@ namespace OpenRA.Widgets
|
||||
|
||||
public Func<bool> OnEnterKey = () => false;
|
||||
public Func<bool> OnTabKey = () => false;
|
||||
public Func<bool> OnEscKey = () => false;
|
||||
public Action OnLoseFocus = () => { };
|
||||
public int CursorPosition { get; protected set; }
|
||||
|
||||
@@ -121,6 +122,9 @@ namespace OpenRA.Widgets
|
||||
if (e.KeyName == "tab" && OnTabKey())
|
||||
return true;
|
||||
|
||||
if (e.KeyName == "escape" && OnEscKey())
|
||||
return true;
|
||||
|
||||
if (e.KeyName == "left")
|
||||
{
|
||||
if (CursorPosition > 0)
|
||||
|
||||
@@ -403,6 +403,8 @@ namespace OpenRA.Widgets
|
||||
|
||||
public override string GetCursor(int2 pos) { return null; }
|
||||
public override Widget Clone() { return new ContainerWidget(this); }
|
||||
public Func<KeyInput, bool> OnKeyPress = _ => false;
|
||||
public override bool HandleKeyPress(KeyInput e) { return OnKeyPress(e); }
|
||||
}
|
||||
|
||||
public class WidgetArgs : Dictionary<string, object>
|
||||
|
||||
Reference in New Issue
Block a user