mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-29 07:12:36 +00:00
- changed display in key binding menu to list all bound keys for an action, not just the first two.
This commit is contained in:
parent
f6eac89677
commit
63a338fd73
3 changed files with 25 additions and 5 deletions
|
@ -569,6 +569,14 @@ DEFINE_ACTION_FUNCTION(FKeyBindings, NameKeys)
|
||||||
ACTION_RETURN_STRING(buffer);
|
ACTION_RETURN_STRING(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFINE_ACTION_FUNCTION(FKeyBindings, NameAllKeys)
|
||||||
|
{
|
||||||
|
PARAM_PROLOGUE;
|
||||||
|
PARAM_POINTER(array, TArray<int>);
|
||||||
|
auto buffer = C_NameKeys(array->Data(), array->Size(), true);
|
||||||
|
ACTION_RETURN_STRING(buffer);
|
||||||
|
}
|
||||||
|
|
||||||
DEFINE_ACTION_FUNCTION(FKeyBindings, GetKeysForCommand)
|
DEFINE_ACTION_FUNCTION(FKeyBindings, GetKeysForCommand)
|
||||||
{
|
{
|
||||||
PARAM_SELF_STRUCT_PROLOGUE(FKeyBindings);
|
PARAM_SELF_STRUCT_PROLOGUE(FKeyBindings);
|
||||||
|
@ -580,6 +588,15 @@ DEFINE_ACTION_FUNCTION(FKeyBindings, GetKeysForCommand)
|
||||||
return MIN(numret, 2);
|
return MIN(numret, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFINE_ACTION_FUNCTION(FKeyBindings, GetAllKeysForCommand)
|
||||||
|
{
|
||||||
|
PARAM_SELF_STRUCT_PROLOGUE(FKeyBindings);
|
||||||
|
PARAM_POINTER(array, TArray<int>);
|
||||||
|
PARAM_STRING(cmd);
|
||||||
|
*array = self->GetKeysForCommand(cmd);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
DEFINE_ACTION_FUNCTION(FKeyBindings, UnbindACommand)
|
DEFINE_ACTION_FUNCTION(FKeyBindings, UnbindACommand)
|
||||||
{
|
{
|
||||||
PARAM_SELF_STRUCT_PROLOGUE(FKeyBindings);
|
PARAM_SELF_STRUCT_PROLOGUE(FKeyBindings);
|
||||||
|
|
|
@ -2,8 +2,11 @@
|
||||||
struct KeyBindings native version("2.4")
|
struct KeyBindings native version("2.4")
|
||||||
{
|
{
|
||||||
native static String NameKeys(int k1, int k2);
|
native static String NameKeys(int k1, int k2);
|
||||||
|
native static String NameAllKeys(array<int> list);
|
||||||
|
|
||||||
native int, int GetKeysForCommand(String cmd);
|
native int, int GetKeysForCommand(String cmd);
|
||||||
|
native void GetAllKeysForCommand(out array<int> list, String cmd);
|
||||||
|
|
||||||
native void SetBind(int key, String cmd);
|
native void SetBind(int key, String cmd);
|
||||||
native void UnbindACommand (String str);
|
native void UnbindACommand (String str);
|
||||||
}
|
}
|
||||||
|
|
|
@ -506,10 +506,10 @@ class OptionMenuItemControlBase : OptionMenuItem
|
||||||
(selected ? OptionMenuSettings.mFontColorSelection : OptionMenuSettings.mFontColor));
|
(selected ? OptionMenuSettings.mFontColorSelection : OptionMenuSettings.mFontColor));
|
||||||
|
|
||||||
String description;
|
String description;
|
||||||
int Key1, Key2;
|
Array<int> keys;
|
||||||
|
|
||||||
[Key1, Key2] = mBindings.GetKeysForCommand(mAction);
|
mBindings.GetAllKeysForCommand(keys, mAction);
|
||||||
description = KeyBindings.NameKeys (Key1, Key2);
|
description = KeyBindings.NameAllKeys(keys);
|
||||||
if (description.Length() > 0)
|
if (description.Length() > 0)
|
||||||
{
|
{
|
||||||
drawValue(indent, y, Font.CR_WHITE, description);
|
drawValue(indent, y, Font.CR_WHITE, description);
|
||||||
|
|
Loading…
Reference in a new issue