save radar values in Catalog.xml
change Course to have the same title names as Song
This commit is contained in:
@@ -50,7 +50,10 @@ void SaveCatalogXml()
|
||||
StepsID stepsID;
|
||||
stepsID.FromSteps( pSteps );
|
||||
|
||||
pSongNode->AppendChild( stepsID.CreateNode() );
|
||||
XNode* pStepsIDNode = stepsID.CreateNode();
|
||||
pSongNode->AppendChild( pStepsIDNode );
|
||||
|
||||
pStepsIDNode->AppendChild( pSteps->GetRadarValues().CreateNode() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +71,8 @@ void SaveCatalogXml()
|
||||
|
||||
xml.AppendChild( pCourseNode );
|
||||
|
||||
pCourseNode->AppendChild( "Title", pCourse->m_sName );
|
||||
pCourseNode->AppendChild( "MainTitle", pCourse->GetDisplayMainTitle() );
|
||||
pCourseNode->AppendChild( "SubTitle", pCourse->GetDisplaySubTitle() );
|
||||
pCourseNode->AppendChild( "HasMods", pCourse->HasMods() );
|
||||
|
||||
FOREACH_StepsType( st )
|
||||
@@ -84,7 +88,10 @@ void SaveCatalogXml()
|
||||
TrailID trailID;
|
||||
trailID.FromTrail( pTrail );
|
||||
|
||||
pCourseNode->AppendChild( trailID.CreateNode() );
|
||||
XNode* pTrailIDNode = trailID.CreateNode();
|
||||
pCourseNode->AppendChild( pTrailIDNode );
|
||||
|
||||
pTrailIDNode->AppendChild( pTrail->GetRadarValues().CreateNode() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+51
-20
@@ -74,9 +74,9 @@ void Course::LoadFromCRSFile( CString sPath )
|
||||
|
||||
// handle the data
|
||||
if( 0 == stricmp(sValueName, "COURSE") )
|
||||
m_sName = sParams[1];
|
||||
m_sMainTitle = sParams[1];
|
||||
else if( 0 == stricmp(sValueName, "COURSETRANSLIT") )
|
||||
m_sNameTranslit = sParams[1];
|
||||
m_sMainTitleTranslit = sParams[1];
|
||||
else if( 0 == stricmp(sValueName, "REPEAT") )
|
||||
{
|
||||
CString str = sParams[1];
|
||||
@@ -249,11 +249,11 @@ void Course::LoadFromCRSFile( CString sPath )
|
||||
static TitleSubst tsub("courses");
|
||||
|
||||
TitleFields title;
|
||||
title.Title = m_sName;
|
||||
title.TitleTranslit = m_sNameTranslit;
|
||||
title.Title = m_sMainTitle;
|
||||
title.TitleTranslit = m_sMainTitleTranslit;
|
||||
tsub.Subst( title );
|
||||
m_sName = title.Title;
|
||||
m_sNameTranslit = title.TitleTranslit;
|
||||
m_sMainTitle = title.Title;
|
||||
m_sMainTitleTranslit = title.TitleTranslit;
|
||||
}
|
||||
|
||||
void Course::Init()
|
||||
@@ -266,7 +266,13 @@ void Course::Init()
|
||||
FOREACH_Difficulty(dc)
|
||||
m_iCustomMeter[dc] = -1;
|
||||
m_entries.clear();
|
||||
m_sPath = m_sName = m_sNameTranslit = m_sBannerPath = m_sCDTitlePath = "";
|
||||
m_sPath = "";
|
||||
m_sMainTitle = "";
|
||||
m_sMainTitleTranslit = "";
|
||||
m_sSubTitle = "";
|
||||
m_sSubTitleTranslit = "";
|
||||
m_sBannerPath = "";
|
||||
m_sCDTitlePath = "";
|
||||
ZERO( m_TrailCacheValid );
|
||||
m_iTrailCacheSeed = 0;
|
||||
}
|
||||
@@ -282,9 +288,9 @@ void Course::Save()
|
||||
return;
|
||||
}
|
||||
|
||||
f.PutLine( ssprintf("#COURSE:%s;", m_sName.c_str()) );
|
||||
if( m_sNameTranslit != "" )
|
||||
f.PutLine( ssprintf("#COURSETRANSLIT:%s;", m_sNameTranslit.c_str()) );
|
||||
f.PutLine( ssprintf("#COURSE:%s;", m_sMainTitle.c_str()) );
|
||||
if( m_sMainTitleTranslit != "" )
|
||||
f.PutLine( ssprintf("#COURSETRANSLIT:%s;", m_sMainTitleTranslit.c_str()) );
|
||||
if( m_bRepeat )
|
||||
f.PutLine( "#REPEAT:YES;" );
|
||||
if( m_iLives != -1 )
|
||||
@@ -388,10 +394,10 @@ void Course::AutogenEndlessFromGroup( CString sGroupName, Difficulty diff )
|
||||
|
||||
if( sGroupName == "" )
|
||||
{
|
||||
m_sName = "All Songs";
|
||||
m_sMainTitle = "All Songs";
|
||||
// m_sBannerPath = ""; // XXX
|
||||
} else {
|
||||
m_sName = SONGMAN->ShortenGroupName( sGroupName );
|
||||
m_sMainTitle = SONGMAN->ShortenGroupName( sGroupName );
|
||||
m_sBannerPath = SONGMAN->GetGroupBannerPath( sGroupName );
|
||||
}
|
||||
|
||||
@@ -420,7 +426,7 @@ void Course::AutogenNonstopFromGroup( CString sGroupName, Difficulty diff )
|
||||
|
||||
m_bRepeat = false;
|
||||
|
||||
m_sName += " Random";
|
||||
m_sMainTitle += " Random";
|
||||
|
||||
// resize to 4
|
||||
while( m_entries.size() < 4 )
|
||||
@@ -445,9 +451,9 @@ void Course::AutogenOniFromArtist( CString sArtistName, CString sArtistNameTrans
|
||||
|
||||
/* "Artist Oni" is a little repetitive; "by Artist" stands out less, and lowercasing
|
||||
* "by" puts more emphasis on the artist's name. It also sorts them together. */
|
||||
m_sName = "by " + sArtistName;
|
||||
m_sMainTitle = "by " + sArtistName;
|
||||
if( sArtistNameTranslit != sArtistName )
|
||||
m_sNameTranslit = "by " + sArtistNameTranslit;
|
||||
m_sMainTitleTranslit = "by " + sArtistNameTranslit;
|
||||
|
||||
|
||||
// m_sBannerPath = ""; // XXX
|
||||
@@ -526,11 +532,36 @@ struct SortTrailEntry
|
||||
bool operator< ( const SortTrailEntry &rhs ) const { return SortMeter < rhs.SortMeter; }
|
||||
};
|
||||
|
||||
CString Course::GetDisplayName() const
|
||||
CString Course::GetDisplayMainTitle() const
|
||||
{
|
||||
if( !PREFSMAN->m_bShowNative )
|
||||
return GetTranslitName();
|
||||
return m_sName;
|
||||
return GetTranslitMainTitle();
|
||||
return m_sMainTitle;
|
||||
}
|
||||
|
||||
CString Course::GetDisplaySubTitle() const
|
||||
{
|
||||
if( !PREFSMAN->m_bShowNative )
|
||||
return GetTranslitSubTitle();
|
||||
return m_sSubTitle;
|
||||
}
|
||||
|
||||
CString Course::GetFullDisplayTitle() const
|
||||
{
|
||||
CString Title = GetDisplayMainTitle();
|
||||
CString SubTitle = GetDisplaySubTitle();
|
||||
|
||||
if(!SubTitle.empty()) Title += " " + SubTitle;
|
||||
return Title;
|
||||
}
|
||||
|
||||
CString Course::GetFullTranslitTitle() const
|
||||
{
|
||||
CString Title = GetTranslitMainTitle();
|
||||
CString SubTitle = GetTranslitSubTitle();
|
||||
|
||||
if(!SubTitle.empty()) Title += " " + SubTitle;
|
||||
return Title;
|
||||
}
|
||||
|
||||
/* This is called by many simple functions, like Course::GetTotalSeconds, and may
|
||||
@@ -642,7 +673,7 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail )
|
||||
// Construct a new Trail, add it to the cache, then return it.
|
||||
//
|
||||
/* Different seed for each course, but the same for the whole round: */
|
||||
RandomGen rnd( GAMESTATE->m_iRoundSeed + GetHashForString(m_sName) );
|
||||
RandomGen rnd( GAMESTATE->m_iRoundSeed + GetHashForString(m_sMainTitle) );
|
||||
|
||||
vector<CourseEntry> tmp_entries;
|
||||
if( m_bRandomize )
|
||||
@@ -1017,7 +1048,7 @@ void Course::UpdateCourseStats( StepsType st )
|
||||
// themes change..
|
||||
|
||||
LOG->Trace("%s: Total feet: %d",
|
||||
this->m_sName.c_str(),
|
||||
this->m_sMainTitle.c_str(),
|
||||
m_SortOrder_TotalDifficulty );
|
||||
}
|
||||
|
||||
|
||||
+16
-4
@@ -75,8 +75,11 @@ public:
|
||||
|
||||
bool m_bIsAutogen; // was this created by AutoGen?
|
||||
CString m_sPath;
|
||||
CString m_sName, m_sNameTranslit;
|
||||
private:
|
||||
CString m_sMainTitle, m_sMainTitleTranslit;
|
||||
CString m_sSubTitle, m_sSubTitleTranslit;
|
||||
|
||||
public:
|
||||
bool HasBanner() const;
|
||||
|
||||
CString m_sBannerPath;
|
||||
@@ -90,9 +93,18 @@ public:
|
||||
|
||||
vector<CourseEntry> m_entries;
|
||||
|
||||
/* If PREFSMAN->m_bShowNative is off, this are the same as GetTranslit* below. */
|
||||
CString GetDisplayName() const;
|
||||
CString GetTranslitName() const { return m_sNameTranslit.size()? m_sNameTranslit: m_sName; }
|
||||
/* If PREFSMAN->m_bShowNative is off, these are the same as GetTranslit* below.
|
||||
* Otherwise, they return the main titles. */
|
||||
CString GetDisplayMainTitle() const;
|
||||
CString GetDisplaySubTitle() const;
|
||||
|
||||
/* Returns the transliterated titles, if any; otherwise returns the main titles. */
|
||||
CString GetTranslitMainTitle() const { return m_sMainTitleTranslit.size()? m_sMainTitleTranslit: m_sMainTitle; }
|
||||
CString GetTranslitSubTitle() const { return m_sSubTitleTranslit.size()? m_sSubTitleTranslit: m_sSubTitle; }
|
||||
|
||||
/* "title subtitle" */
|
||||
CString GetFullDisplayTitle() const;
|
||||
CString GetFullTranslitTitle() const;
|
||||
|
||||
// Dereferences course_entries and returns only the playable Songs and Steps
|
||||
Trail* GetTrail( StepsType st, CourseDifficulty cd=DIFFICULTY_MEDIUM ) const;
|
||||
|
||||
@@ -22,8 +22,8 @@ static bool CompareCoursePointersByName(const Course* pCourse1, const Course* pC
|
||||
// XXX: That doesn't happen to me, and it shouldn't (strcmp is strictly
|
||||
// a byte sort, though CompareNoCase doesn't use strcmp). Are you sure
|
||||
// you didn't have only one space before? -glenn
|
||||
CString sName1 = pCourse1->m_sName;
|
||||
CString sName2 = pCourse2->m_sName;
|
||||
CString sName1 = pCourse1->GetFullDisplayTitle();
|
||||
CString sName2 = pCourse2->GetFullDisplayTitle();
|
||||
sName1.Replace( " " , " 0" );
|
||||
sName2.Replace( " " , " 0" );
|
||||
return sName1.CompareNoCase( sName2 ) == -1;
|
||||
@@ -74,7 +74,7 @@ static bool MovePlayersBestToEnd( const Course* pCourse1, const Course* pCourse2
|
||||
if( !C1HasBest && C2HasBest )
|
||||
return true;
|
||||
|
||||
return pCourse1->m_sName < pCourse2->m_sName;
|
||||
return CompareCoursePointersByName( pCourse1, pCourse2 );
|
||||
}
|
||||
|
||||
static bool CompareRandom( const Course* pCourse1, const Course* pCourse2 )
|
||||
@@ -140,7 +140,7 @@ bool CompareCoursePointersBySortValueDescending(const Course *pSong1, const Cour
|
||||
|
||||
bool CompareCoursePointersByTitle( const Course *pCourse1, const Course *pCourse2 )
|
||||
{
|
||||
return pCourse1->m_sName < pCourse2->m_sName;
|
||||
return CompareCoursePointersByName( pCourse1, pCourse2 );
|
||||
}
|
||||
|
||||
void CourseUtil::SortCoursePointerArrayByAvgDifficulty( vector<Course*> &apCourses )
|
||||
@@ -183,18 +183,18 @@ void CourseID::FromCourse( const Course *p )
|
||||
if( p->m_bIsAutogen )
|
||||
{
|
||||
sPath = "";
|
||||
sName = p->m_sName;
|
||||
sFullTitle = p->GetFullDisplayTitle();
|
||||
}
|
||||
else
|
||||
{
|
||||
sPath = p->m_sPath;
|
||||
sName = "";
|
||||
sFullTitle = "";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sPath = "";
|
||||
sName = "";
|
||||
sFullTitle = "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ Course *CourseID::ToCourse() const
|
||||
pCourse = SONGMAN->GetCourseFromPath( sPath );
|
||||
if( pCourse )
|
||||
return pCourse;
|
||||
pCourse = SONGMAN->GetCourseFromName( sName );
|
||||
pCourse = SONGMAN->GetCourseFromName( sFullTitle );
|
||||
return pCourse;
|
||||
}
|
||||
|
||||
@@ -215,8 +215,8 @@ XNode* CourseID::CreateNode() const
|
||||
|
||||
if( !sPath.empty() )
|
||||
pNode->AppendAttr( "Path", sPath );
|
||||
if( !sName.empty() )
|
||||
pNode->AppendAttr( "Name", sName );
|
||||
if( !sFullTitle.empty() )
|
||||
pNode->AppendAttr( "FullTitle", sFullTitle );
|
||||
|
||||
return pNode;
|
||||
}
|
||||
@@ -225,21 +225,21 @@ void CourseID::LoadFromNode( const XNode* pNode )
|
||||
{
|
||||
ASSERT( pNode->name == "Course" );
|
||||
pNode->GetAttrValue("Path", sPath);
|
||||
pNode->GetAttrValue("Name", sName);
|
||||
pNode->GetAttrValue("FullTitle", sFullTitle);
|
||||
}
|
||||
|
||||
CString CourseID::ToString() const
|
||||
{
|
||||
if( !sPath.empty() )
|
||||
return sPath;
|
||||
if( !sName.empty() )
|
||||
return sName;
|
||||
if( !sFullTitle.empty() )
|
||||
return sFullTitle;
|
||||
return "";
|
||||
}
|
||||
|
||||
bool CourseID::IsValid() const
|
||||
{
|
||||
return !sPath.empty() || !sName.empty();
|
||||
return !sPath.empty() || !sFullTitle.empty();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace CourseUtil
|
||||
class CourseID
|
||||
{
|
||||
CString sPath;
|
||||
CString sName;
|
||||
CString sFullTitle;
|
||||
|
||||
public:
|
||||
CourseID() { Unset(); }
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
Course *ToCourse() const;
|
||||
bool operator<( const CourseID &other ) const
|
||||
{
|
||||
return sPath < other.sPath || sName < other.sName;
|
||||
return sPath < other.sPath || sFullTitle < other.sFullTitle;
|
||||
}
|
||||
|
||||
XNode* CreateNode() const;
|
||||
|
||||
@@ -401,7 +401,7 @@ void EditCoursesMenu::OnRowValueChanged( Row row )
|
||||
{
|
||||
case ROW_COURSE:
|
||||
CHECKPOINT;
|
||||
m_textValue[ROW_COURSE].SetText( pCourse->m_sName );
|
||||
m_textValue[ROW_COURSE].SetText( pCourse->GetFullDisplayTitle() );
|
||||
m_CourseBanner.LoadFromCourse( pCourse );
|
||||
m_CourseBanner.ScaleToClipped( COURSE_BANNER_WIDTH, COURSE_BANNER_HEIGHT );
|
||||
m_iSelection[ROW_ENTRY] = 0;
|
||||
|
||||
@@ -1520,7 +1520,7 @@ void GameState::GetRankingFeats( PlayerNumber pn, vector<RankingFeat> &asFeatsOu
|
||||
RankingFeat feat;
|
||||
feat.Type = RankingFeat::COURSE;
|
||||
feat.pCourse = pCourse;
|
||||
feat.Feat = ssprintf("MR #%d in %s", i+1, pCourse->m_sName.c_str() );
|
||||
feat.Feat = ssprintf("MR #%d in %s", i+1, pCourse->GetFullDisplayTitle().c_str() );
|
||||
if( cd != DIFFICULTY_MEDIUM )
|
||||
feat.Feat += " " + CourseDifficultyToThemedString(cd);
|
||||
feat.pStringToFill = &hs.sName;
|
||||
@@ -1546,7 +1546,7 @@ void GameState::GetRankingFeats( PlayerNumber pn, vector<RankingFeat> &asFeatsOu
|
||||
RankingFeat feat;
|
||||
feat.Type = RankingFeat::COURSE;
|
||||
feat.pCourse = pCourse;
|
||||
feat.Feat = ssprintf("PR #%d in %s", i+1, pCourse->m_sName.c_str() );
|
||||
feat.Feat = ssprintf("PR #%d in %s", i+1, pCourse->GetFullDisplayTitle().c_str() );
|
||||
feat.pStringToFill = &hs.sName;
|
||||
feat.grade = GRADE_NO_DATA;
|
||||
feat.iScore = hs.iScore;
|
||||
|
||||
@@ -130,8 +130,8 @@ void MusicWheelItem::LoadFromWheelItemData( WheelItemData* pWID )
|
||||
bt = &m_textSectionName;
|
||||
break;
|
||||
case TYPE_COURSE:
|
||||
sDisplayName = data->m_pCourse->GetDisplayName();
|
||||
sTranslitName = data->m_pCourse->GetTranslitName();
|
||||
sDisplayName = data->m_pCourse->GetFullDisplayTitle();
|
||||
sTranslitName = data->m_pCourse->GetFullTranslitTitle();
|
||||
bt = &m_textCourse;
|
||||
break;
|
||||
case TYPE_SORT:
|
||||
|
||||
@@ -1135,7 +1135,7 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
|
||||
|
||||
if( bUsesThisSong )
|
||||
{
|
||||
g_CourseMode.rows[0].choices.push_back( crs->m_sName );
|
||||
g_CourseMode.rows[0].choices.push_back( crs->GetFullDisplayTitle() );
|
||||
if( crs == m_pAttacksFromCourse )
|
||||
g_CourseMode.rows[0].defaultChoice = g_CourseMode.rows[0].choices.size()-1;
|
||||
}
|
||||
|
||||
@@ -711,7 +711,7 @@ float ScreenRanking::SetPage( PageToShow pts )
|
||||
return SECONDS_PER_PAGE;
|
||||
case PAGE_TYPE_TRAIL:
|
||||
{
|
||||
m_textCourseTitle.SetText( pts.pCourse->m_sName );
|
||||
m_textCourseTitle.SetText( pts.pCourse->GetFullDisplayTitle() );
|
||||
m_Banner.LoadFromCourse( pts.pCourse );
|
||||
m_textStepsType.SetText( GameManager::NotesTypeToThemedString(pts.nt) );
|
||||
|
||||
@@ -814,7 +814,7 @@ float ScreenRanking::SetPage( PageToShow pts )
|
||||
CourseScoreRowItem *pCourseScoreRowItem = m_vpCourseScoreRowItem[c];
|
||||
const Course* pCourse = pCourseScoreRowItem->m_pCourse;
|
||||
|
||||
pCourseScoreRowItem->m_textSongTitle.SetText( pCourse->m_sName );
|
||||
pCourseScoreRowItem->m_textSongTitle.SetText( pCourse->GetFullDisplayTitle() );
|
||||
FOREACH_ShownCourseDifficulty( cd )
|
||||
{
|
||||
BitmapText* pTextStepsScore = &pCourseScoreRowItem->m_textStepsScore[cd];
|
||||
|
||||
@@ -133,7 +133,7 @@ ScreenUnlock::ScreenUnlock( CString sClassName ) : ScreenAttract( sClassName )
|
||||
if (crs != NULL)
|
||||
{
|
||||
text->SetMaxWidth( MaxWidth );
|
||||
text->SetText( crs->m_sName );
|
||||
text->SetText( crs->GetFullDisplayTitle() );
|
||||
text->Command("Diffuse,0,1,0,1");
|
||||
}
|
||||
else // entry isn't a song or course
|
||||
|
||||
@@ -893,7 +893,7 @@ Course* SongManager::GetCourseFromPath( CString sPath )
|
||||
Course* SongManager::GetCourseFromName( CString sName )
|
||||
{
|
||||
for( unsigned int i=0; i<m_pCourses.size(); i++ )
|
||||
if( sName.CompareNoCase(m_pCourses[i]->m_sName) == 0 )
|
||||
if( sName.CompareNoCase(m_pCourses[i]->GetFullDisplayTitle()) == 0 )
|
||||
return m_pCourses[i];
|
||||
|
||||
return NULL;
|
||||
@@ -947,7 +947,7 @@ Course *SongManager::FindCourse( CString sName )
|
||||
{
|
||||
for( unsigned i = 0; i < m_pCourses.size(); i++ )
|
||||
{
|
||||
if( !sName.CompareNoCase(m_pCourses[i]->m_sName) )
|
||||
if( !sName.CompareNoCase(m_pCourses[i]->GetFullDisplayTitle()) )
|
||||
return m_pCourses[i];
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ Trail *TrailID::ToTrail( const Course *p, bool bAllowNull ) const
|
||||
|
||||
Trail *ret = p->GetTrail( st, cd );
|
||||
if( !bAllowNull && ret == NULL )
|
||||
RageException::Throw( "%i, %i, \"%s\"", st, cd, p->m_sName.c_str() );
|
||||
RageException::Throw( "%i, %i, \"%s\"", st, cd, p->GetFullDisplayTitle().c_str() );
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user