mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-21 18:09:46 +00:00
Merge branch 'MihailRis:main' into main
This commit is contained in:
commit
acb1f084f7
24 changed files with 69 additions and 47 deletions
|
|
@ -91,6 +91,12 @@ static int l_get_mouse_delta(lua::State* L) {
|
|||
return lua::pushvec2(L, engine->getInput().getCursor().delta);
|
||||
}
|
||||
|
||||
static int l_get_mouse_scroll(lua::State* L) {
|
||||
if (engine->isHeadless())
|
||||
return 0;
|
||||
return lua::pushinteger(L, engine->getInput().getScroll());
|
||||
}
|
||||
|
||||
static int l_get_bindings(lua::State* L) {
|
||||
if (engine->isHeadless())
|
||||
return 0;
|
||||
|
|
@ -181,6 +187,7 @@ const luaL_Reg inputlib[] = {
|
|||
{"add_callback", lua::wrap<l_add_callback>},
|
||||
{"get_mouse_pos", lua::wrap<l_get_mouse_pos>},
|
||||
{"get_mouse_delta", lua::wrap<l_get_mouse_delta>},
|
||||
{"get_mouse_scroll", lua::wrap<l_get_mouse_scroll>},
|
||||
{"get_bindings", lua::wrap<l_get_bindings>},
|
||||
{"get_binding_text", lua::wrap<l_get_binding_text>},
|
||||
{"is_active", lua::wrap<l_is_active>},
|
||||
|
|
|
|||
|
|
@ -323,7 +323,7 @@ namespace lua {
|
|||
|
||||
if (found == usertypeNames.end()) {
|
||||
log_error(
|
||||
"usertype is not registred: " + std::string(typeid(T).name())
|
||||
"usertype is not registered: " + std::string(typeid(T).name())
|
||||
);
|
||||
} else if (getglobal(L, found->second)) {
|
||||
setmetatable(L);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue