stats.xml:

theme more elements
show HighScore details
clean up some tables
This commit is contained in:
Chris Danford
2004-07-19 08:05:14 +00:00
parent e9327c9bb8
commit 9199410e82
11 changed files with 88 additions and 25 deletions
+7 -15
View File
@@ -4536,18 +4536,10 @@ ShowStyleDouble=1
ShowStyleCouple=1
ShowStyleSolo=1
ShowStyleReal=1
ShowHighScoreGrade=1
ShowHighScoreScore=1
ShowHighScorePercent=1
ShowRadarCategoryStream=1
ShowRadarCategoryVoltage=1
ShowRadarCategoryAir=1
ShowRadarCategoryFreeze=1
ShowRadarCategoryChaos=1
ShowRadarCategoryTaps=1
ShowRadarCategoryJumps=1
ShowRadarCategoryHolds=1
ShowRadarCategoryMines=1
ShowRadarCategoryHands=1
InternetRankingHomeUrl=http://www.stepmania.com/stepmania
InternetRankingUploadUrl=http://www.stepmania.com/stepmania/upload_stats.php
InternetRankingViewGuidUrl=http://www.stepmania.com/stepmania/view_guid.php
StatsTitle=StepMania Stats
StatsHeader=StepMania Stats
StatsFooterText=generated by StepMania
StatsFooterLink=http://www.stepmania.com
+36
View File
@@ -23,6 +23,7 @@
#define INTERNET_RANKING_HOME_URL THEME->GetMetric ("CatalogXml","InternetRankingHomeUrl")
#define INTERNET_RANKING_UPLOAD_URL THEME->GetMetric ("CatalogXml","InternetRankingUploadUrl")
#define INTERNET_RANKING_VIEW_GUID_URL THEME->GetMetric ("CatalogXml","InternetRankingViewGuidUrl")
#define STATS_TITLE THEME->GetMetric ("CatalogXml","StatsTitle")
#define STATS_HEADER THEME->GetMetric ("CatalogXml","StatsHeader")
#define STATS_FOOTER_TEXT THEME->GetMetric ("CatalogXml","StatsFooterText")
#define STATS_FOOTER_LINK THEME->GetMetric ("CatalogXml","StatsFooterLink")
@@ -183,11 +184,46 @@ void SaveCatalogXml()
pNode2->AppendAttr( "DisplayAs", GradeToThemedString(g) );
}
}
{
FOREACH_TapNoteScore( tns )
{
XNode* pNode2 = pNode->AppendChild( "TapNoteScore", TapNoteScoreToString(tns) );
pNode2->AppendAttr( "DisplayAs", TapNoteScoreToThemedString(tns) );
}
}
{
FOREACH_HoldNoteScore( hns )
{
XNode* pNode2 = pNode->AppendChild( "HoldNoteScore", HoldNoteScoreToString(hns) );
pNode2->AppendAttr( "DisplayAs", HoldNoteScoreToThemedString(hns) );
}
}
{
FOREACH_RadarCategory( rc )
{
XNode* pNode2 = pNode->AppendChild( "RadarValue", RadarCategoryToString(rc) );
pNode2->AppendAttr( "DisplayAs", RadarCategoryToThemedString(rc) );
}
}
{
set<CString> modifiers;
THEME->GetModifierNames( modifiers );
for( set<CString>::const_iterator iter = modifiers.begin(); iter != modifiers.end(); iter++ )
{
XNode* pNode2 = pNode->AppendChild( "Modifier", *iter );
pNode2->AppendAttr( "DisplayAs", PlayerOptions::ThemeMod(*iter) );
}
}
}
xml.AppendChild( "InternetRankingHomeUrl", INTERNET_RANKING_HOME_URL );
xml.AppendChild( "InternetRankingUploadUrl", INTERNET_RANKING_UPLOAD_URL );
xml.AppendChild( "InternetRankingViewGuidUrl", INTERNET_RANKING_VIEW_GUID_URL );
xml.AppendChild( "StatsTitle", STATS_TITLE );
xml.AppendChild( "StatsHeader", STATS_HEADER );
xml.AppendChild( "StatsFooterText", STATS_FOOTER_TEXT );
xml.AppendChild( "StatsFooterLink", STATS_FOOTER_LINK );
+14
View File
@@ -43,6 +43,20 @@ struct DateTime : public tm
// they're equal
return true;
}
bool operator==( const DateTime& other ) const
{
#define COMPARE(x) if( x!=other.x ) return false;
COMPARE( tm_year );
COMPARE( tm_mon );
COMPARE( tm_mday );
COMPARE( tm_hour );
COMPARE( tm_min );
COMPARE( tm_sec );
#undef COMPARE
return true;
}
bool operator!=( const DateTime& other ) const { return !operator==(other); }
static DateTime GetNowDateTime();
static DateTime GetNowDate(); // GetNowDateTime() with time chopped off
+2
View File
@@ -99,6 +99,7 @@ static const CString TapNoteScoreNames[NUM_TAP_NOTE_SCORES] = {
};
XToString( TapNoteScore );
StringToX( TapNoteScore );
XToThemedString( TapNoteScore );
static const CString HoldNoteScoreNames[NUM_HOLD_NOTE_SCORES] = {
@@ -108,6 +109,7 @@ static const CString HoldNoteScoreNames[NUM_HOLD_NOTE_SCORES] = {
};
XToString( HoldNoteScore );
StringToX( HoldNoteScore );
XToThemedString( HoldNoteScore );
static const CString MemoryCardStateNames[NUM_MEMORY_CARD_STATES] = {
+3 -1
View File
@@ -164,6 +164,7 @@ enum TapNoteScore {
};
#define FOREACH_TapNoteScore( tns ) FOREACH_ENUM( TapNoteScore, NUM_TAP_NOTE_SCORES, tns )
const CString& TapNoteScoreToString( TapNoteScore tns );
CString TapNoteScoreToThemedString( TapNoteScore tns );
TapNoteScore StringToTapNoteScore( const CString& str );
@@ -175,7 +176,8 @@ enum HoldNoteScore
NUM_HOLD_NOTE_SCORES
};
#define FOREACH_HoldNoteScore( hns ) FOREACH_ENUM( HoldNoteScore, NUM_HOLD_NOTE_SCORES, hns )
const CString& HoldNoteScoreToString( HoldNoteScore tns );
const CString& HoldNoteScoreToString( HoldNoteScore hns );
CString HoldNoteScoreToThemedString( HoldNoteScore hns );
HoldNoteScore StringToHoldNoteScore( const CString& str );
+3 -4
View File
@@ -44,7 +44,7 @@ XNode* HighScore::CreateNode() const
pNode->AppendChild( "PercentDP", fPercentDP );
pNode->AppendChild( "SurviveSeconds", fSurviveSeconds );
pNode->AppendChild( "Modifiers", sModifiers );
pNode->AppendChild( "Time", (int)time );
pNode->AppendChild( "DateTime", dateTime );
pNode->AppendChild( "PlayerGuid", sPlayerGuid );
pNode->AppendChild( "MachineGuid", sMachineGuid );
pNode->AppendChild( "ProductID", iProductID );
@@ -54,8 +54,7 @@ XNode* HighScore::CreateNode() const
XNode* pHoldNoteScores = pNode->AppendChild( "HoldNoteScores" );
FOREACH_HoldNoteScore( hns )
pHoldNoteScores->AppendChild( HoldNoteScoreToString(hns), iHoldNoteScores[hns] );
XNode* pRadarCategories = pNode->AppendChild( "RadarActuals" );
pRadarCategories->AppendChild( radarValues.CreateNode() );
pNode->AppendChild( radarValues.CreateNode() );
return pNode;
}
@@ -77,7 +76,7 @@ void HighScore::LoadFromNode( const XNode* pNode )
pNode->GetChildValue( "PercentDP", fPercentDP );
pNode->GetChildValue( "SurviveSeconds", fSurviveSeconds );
pNode->GetChildValue( "Modifiers", sModifiers );
pNode->GetChildValue( "Time", (int&)time );
pNode->GetChildValue( "DateTime", dateTime );
pNode->GetChildValue( "PlayerGuid", sPlayerGuid );
pNode->GetChildValue( "MachineGuid", sMachineGuid );
pNode->GetChildValue( "ProductID", iProductID );
+4 -3
View File
@@ -6,6 +6,7 @@
#include "Grade.h"
#include "GameConstantsAndTypes.h"
#include "RadarValues.h"
#include "DateTime.h"
struct XNode;
@@ -17,7 +18,7 @@ struct HighScore
float fPercentDP;
float fSurviveSeconds;
CString sModifiers;
time_t time; // return value of time() when screenshot was taken
DateTime dateTime; // return value of time() when screenshot was taken
CString sPlayerGuid; // who made this high score
CString sMachineGuid; // where this high score was made
int iProductID;
@@ -34,7 +35,7 @@ struct HighScore
fPercentDP = 0;
fSurviveSeconds = 0;
sModifiers = "";
time = 0;
dateTime.Init();
sPlayerGuid = "";
sMachineGuid = "";
iProductID = 0;
@@ -53,7 +54,7 @@ struct HighScore
COMPARE( fPercentDP );
COMPARE( fSurviveSeconds );
COMPARE( sModifiers );
COMPARE( time );
COMPARE( dateTime );
COMPARE( sPlayerGuid );
COMPARE( sMachineGuid );
COMPARE( iProductID );
+1 -1
View File
@@ -89,7 +89,7 @@ void Profile::InitGeneralData()
m_iNumToasties = 0;
m_UnlockedSongs.clear();
m_sLastPlayedMachineGuid = "";
m_LastPlayedDate = DateTime::GetNowDate();
m_LastPlayedDate.Init();
m_iTotalTapsAndHolds = 0;
m_iTotalJumps = 0;
m_iTotalHolds = 0;
+1 -1
View File
@@ -929,7 +929,7 @@ void ScreenEvaluation::CommitScores(
hs.fPercentDP = stageStats.GetPercentDancePoints( p );
hs.fSurviveSeconds = stageStats.fAliveSeconds[p];
hs.sModifiers = GAMESTATE->m_PlayerOptions[p].GetString();
hs.time = time(NULL);
hs.dateTime = DateTime::GetNowDateTime();
hs.sPlayerGuid = PROFILEMAN->IsUsingProfile(p) ? PROFILEMAN->GetProfile(p)->m_sGuid : "";
hs.sMachineGuid = PROFILEMAN->GetMachineProfile()->m_sGuid;
hs.iProductID = PREFSMAN->m_iProductID;
+15
View File
@@ -642,6 +642,21 @@ CString ThemeManager::GetPathToN( CString sFileName, bool bOptional ) { CString
CString ThemeManager::GetPathToS( CString sFileName, bool bOptional ) { CString sClassName, sElement; FileNameToClassAndElement(sFileName,sClassName,sElement); return GetPathS(sClassName,sElement,bOptional); }
CString ThemeManager::GetPathToO( CString sFileName, bool bOptional ) { CString sClassName, sElement; FileNameToClassAndElement(sFileName,sClassName,sElement); return GetPathO(sClassName,sElement,bOptional); }
void ThemeManager::GetModifierNames( set<CString>& AddTo )
{
const IniFile::key *cur = m_pIniCurMetrics->GetKey( "OptionNames" );
const IniFile::key *base = m_pIniBaseMetrics->GetKey( "OptionNames" );
for( IniFile::key::const_iterator iter = cur->begin(); iter != cur->end(); iter++ )
{
AddTo.insert( iter->first );
}
for( IniFile::key::const_iterator iter = base->begin(); iter != base->end(); iter++ )
{
AddTo.insert( iter->first );
}
}
/*
* (c) 2001-2004 Chris Danford
* All rights reserved.
+2
View File
@@ -5,6 +5,7 @@
#include "RageTypes.h"
#include "RageTimer.h"
#include <set>
class IniFile;
@@ -27,6 +28,7 @@ public:
void NextTheme();
void ReloadMetrics();
void ReloadMetricsIfNecessary();
void GetModifierNames( set<CString>& AddTo );
/* I renamed these for two reasons. The overload conflicts with the ones below:
* GetPathToB( str, str ) was matching the ones below instead of these. It's also