Exposed StepMania::SaveScreenshot to Lua. Added prefix and suffix args for setting the screenshot name and removed the unused index arg. Added GetHighScore to PlayerStageStats and AddScreenshot to Profile so that Lua can imitate ScreenEvaluation's code for adding a screenshot to the profile. Removed hungarian notation from variable names in StepMania::SaveScreenshot.

This commit is contained in:
Kyzentun
2014-06-17 00:29:09 -06:00
parent e4f1682964
commit f8e1e28286
7 changed files with 92 additions and 18 deletions
+13
View File
@@ -2018,6 +2018,18 @@ RString Profile::MakeFileNameNoExtension( RString sFileNameBeginning, int iIndex
class LunaProfile: public Luna<Profile>
{
public:
static int AddScreenshot( T* p, lua_State *L )
{
HighScore* hs= Luna<HighScore>::check(L, 1);
RString filename= SArg(2);
Screenshot screenshot;
screenshot.sFileName= filename;
screenshot.sMD5= BinaryToHex(CRYPTMAN->GetMD5ForFile(filename));
screenshot.highScore= *hs;
p->AddScreenshot(screenshot);
return 0;
}
static int GetDisplayName( T* p, lua_State *L ) { lua_pushstring(L, p->m_sDisplayName ); return 1; }
static int GetLastUsedHighScoreName( T* p, lua_State *L ) { lua_pushstring(L, p->m_sLastUsedHighScoreName ); return 1; }
static int SetLastUsedHighScoreName( T* p, lua_State *L )
@@ -2202,6 +2214,7 @@ public:
LunaProfile()
{
ADD_METHOD( AddScreenshot );
ADD_METHOD( GetDisplayName );
ADD_METHOD( GetLastUsedHighScoreName );
ADD_METHOD( SetLastUsedHighScoreName );