get_mouse_pos moved to input library
This commit is contained in:
parent
94825f7b05
commit
8de986346e
@ -16,7 +16,6 @@
|
||||
#include "../../../graphics/ui/elements/Panel.hpp"
|
||||
#include "../../../graphics/ui/elements/Menu.hpp"
|
||||
#include "../../../graphics/ui/elements/InventoryView.hpp"
|
||||
#include "../../../window/Events.hpp"
|
||||
#include "../../../frontend/UiDocument.hpp"
|
||||
#include "../../../frontend/locale.hpp"
|
||||
#include "../../../util/stringutil.hpp"
|
||||
@ -463,10 +462,6 @@ static int l_gui_getviewport(lua_State* L) {
|
||||
return lua::pushvec2_arr(L, scripting::engine->getGUI()->getContainer()->getSize());
|
||||
}
|
||||
|
||||
static int l_gui_get_mouse_pos(lua_State* L) {
|
||||
return lua::pushvec2_arr(L, Events::cursor);
|
||||
}
|
||||
|
||||
const luaL_Reg guilib [] = {
|
||||
{"get_viewport", lua_wrap_errors<l_gui_getviewport>},
|
||||
{"getattr", lua_wrap_errors<l_gui_getattr>},
|
||||
@ -474,7 +469,6 @@ const luaL_Reg guilib [] = {
|
||||
{"get_env", lua_wrap_errors<l_gui_get_env>},
|
||||
{"str", lua_wrap_errors<l_gui_str>},
|
||||
{"reindex", lua_wrap_errors<l_gui_reindex>},
|
||||
{"get_mouse_pos", lua_wrap_errors<l_gui_get_mouse_pos>},
|
||||
{"get_locales_info", lua_wrap_errors<l_gui_get_locales_info>},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
#include "api_lua.hpp"
|
||||
#include "lua_util.hpp"
|
||||
#include "lua_commons.hpp"
|
||||
#include "LuaState.hpp"
|
||||
#include "../scripting.hpp"
|
||||
@ -39,9 +40,14 @@ static int l_add_callback(lua_State* L) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int l_get_mouse_pos(lua_State* L) {
|
||||
return lua::pushvec2_arr(L, Events::cursor);
|
||||
}
|
||||
|
||||
const luaL_Reg inputlib [] = {
|
||||
{"keycode", lua_wrap_errors<l_keycode>},
|
||||
{"add_callback", lua_wrap_errors<l_add_callback>},
|
||||
{"get_mouse_pos", lua_wrap_errors<l_get_mouse_pos>},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user