add judge counts to HighScore. Will this make Stats.xml too big?
This commit is contained in:
@@ -109,6 +109,16 @@ static const CString TapNoteScoreNames[NUM_TAP_NOTE_SCORES] = {
|
|||||||
"Marvelous",
|
"Marvelous",
|
||||||
};
|
};
|
||||||
XToString( TapNoteScore );
|
XToString( TapNoteScore );
|
||||||
|
StringToX( TapNoteScore );
|
||||||
|
|
||||||
|
|
||||||
|
static const CString HoldNoteScoreNames[NUM_HOLD_NOTE_SCORES] = {
|
||||||
|
"None",
|
||||||
|
"OK",
|
||||||
|
"NG",
|
||||||
|
};
|
||||||
|
XToString( HoldNoteScore );
|
||||||
|
StringToX( HoldNoteScore );
|
||||||
|
|
||||||
|
|
||||||
static const CString MemoryCardStateNames[NUM_MEMORY_CARD_STATES] = {
|
static const CString MemoryCardStateNames[NUM_MEMORY_CARD_STATES] = {
|
||||||
|
|||||||
@@ -189,12 +189,7 @@ enum TapNoteScore {
|
|||||||
};
|
};
|
||||||
#define FOREACH_TapNoteScore( tns ) FOREACH_ENUM( TapNoteScore, NUM_TAP_NOTE_SCORES, tns )
|
#define FOREACH_TapNoteScore( tns ) FOREACH_ENUM( TapNoteScore, NUM_TAP_NOTE_SCORES, tns )
|
||||||
const CString& TapNoteScoreToString( TapNoteScore tns );
|
const CString& TapNoteScoreToString( TapNoteScore tns );
|
||||||
|
TapNoteScore StringToTapNoteScore( const CString& str );
|
||||||
//enum TapNoteTiming {
|
|
||||||
// TNT_NONE,
|
|
||||||
// TNT_EARLY,
|
|
||||||
// TNT_LATE
|
|
||||||
//};
|
|
||||||
|
|
||||||
|
|
||||||
enum HoldNoteScore
|
enum HoldNoteScore
|
||||||
@@ -205,6 +200,8 @@ enum HoldNoteScore
|
|||||||
NUM_HOLD_NOTE_SCORES
|
NUM_HOLD_NOTE_SCORES
|
||||||
};
|
};
|
||||||
#define FOREACH_HoldNoteScore( hns ) FOREACH_ENUM( HoldNoteScore, NUM_HOLD_NOTE_SCORES, hns )
|
#define FOREACH_HoldNoteScore( hns ) FOREACH_ENUM( HoldNoteScore, NUM_HOLD_NOTE_SCORES, hns )
|
||||||
|
const CString& HoldNoteScoreToString( HoldNoteScore tns );
|
||||||
|
HoldNoteScore StringToHoldNoteScore( const CString& str );
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
+39
-24
@@ -59,6 +59,15 @@ XNode* HighScore::CreateNode() const
|
|||||||
pNode->AppendChild( "PlayerGuid", sPlayerGuid );
|
pNode->AppendChild( "PlayerGuid", sPlayerGuid );
|
||||||
pNode->AppendChild( "MachineGuid", sMachineGuid );
|
pNode->AppendChild( "MachineGuid", sMachineGuid );
|
||||||
pNode->AppendChild( "ProductID", iProductID );
|
pNode->AppendChild( "ProductID", iProductID );
|
||||||
|
XNode* pTapNoteScores = pNode->AppendChild( "TapNoteScores" );
|
||||||
|
FOREACH_TapNoteScore( tns )
|
||||||
|
pTapNoteScores->AppendChild( TapNoteScoreToString(tns), iTapNoteScores[tns] );
|
||||||
|
XNode* pHoldNoteScores = pNode->AppendChild( "HoldNoteScores" );
|
||||||
|
FOREACH_HoldNoteScore( hns )
|
||||||
|
pHoldNoteScores->AppendChild( HoldNoteScoreToString(hns), iHoldNoteScores[hns] );
|
||||||
|
XNode* pRadarCategories = pNode->AppendChild( "RadarActuals" );
|
||||||
|
FOREACH_RadarCategory( rc )
|
||||||
|
pRadarCategories->AppendChild( RadarCategoryToString(rc), fRadarActual[rc] );
|
||||||
|
|
||||||
return pNode;
|
return pNode;
|
||||||
}
|
}
|
||||||
@@ -66,30 +75,36 @@ XNode* HighScore::CreateNode() const
|
|||||||
void HighScore::LoadFromNode( const XNode* pNode )
|
void HighScore::LoadFromNode( const XNode* pNode )
|
||||||
{
|
{
|
||||||
ASSERT( pNode->name == "HighScore" );
|
ASSERT( pNode->name == "HighScore" );
|
||||||
for( XNodes::const_iterator child = pNode->childs.begin();
|
|
||||||
child != pNode->childs.end();
|
CString s;
|
||||||
child++ )
|
|
||||||
{
|
pNode->GetChildValue( "Name", sName );
|
||||||
if( (*child)->name == "Name" ) (*child)->GetValue( sName );
|
pNode->GetChildValue( "Grade", s );
|
||||||
else if( (*child)->name == "Grade" )
|
/* Pre-a19 compatibility; remove eventually */
|
||||||
{
|
if( IsAnInt(s) )
|
||||||
CString sGrade;
|
grade = (Grade) atoi( s );
|
||||||
(*child)->GetValue( sGrade );
|
else
|
||||||
/* Pre-a19 compatibility; remove eventually: */
|
grade = StringToGrade( s );
|
||||||
if( IsAnInt(sGrade) )
|
pNode->GetChildValue( "Score", iScore );
|
||||||
grade = (Grade) atoi( sGrade );
|
pNode->GetChildValue( "PercentDP", fPercentDP );
|
||||||
else
|
pNode->GetChildValue( "SurviveSeconds", fSurviveSeconds );
|
||||||
grade = StringToGrade( sGrade );
|
pNode->GetChildValue( "Modifiers", sModifiers );
|
||||||
}
|
pNode->GetChildValue( "Time", (int&)time );
|
||||||
else if( (*child)->name == "Score" ) (*child)->GetValue( iScore );
|
pNode->GetChildValue( "PlayerGuid", sPlayerGuid );
|
||||||
else if( (*child)->name == "PercentDP" ) (*child)->GetValue( fPercentDP );
|
pNode->GetChildValue( "MachineGuid", sMachineGuid );
|
||||||
else if( (*child)->name == "SurviveSeconds" ) (*child)->GetValue( fSurviveSeconds );
|
pNode->GetChildValue( "ProductID", iProductID );
|
||||||
else if( (*child)->name == "Modifiers" ) (*child)->GetValue( sModifiers );
|
XNode* pTapNoteScores = pNode->GetChild( "TapNoteScores" );
|
||||||
else if( (*child)->name == "Time" ) (*child)->GetValue( (int&)time );
|
if( pTapNoteScores )
|
||||||
else if( (*child)->name == "PlayerGuid" ) (*child)->GetValue( sPlayerGuid );
|
FOREACH_TapNoteScore( tns )
|
||||||
else if( (*child)->name == "MachineGuid" ) (*child)->GetValue( sMachineGuid );
|
pTapNoteScores->GetChildValue( TapNoteScoreToString(tns), iTapNoteScores[tns] );
|
||||||
else if( (*child)->name == "ProductID" ) (*child)->GetValue( iProductID );
|
XNode* pHoldNoteScores = pNode->GetChild( "HoldNoteScores" );
|
||||||
}
|
if( pHoldNoteScores )
|
||||||
|
FOREACH_HoldNoteScore( hns )
|
||||||
|
pHoldNoteScores->GetChildValue( HoldNoteScoreToString(hns), iHoldNoteScores[hns] );
|
||||||
|
XNode* pRadarCategories = pNode->GetChild( "RadarActuals" );
|
||||||
|
if( pRadarCategories )
|
||||||
|
FOREACH_RadarCategory( rc )
|
||||||
|
pRadarCategories->GetChildValue( RadarCategoryToString(rc), fRadarActual[rc] );
|
||||||
|
|
||||||
/* Validate input. */
|
/* Validate input. */
|
||||||
grade = clamp( grade, GRADE_TIER_1, GRADE_FAILED );
|
grade = clamp( grade, GRADE_TIER_1, GRADE_FAILED );
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "Grade.h"
|
#include "Grade.h"
|
||||||
|
#include "GameConstantsAndTypes.h"
|
||||||
|
|
||||||
struct XNode;
|
struct XNode;
|
||||||
struct HighScore
|
struct HighScore
|
||||||
@@ -27,6 +28,9 @@ struct HighScore
|
|||||||
CString sPlayerGuid; // who made this high score
|
CString sPlayerGuid; // who made this high score
|
||||||
CString sMachineGuid; // where this high score was made
|
CString sMachineGuid; // where this high score was made
|
||||||
int iProductID;
|
int iProductID;
|
||||||
|
int iTapNoteScores[NUM_TAP_NOTE_SCORES];
|
||||||
|
int iHoldNoteScores[NUM_HOLD_NOTE_SCORES];
|
||||||
|
float fRadarActual[NUM_RADAR_CATEGORIES];
|
||||||
|
|
||||||
HighScore() { Unset(); }
|
HighScore() { Unset(); }
|
||||||
void Unset()
|
void Unset()
|
||||||
@@ -41,6 +45,9 @@ struct HighScore
|
|||||||
sPlayerGuid = "";
|
sPlayerGuid = "";
|
||||||
sMachineGuid = "";
|
sMachineGuid = "";
|
||||||
iProductID = 0;
|
iProductID = 0;
|
||||||
|
ZERO( iTapNoteScores );
|
||||||
|
ZERO( iHoldNoteScores );
|
||||||
|
ZERO( fRadarActual );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator>=( const HighScore& other ) const;
|
bool operator>=( const HighScore& other ) const;
|
||||||
@@ -57,6 +64,12 @@ struct HighScore
|
|||||||
COMPARE( sPlayerGuid );
|
COMPARE( sPlayerGuid );
|
||||||
COMPARE( sMachineGuid );
|
COMPARE( sMachineGuid );
|
||||||
COMPARE( iProductID );
|
COMPARE( iProductID );
|
||||||
|
FOREACH_TapNoteScore( tns )
|
||||||
|
COMPARE( iTapNoteScores[tns] );
|
||||||
|
FOREACH_HoldNoteScore( hns )
|
||||||
|
COMPARE( iHoldNoteScores[hns] );
|
||||||
|
FOREACH_RadarCategory( rc )
|
||||||
|
COMPARE( fRadarActual[rc] );
|
||||||
#undef COMPARE
|
#undef COMPARE
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -899,6 +899,9 @@ void ScreenEvaluation::CommitScores(
|
|||||||
hs.sPlayerGuid = PROFILEMAN->IsUsingProfile(p) ? PROFILEMAN->GetProfile(p)->m_sGuid : "";
|
hs.sPlayerGuid = PROFILEMAN->IsUsingProfile(p) ? PROFILEMAN->GetProfile(p)->m_sGuid : "";
|
||||||
hs.sMachineGuid = PROFILEMAN->GetMachineProfile()->m_sGuid;
|
hs.sMachineGuid = PROFILEMAN->GetMachineProfile()->m_sGuid;
|
||||||
hs.iProductID = PREFSMAN->m_iProductID;
|
hs.iProductID = PREFSMAN->m_iProductID;
|
||||||
|
memcpy( hs.iTapNoteScores, stageStats.iTapNoteScores[p], sizeof(hs.iTapNoteScores) );
|
||||||
|
memcpy( hs.iHoldNoteScores, stageStats.iHoldNoteScores[p], sizeof(hs.iHoldNoteScores) );
|
||||||
|
memcpy( hs.fRadarActual, stageStats.fRadarActual[p], sizeof(hs.fRadarActual) );
|
||||||
|
|
||||||
StepsType st = GAMESTATE->GetCurrentStyleDef()->m_StepsType;
|
StepsType st = GAMESTATE->GetCurrentStyleDef()->m_StepsType;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user