Коммит 07fbd105 создал по автору xottab-duty's avatar xottab-duty
Просмотр файлов

xrEngine/xr_level_controller.h: IsBinded now also supports contextual search

владелец 0335f95e
......@@ -602,13 +602,15 @@ game_action* ActionNameToPtr(pcstr name)
return nullptr;
}
bool IsBinded(EGameActions action_id, int dik)
bool IsBinded(EGameActions action_id, int dik, EKeyContext context /*= EKeyContext::Undefined*/)
{
key_binding* binding = &g_key_bindings[action_id];
for (u8 i = 0; i < bindtypes_count; ++i)
{
if (binding->m_keyboard[i] && binding->m_keyboard[i]->dik == dik)
return true;
if (binding->m_action->key_context == context)
return true;
}
return false;
}
......
......@@ -194,7 +194,7 @@ ENGINE_API int KeynameToDik(pcstr name);
ENGINE_API keyboard_key* KeynameToPtr(pcstr name);
ENGINE_API keyboard_key* DikToPtr(int dik, bool safe);
ENGINE_API bool IsBinded(EGameActions action_id, int dik);
ENGINE_API bool IsBinded(EGameActions action_id, int dik, EKeyContext context = EKeyContext::Undefined);
ENGINE_API int GetActionDik(EGameActions action_id, int idx = -1);
ENGINE_API EGameActions GetBindedAction(int dik, EKeyContext context = EKeyContext::Undefined);
......
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать