[Profile] Add GetLastUsedHighScoreName Lua binding.

This commit is contained in:
AJ Kelly
2010-12-19 14:54:45 -06:00
parent 07a5c04db4
commit 86b2dcdc0a
3 changed files with 5 additions and 13 deletions
+1
View File
@@ -20,6 +20,7 @@ sm-ssc v1.2 | 201012xx
Lua bindings. [freem]
* [StreamDisplay] Remove UseThreePartMethod.
* [Style] Add ColumnsPerPlayer and NeedsZoomOutWith2Players bindings. [freem]
* [Profile] Add GetLastUsedHighScoreName Lua binding. [freem]
20101218
--------
+2
View File
@@ -1939,6 +1939,7 @@ class LunaProfile: public Luna<Profile>
{
public:
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 GetHighScoreList( T* p, lua_State *L )
{
if( LuaBinding::CheckLuaObjectType(L, 1, "Song") )
@@ -2035,6 +2036,7 @@ public:
LunaProfile()
{
ADD_METHOD( GetDisplayName );
ADD_METHOD( GetLastUsedHighScoreName );
ADD_METHOD( GetHighScoreList );
ADD_METHOD( GetCharacter );
ADD_METHOD( SetCharacter );
+2 -13
View File
@@ -674,9 +674,7 @@ void ProfileManager::IncrementStepsPlayCount( const Song* pSong, const Steps* pS
GetMachineProfile()->IncrementStepsPlayCount( pSong, pSteps );
}
//
// Course stats
//
void ProfileManager::AddCourseScore( const Course* pCourse, const Trail* pTrail, PlayerNumber pn, const HighScore &hs_, int &iPersonalIndexOut, int &iMachineIndexOut )
{
HighScore hs = hs_;
@@ -686,7 +684,7 @@ void ProfileManager::AddCourseScore( const Course* pCourse, const Trail* pTrail,
iMachineIndexOut = -1;
// In event mode, set the score's name immediately to the Profile's last
// used name. If no profile last used name exists, use "EVNT".
// used name. If no profile last used name exists, use "EVNT".
if( GAMESTATE->IsEventMode() )
{
Profile* pProfile = GetProfile(pn);
@@ -700,10 +698,7 @@ void ProfileManager::AddCourseScore( const Course* pCourse, const Trail* pTrail,
hs.SetName( RANKING_TO_FILL_IN_MARKER[pn] );
}
//
// save high score
//
if( IsPersistentProfile(pn) )
GetProfile(pn)->AddCourseHighScore( pCourse, pTrail, hs, iPersonalIndexOut );
if( hs.GetPercentDP() >= PREFSMAN->m_fMinPercentageForMachineCourseHighScore )
@@ -724,10 +719,7 @@ void ProfileManager::IncrementCoursePlayCount( const Course* pCourse, const Trai
GetMachineProfile()->IncrementCoursePlayCount( pCourse, pTrail );
}
//
// Category stats
//
void ProfileManager::AddCategoryScore( StepsType st, RankingCategory rc, PlayerNumber pn, const HighScore &hs_, int &iPersonalIndexOut, int &iMachineIndexOut )
{
HighScore hs = hs_;
@@ -804,7 +796,6 @@ int ProfileManager::GetNumLocalProfiles() const
return g_vLocalProfile.size();
}
// lua start
#include "LuaBinding.h"
@@ -828,7 +819,6 @@ public:
static int GetLocalProfileIDFromIndex( T* p, lua_State *L ) { lua_pushstring(L, p->GetLocalProfileIDFromIndex(IArg(1)) ); return 1; }
static int GetLocalProfileIndexFromID( T* p, lua_State *L ) { lua_pushnumber(L, p->GetLocalProfileIndexFromID(SArg(1)) ); return 1; }
static int GetNumLocalProfiles( T* p, lua_State *L ) { lua_pushnumber(L, p->GetNumLocalProfiles() ); return 1; }
//static int GetProfileDirectoryForPlayer( T* p, lua_State *L ) { lua_pushstring(L, m_sProfileDir[Enum::Check<PlayerNumber>(L, 1)] ) return 1; }
static int GetProfileDir( T* p, lua_State *L ) { lua_pushstring(L, p->GetProfileDir(Enum::Check<ProfileSlot>(L, 1)) ); return 1; }
static int IsSongNew( T* p, lua_State *L ) { lua_pushboolean(L, p->IsSongNew(Luna<Song>::check(L,1)) ); return 1; }
@@ -843,8 +833,7 @@ public:
ADD_METHOD( GetLocalProfileIDFromIndex );
ADD_METHOD( GetLocalProfileIndexFromID );
ADD_METHOD( GetNumLocalProfiles );
//ADD_METHOD( GetProfileDirectoryForPlayer ); // uses PlayerNumber
ADD_METHOD( GetProfileDir ); // uses ProfileSlot
ADD_METHOD( GetProfileDir );
ADD_METHOD( IsSongNew );
}
};