Skip to content

Commit

Permalink
Ability to fetch contextual actions from Lua
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Aug 12, 2023
1 parent 5747624 commit 2ade51c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/xrEngine/key_binding_registrator_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,25 @@
// clang-format off
SCRIPT_EXPORT(KeyBindings, (),
{
class EnumGameActionsContexts {};
class EnumGameActions {};
class KeyBindingRegistrator {};

using namespace luabind;
module(luaState)
[
def("dik_to_bind", +[](int dik) -> int { return GetBindedAction(dik); }),
def("dik_to_bind", +[](int dik, int ctx) -> int { return GetBindedAction(dik, (EKeyContext)ctx); }),

class_<EnumGameActionsContexts>("key_bindings_context")
.enum_("context")
[
value("undefined", int(EKeyContext::Undefined)),
value("ui", int(EKeyContext::UI)),
value("pda", int(EKeyContext::PDA)),
value("talk", int(EKeyContext::Talk))
],

class_<EnumGameActions>("key_bindings")
.enum_("commands")
[
Expand Down

0 comments on commit 2ade51c

Please sign in to comment.