From edd7f7bfc77d6f61a1f728c84911b43f32d83412 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 14 Oct 2003 01:23:16 +0000 Subject: [PATCH] add StoreRankingName --- stepmania/src/GameState.cpp | 11 +++++++++++ stepmania/src/GameState.h | 3 +++ 2 files changed, 14 insertions(+) diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index af513ee408..31e792b19e 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -17,6 +17,7 @@ #include "PrefsManager.h" #include "InputMapper.h" #include "song.h" +#include "Course.h" #include "RageLog.h" #include "RageUtil.h" #include "SongManager.h" @@ -168,6 +169,16 @@ void GameState::ResetLastRanking() } } +void GameState::StoreRankingName( PlayerNumber pn, CString name ) +{ + const int index = GAMESTATE->m_iRankingIndex[pn]; + + if( GAMESTATE->IsCourseMode() ) + GAMESTATE->m_pRankingCourse->m_RankingScores[GAMESTATE->m_RankingNotesType][index].sName = name; + else + SONGMAN->m_MachineScores[GAMESTATE->m_RankingNotesType][GAMESTATE->m_RankingCategory[pn]][index].sName = name; +} + void GameState::ReloadCharacters() { unsigned i; diff --git a/stepmania/src/GameState.h b/stepmania/src/GameState.h index 607041039e..56774974c6 100644 --- a/stepmania/src/GameState.h +++ b/stepmania/src/GameState.h @@ -252,6 +252,9 @@ public: Course* m_pRankingCourse; // meaningless unless Course was played int m_iRankingIndex[NUM_PLAYERS]; // -1 if no new high score + /* Called by name entry screens: */ + void StoreRankingName( PlayerNumber pn, CString name ); + // // Arrow positioning //