- script update for key bindings.

This commit is contained in:
Christoph Oelckers 2020-10-04 19:39:37 +02:00
parent 7be2d44108
commit 4790773ec2
2 changed files with 8 additions and 5 deletions

View file

@ -2,8 +2,11 @@
struct KeyBindings native version("2.4")
{
native static String NameKeys(int k1, int k2);
native static String NameAllKeys(array<int> list);
native int, int GetKeysForCommand(String cmd);
native void GetAllKeysForCommand(out array<int> list, String cmd);
native void SetBind(int key, String cmd);
native void UnbindACommand (String str);
}

View file

@ -506,10 +506,10 @@ class OptionMenuItemControlBase : OptionMenuItem
(selected ? OptionMenuSettings.mFontColorSelection : OptionMenuSettings.mFontColor));
String description;
int Key1, Key2;
Array<int> keys;
[Key1, Key2] = mBindings.GetKeysForCommand(mAction);
description = KeyBindings.NameKeys (Key1, Key2);
mBindings.GetAllKeysForCommand(keys, mAction);
description = KeyBindings.NameAllKeys(keys);
if (description.Length() > 0)
{
drawValue(indent, y, Font.CR_WHITE, description);