From 1cd512913e4d4ad1fb43d4b6e3d7971bb6c67528 Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Sun, 27 Apr 2014 17:55:49 -0400 Subject: Organize builtin into subdirectories --- src/script/lua_api/l_util.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/script/lua_api/l_util.cpp') diff --git a/src/script/lua_api/l_util.cpp b/src/script/lua_api/l_util.cpp index f26a88a93..b30bab292 100644 --- a/src/script/lua_api/l_util.cpp +++ b/src/script/lua_api/l_util.cpp @@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "common/c_content.h" #include "cpp_api/s_async.h" #include "debug.h" +#include "porting.h" #include "log.h" #include "tool.h" #include "settings.h" @@ -274,6 +275,14 @@ int ModApiUtil::l_is_yes(lua_State *L) return 1; } +int ModApiUtil::l_get_builtin_path(lua_State *L) +{ + std::string path = porting::path_share + DIR_DELIM + "builtin"; + lua_pushstring(L, path.c_str()); + return 1; +} + + void ModApiUtil::Initialize(lua_State *L, int top) { API_FCT(debug); @@ -294,6 +303,8 @@ void ModApiUtil::Initialize(lua_State *L, int top) API_FCT(get_password_hash); API_FCT(is_yes); + + API_FCT(get_builtin_path); } void ModApiUtil::InitializeAsync(AsyncEngine& engine) @@ -311,4 +322,7 @@ void ModApiUtil::InitializeAsync(AsyncEngine& engine) ASYNC_API_FCT(write_json); ASYNC_API_FCT(is_yes); + + ASYNC_API_FCT(get_builtin_path); } + -- cgit v1.2.3