+local modname = core.get_current_modname() or "??"
+
-- This is an example function to ensure it's working properly, should be removed before merge
core.register_on_shutdown(function()
print("[PREVIEW] shutdown client")
})
core.after(2, function()
- print("After 2")
+ print("[PREVIEW] loaded " .. modname .. " mod")
end)
#include "client.h"
#include "cpp_api/s_internal.h"
#include "lua_api/l_client.h"
+#include "lua_api/l_storage.h"
#include "lua_api/l_sound.h"
#include "lua_api/l_util.h"
ModApiUtil::InitializeClient(L, top);
ModApiClient::Initialize(L, top);
ModApiSound::Initialize(L, top);
+ ModApiStorage::Initialize(L, top);
}
set(client_SCRIPT_LUA_API_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/l_client.cpp
${CMAKE_CURRENT_SOURCE_DIR}/l_mainmenu.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/l_storage.cpp
${CMAKE_CURRENT_SOURCE_DIR}/l_sound.cpp
PARENT_SCOPE)
#include "lua_api/l_base.h"
-class ModApiClient:
- public ModApiBase
+class ModApiClient: public ModApiBase
{
private:
// get_current_modname()
API_FCT(get_us_time);
- API_FCT(setting_set);
- API_FCT(setting_get);
- API_FCT(setting_setbool);
- API_FCT(setting_getbool);
- API_FCT(setting_save);
-
API_FCT(parse_json);
API_FCT(write_json);
modlist.push_back(it->name);
}
-const std::string Server::getBuiltinLuaPath()
+std::string Server::getBuiltinLuaPath()
{
return porting::path_share + DIR_DELIM + "builtin";
}
virtual const ModSpec* getModSpec(const std::string &modname) const;
void getModNames(std::vector<std::string> &modlist);
std::string getBuiltinLuaPath();
- inline const std::string &getWorldPath() const { return m_path_world; }
+ std::string getWorldPath() const { return m_path_world; }
std::string getModStoragePath() const;
inline bool isSingleplayer()