diff --git a/src/Profile.cpp b/src/Profile.cpp index bfca1207b2..762514a2a0 100644 --- a/src/Profile.cpp +++ b/src/Profile.cpp @@ -151,7 +151,7 @@ void Profile::InitGeneralData() ZERO( m_iNumStagesPassedByPlayMode ); ZERO( m_iNumStagesPassedByGrade ); - m_UserData.Unset(); + m_UserTable.Unset(); } void Profile::InitSongScores() @@ -1160,16 +1160,16 @@ XNode* Profile::SaveGeneralDataCreateNode() const } } - // Load Lua UserData from profile - if( !IsMachine() && m_UserData.IsSet() ) + // Load Lua UserTable from profile + if( !IsMachine() && m_UserTable.IsSet() ) { Lua *L = LUA->Get(); - m_UserData.PushSelf( L ); + m_UserTable.PushSelf( L ); XNode* pUserTable = XmlFileUtil::XNodeFromTable( L ); LUA->Release( L ); // XXX: XNodeFromTable returns a root node with the name "Layer". - pUserTable->m_sName = "UserData"; + pUserTable->m_sName = "UserTable"; pGeneralDataNode->AppendChild( pUserTable ); } @@ -1348,17 +1348,17 @@ void Profile::LoadGeneralDataFromNode( const XNode* pNode ) // Build the custom data table from the existing XNode. if( !IsMachine() ) { - const XNode *pUserData = pNode->GetChild( "UserData" ); + const XNode *pUserTable = pNode->GetChild( "UserTable" ); Lua *L = LUA->Get(); // If we have custom data, load it. Otherwise, make a blank table. - if( pUserData ) - LuaHelpers::CreateTableFromXNode( L, pUserData ); + if( pUserTable ) + LuaHelpers::CreateTableFromXNode( L, pUserTable ); else lua_newtable( L ); - m_UserData.SetFromStack( L ); + m_UserTable.SetFromStack( L ); LUA->Release( L ); } @@ -2034,7 +2034,7 @@ public: static int GetTotalMines( T* p, lua_State *L ) { lua_pushnumber(L, p->m_iTotalMines ); return 1; } static int GetTotalHands( T* p, lua_State *L ) { lua_pushnumber(L, p->m_iTotalHands ); return 1; } static int GetTotalLifts( T* p, lua_State *L ) { lua_pushnumber(L, p->m_iTotalLifts ); return 1; } - static int GetUserData( T* p, lua_State *L ) { p->m_UserData.PushSelf(L); return 1; } + static int GetUserTable( T* p, lua_State *L ) { p->m_UserTable.PushSelf(L); return 1; } LunaProfile() { @@ -2081,7 +2081,7 @@ public: ADD_METHOD( GetTotalMines ); ADD_METHOD( GetTotalHands ); ADD_METHOD( GetTotalLifts ); - ADD_METHOD( GetUserData ); + ADD_METHOD( GetUserTable ); } }; diff --git a/src/Profile.h b/src/Profile.h index 1115192911..d86941b14c 100644 --- a/src/Profile.h +++ b/src/Profile.h @@ -88,7 +88,7 @@ public: m_iTotalHands(0), m_iTotalLifts(0), m_bNewProfile(false), m_UnlockedEntryIDs(), m_sLastPlayedMachineGuid(""), m_LastPlayedDate(),m_iNumSongsPlayedByStyle(), - m_iNumTotalSongsPlayed(0), m_UserData(), m_SongHighScores(), + m_iNumTotalSongsPlayed(0), m_UserTable(), m_SongHighScores(), m_CourseHighScores(), m_vScreenshots(), m_mapDayToCaloriesBurned() { @@ -106,7 +106,7 @@ public: ZERO( m_iNumStagesPassedByPlayMode ); ZERO( m_iNumStagesPassedByGrade ); - m_UserData.Unset(); + m_UserTable.Unset(); FOREACH_ENUM( StepsType,st ) FOREACH_ENUM( RankingCategory,rc ) @@ -207,7 +207,9 @@ public: int m_iNumTotalSongsPlayed; int m_iNumStagesPassedByPlayMode[NUM_PlayMode]; int m_iNumStagesPassedByGrade[NUM_Grade]; - LuaReference m_UserData; + + /* store arbitrary data for the theme within a profile */ + LuaTable m_UserTable; // Song high scores struct HighScoresForASteps