Add various new bindings for ProfileManager, also GetGUID binding for Profile. [asorenson]

This commit is contained in:
AJ Kelly
2012-11-22 12:42:12 -06:00
parent f80c03af7b
commit b4bd8e82d9
6 changed files with 2685 additions and 2634 deletions
+7
View File
@@ -4,6 +4,13 @@ The StepMania 5 Changelog covers all post-sm-ssc changes. For a list of changes
from StepMania 4 alpha 5 to sm-ssc v1.2.5, see Changelog_sm-ssc.txt.
________________________________________________________________________________
2012/11/22
----------
* [ProfileManager] Added SaveProfile, SaveLocalProfile, GetLocalProfileIDs,
ProfileFromMemoryCardIsNew, GetSongNumTimesPlayed, LocalProfileIDToDir, and
GetLocalProfileDisplayNames Lua bindings. [Alfred Sorenson]
* [Profile] Add GetGUID Lua binding. [Alfred Sorenson]
2012/07/26
----------
* [ScreenDebugOverlay] Added BackgroundColor metric. [AJ]
+5 -2
View File
@@ -57,6 +57,9 @@ Jason Felds (Wolfman2000)
* Mac OS X maintainer
* Various fixes/changes. (see Changelogs for more details)
djpohly
* Various patches/fixes
==other contributors==
(in no particular order)
@@ -141,8 +144,8 @@ Deamon007
cvpcs
* Updated ffmpeg support to v0.10
djpohly
* Various patches/fixes
Alfred Sorenson
* Various small additions
==the beta testers==
[SSC Beta Testing Team]
@@ -61,6 +61,7 @@ local contrib = {
"Samuel Kim (1a2a3a2a1a)", -- various beat mode fixes
"hanubeki (@803832)", -- beginner helper fix, among various other things
"v1toko", -- x-mode from StepNXA
"Alfred Sorenson", -- new lua bindings
}
local translators = {
@@ -61,6 +61,7 @@ local contrib = {
"Samuel Kim (1a2a3a2a1a)", -- various beat mode fixes
"hanubeki (@803832)", -- beginner helper fix, among various other things
"v1toko", -- x-mode from StepNXA
"Alfred Sorenson", -- new lua bindings
}
local translators = {
+2
View File
@@ -2051,6 +2051,7 @@ public:
lua_pushnil( L );
return 1;
}
DEFINE_METHOD( GetGUID, m_sGuid );
LunaProfile()
{
@@ -2100,6 +2101,7 @@ public:
ADD_METHOD( GetUserTable );
ADD_METHOD( GetLastPlayedSong );
ADD_METHOD( GetLastPlayedCourse );
ADD_METHOD( GetGUID );
}
};
+37
View File
@@ -842,6 +842,35 @@ public:
static int LastLoadWasTamperedOrCorrupt( T* p, lua_State *L ) { lua_pushboolean(L, p->LastLoadWasTamperedOrCorrupt(Enum::Check<PlayerNumber>(L, 1)) ); return 1; }
static int GetPlayerName( T* p, lua_State *L ) { PlayerNumber pn = Enum::Check<PlayerNumber>(L, 1); lua_pushstring(L, p->GetPlayerName(pn)); return 1; }
static int LocalProfileIDToDir( T* p, lua_State *L )
{
RString dir = USER_PROFILES_DIR + SArg(1) + "/";
lua_pushstring( L, dir );
return 1;
}
static int SaveProfile( T* p, lua_State *L ) { lua_pushboolean( L, p->SaveProfile(Enum::Check<PlayerNumber>(L, 1)) ); return 1; }
static int SaveLocalProfile( T* p, lua_State *L ) { lua_pushboolean( L, p->SaveLocalProfile(SArg(1)) ); return 1; }
static int ProfileFromMemoryCardIsNew( T* p, lua_State *L ) { lua_pushboolean( L, p->ProfileFromMemoryCardIsNew(Enum::Check<PlayerNumber>(L, 1)) ); return 1; }
static int GetSongNumTimesPlayed( T* p, lua_State *L )
{
lua_pushnumber(L, p->GetSongNumTimesPlayed(Luna<Song>::check(L,1),Enum::Check<ProfileSlot>(L, 2)) );
return 1;
}
static int GetLocalProfileIDs( T* p, lua_State *L )
{
vector<RString> vsProfileIDs;
p->GetLocalProfileIDs(vsProfileIDs);
LuaHelpers::CreateTableFromArray<RString>( vsProfileIDs, L );
return 1;
}
static int GetLocalProfileDisplayNames( T* p, lua_State *L )
{
vector<RString> vsProfileNames;
p->GetLocalProfileDisplayNames(vsProfileNames);
LuaHelpers::CreateTableFromArray<RString>( vsProfileNames, L );
return 1;
}
LunaProfileManager()
{
ADD_METHOD( IsPersistentProfile );
@@ -858,6 +887,14 @@ public:
ADD_METHOD( ProfileWasLoadedFromMemoryCard );
ADD_METHOD( LastLoadWasTamperedOrCorrupt );
ADD_METHOD( GetPlayerName );
//
ADD_METHOD( SaveProfile );
ADD_METHOD( SaveLocalProfile );
ADD_METHOD( ProfileFromMemoryCardIsNew );
ADD_METHOD( GetSongNumTimesPlayed );
ADD_METHOD( GetLocalProfileIDs );
ADD_METHOD( GetLocalProfileDisplayNames );
ADD_METHOD( LocalProfileIDToDir );
}
};