mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Use consistent temp folder path (#10892)
This commit is contained in:
parent
4caf156be5
commit
3a8c37181a
6 changed files with 24 additions and 33 deletions
|
@ -529,6 +529,7 @@ int ModApiMainMenu::l_get_texturepath(lua_State *L)
|
|||
return 1;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
int ModApiMainMenu::l_get_texturepath_share(lua_State *L)
|
||||
{
|
||||
std::string gamepath = fs::RemoveRelativePathComponents(
|
||||
|
@ -537,12 +538,20 @@ int ModApiMainMenu::l_get_texturepath_share(lua_State *L)
|
|||
return 1;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
int ModApiMainMenu::l_get_cache_path(lua_State *L)
|
||||
{
|
||||
lua_pushstring(L, fs::RemoveRelativePathComponents(porting::path_cache).c_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
int ModApiMainMenu::l_get_temp_path(lua_State *L)
|
||||
{
|
||||
lua_pushstring(L, fs::TempPath().c_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
int ModApiMainMenu::l_create_dir(lua_State *L) {
|
||||
const char *path = luaL_checkstring(L, 1);
|
||||
|
@ -942,6 +951,7 @@ void ModApiMainMenu::Initialize(lua_State *L, int top)
|
|||
API_FCT(get_texturepath);
|
||||
API_FCT(get_texturepath_share);
|
||||
API_FCT(get_cache_path);
|
||||
API_FCT(get_temp_path);
|
||||
API_FCT(create_dir);
|
||||
API_FCT(delete_dir);
|
||||
API_FCT(copy_dir);
|
||||
|
@ -975,6 +985,7 @@ void ModApiMainMenu::InitializeAsync(lua_State *L, int top)
|
|||
API_FCT(get_texturepath);
|
||||
API_FCT(get_texturepath_share);
|
||||
API_FCT(get_cache_path);
|
||||
API_FCT(get_temp_path);
|
||||
API_FCT(create_dir);
|
||||
API_FCT(delete_dir);
|
||||
API_FCT(copy_dir);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue