Add lua getfilename function (that also returns the path).
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1826 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
parent
1d510d40bc
commit
4dc40e7784
@ -1311,6 +1311,18 @@ int L_FinalizePicture(lua_State* L)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int L_GetFileName(lua_State* L)
|
||||||
|
{
|
||||||
|
int nb_args=lua_gettop(L);
|
||||||
|
|
||||||
|
LUA_ARG_LIMIT (0, "getfilename");
|
||||||
|
|
||||||
|
lua_pushstring(L, Main_backups->Pages->Filename);
|
||||||
|
lua_pushstring(L, Main_backups->Pages->File_directory);
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
// Handlers for window internals
|
// Handlers for window internals
|
||||||
T_Fileselector Scripts_selector;
|
T_Fileselector Scripts_selector;
|
||||||
|
|
||||||
@ -1575,6 +1587,7 @@ void Run_script(const char *script_subdirectory, const char *script_filename)
|
|||||||
lua_register(L,"waitinput",L_WaitInput);
|
lua_register(L,"waitinput",L_WaitInput);
|
||||||
lua_register(L,"updatescreen",L_UpdateScreen);
|
lua_register(L,"updatescreen",L_UpdateScreen);
|
||||||
lua_register(L,"finalizepicture",L_FinalizePicture);
|
lua_register(L,"finalizepicture",L_FinalizePicture);
|
||||||
|
lua_register(L,"getfilename",L_GetFileName);
|
||||||
|
|
||||||
// Load all standard libraries
|
// Load all standard libraries
|
||||||
luaL_openlibs(L);
|
luaL_openlibs(L);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user