diff --git a/changelog.txt b/changelog.txt index ed03a219..78cf60cb 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,4 @@ +07-june-2010 - adelikat - Lua - new function: gui.screenshotas() 07-june-2010 - Deign/adelikat - Win32 - Added a SavestateAs Menu item 06-june-2010 - FatRatKnight - Added a return value to gui.text: The X position where the function would paint the next character. 02-june-2010 - adelikat - Win32 - Movie Options Dialog - Fix so Full Savestate Load checkbox is updated on load diff --git a/src/lua-engine.cpp b/src/lua-engine.cpp index 243dc96c..960797d9 100644 --- a/src/lua-engine.cpp +++ b/src/lua-engine.cpp @@ -3349,6 +3349,26 @@ static int gui_parsecolor(lua_State *L) } +// gui.savescreenshotas() +// +// Causes FCEUX to write a screenshot to a file based on a received filename, caution: will overwrite existing screenshot files +// +// Unconditionally retrns 1; any failure in taking a screenshot would be reported on-screen +// from the function ReallySnap(). +static int gui_savescreenshotas(lua_State *L) { + const char* name = NULL; + size_t l; + name = luaL_checklstring(L,1,&l); + lua_pushstring(L, name); + if (name) + FCEUI_SetSnapshotAsName(name); + else + luaL_error(L,"gui.savesnapshotas must have a string parameter"); + FCEUI_SaveSnapshotAs(); + return 1; +} + + // gui.savescreenshot() // // Causes FCEUX to write a screenshot to a file as if the user pressed the associated hotkey. @@ -4753,7 +4773,8 @@ static const struct luaL_reg guilib[] = { {"box", gui_box}, {"text", gui_text}, - {"savescreenshot", gui_savescreenshot}, + {"savescreenshot", gui_savescreenshot}, + {"savescreenshotas", gui_savescreenshotas}, {"gdscreenshot", gui_gdscreenshot}, {"gdoverlay", gui_gdoverlay}, {"opacity", gui_setopacity}, diff --git a/vc/Help/fceux.hnd b/vc/Help/fceux.hnd index 7869da8b..e46be6c4 100644 Binary files a/vc/Help/fceux.hnd and b/vc/Help/fceux.hnd differ