mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-13 15:01:49 +00:00
get_mouse_pos moved to input library
This commit is contained in:
parent
94825f7b05
commit
8de986346e
2 changed files with 6 additions and 6 deletions
|
|
@ -16,7 +16,6 @@
|
||||||
#include "../../../graphics/ui/elements/Panel.hpp"
|
#include "../../../graphics/ui/elements/Panel.hpp"
|
||||||
#include "../../../graphics/ui/elements/Menu.hpp"
|
#include "../../../graphics/ui/elements/Menu.hpp"
|
||||||
#include "../../../graphics/ui/elements/InventoryView.hpp"
|
#include "../../../graphics/ui/elements/InventoryView.hpp"
|
||||||
#include "../../../window/Events.hpp"
|
|
||||||
#include "../../../frontend/UiDocument.hpp"
|
#include "../../../frontend/UiDocument.hpp"
|
||||||
#include "../../../frontend/locale.hpp"
|
#include "../../../frontend/locale.hpp"
|
||||||
#include "../../../util/stringutil.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());
|
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 [] = {
|
const luaL_Reg guilib [] = {
|
||||||
{"get_viewport", lua_wrap_errors<l_gui_getviewport>},
|
{"get_viewport", lua_wrap_errors<l_gui_getviewport>},
|
||||||
{"getattr", lua_wrap_errors<l_gui_getattr>},
|
{"getattr", lua_wrap_errors<l_gui_getattr>},
|
||||||
|
|
@ -474,7 +469,6 @@ const luaL_Reg guilib [] = {
|
||||||
{"get_env", lua_wrap_errors<l_gui_get_env>},
|
{"get_env", lua_wrap_errors<l_gui_get_env>},
|
||||||
{"str", lua_wrap_errors<l_gui_str>},
|
{"str", lua_wrap_errors<l_gui_str>},
|
||||||
{"reindex", lua_wrap_errors<l_gui_reindex>},
|
{"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>},
|
{"get_locales_info", lua_wrap_errors<l_gui_get_locales_info>},
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
#include "api_lua.hpp"
|
#include "api_lua.hpp"
|
||||||
|
#include "lua_util.hpp"
|
||||||
#include "lua_commons.hpp"
|
#include "lua_commons.hpp"
|
||||||
#include "LuaState.hpp"
|
#include "LuaState.hpp"
|
||||||
#include "../scripting.hpp"
|
#include "../scripting.hpp"
|
||||||
|
|
@ -39,9 +40,14 @@ static int l_add_callback(lua_State* L) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int l_get_mouse_pos(lua_State* L) {
|
||||||
|
return lua::pushvec2_arr(L, Events::cursor);
|
||||||
|
}
|
||||||
|
|
||||||
const luaL_Reg inputlib [] = {
|
const luaL_Reg inputlib [] = {
|
||||||
{"keycode", lua_wrap_errors<l_keycode>},
|
{"keycode", lua_wrap_errors<l_keycode>},
|
||||||
{"add_callback", lua_wrap_errors<l_add_callback>},
|
{"add_callback", lua_wrap_errors<l_add_callback>},
|
||||||
|
{"get_mouse_pos", lua_wrap_errors<l_get_mouse_pos>},
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue