mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Add love.filesystem.getIdentity
This commit is contained in:
@@ -104,6 +104,11 @@ namespace physfs
|
||||
return true;
|
||||
}
|
||||
|
||||
const char * Filesystem::getIdentity() const
|
||||
{
|
||||
return save_identity.c_str();
|
||||
}
|
||||
|
||||
bool Filesystem::setSource(const char * source)
|
||||
{
|
||||
if (!isInited)
|
||||
|
||||
@@ -135,6 +135,7 @@ namespace physfs
|
||||
* to create the folder in the LOVE data folder.
|
||||
**/
|
||||
bool setIdentity(const char * ident);
|
||||
const char * getIdentity() const;
|
||||
|
||||
/**
|
||||
* Sets the path to the game source.
|
||||
|
||||
@@ -70,6 +70,12 @@ namespace physfs
|
||||
return 0;
|
||||
}
|
||||
|
||||
int w_getIdentity(lua_State * L)
|
||||
{
|
||||
lua_pushstring(L, instance->getIdentity());
|
||||
return 1;
|
||||
}
|
||||
|
||||
int w_setSource(lua_State * L)
|
||||
{
|
||||
const char * arg = luaL_checkstring(L, 1);
|
||||
@@ -369,6 +375,7 @@ namespace physfs
|
||||
{ "init", w_init },
|
||||
{ "setRelease", w_setRelease },
|
||||
{ "setIdentity", w_setIdentity },
|
||||
{ "getIdentity", w_getIdentity },
|
||||
{ "setSource", w_setSource },
|
||||
{ "newFile", w_newFile },
|
||||
{ "getWorkingDirectory", w_getWorkingDirectory },
|
||||
|
||||
@@ -39,6 +39,7 @@ namespace physfs
|
||||
int w_init(lua_State * L);
|
||||
int w_setRelease(lua_State * L);
|
||||
int w_setIdentity(lua_State * L);
|
||||
int w_getIdentity(lua_State * L);
|
||||
int w_setSource(lua_State * L);
|
||||
int w_newFile(lua_State * L);
|
||||
int w_newFileData(lua_State * L);
|
||||
|
||||
Reference in New Issue
Block a user