Implement preview music properly as a new optional tag in the ssc file. Changed ScreenManager to emit an error instead of asserting if a screen attempts to use SetNewScreen inside an InitCommand. Changed decorations layer to be a proper child instead of stripping away the ActorFrame.

This commit is contained in:
Kyzentun
2015-03-04 01:31:02 -07:00
parent 519ad8d243
commit 0318f07d2d
16 changed files with 88 additions and 30 deletions
+18
View File
@@ -899,6 +899,24 @@ bool SongUtil::ValidateCurrentStepsCredit( const RString &sAnswer, RString &sErr
return true;
}
static LocalizedString PREVIEW_DOES_NOT_EXIST("SongUtil", "The preview file '%s' does not exist.");
bool SongUtil::ValidateCurrentSongPreview(const RString& answer, RString& error)
{
if(answer.empty())
{ return true; }
Song* song= GAMESTATE->m_pCurSong;
RString real_file= song->m_PreviewFile;
song->m_PreviewFile= answer;
RString path= song->GetPreviewMusicPath();
bool valid= DoesFileExist(path);
song->m_PreviewFile= real_file;
if(!valid)
{
error= ssprintf(PREVIEW_DOES_NOT_EXIST.GetValue(), answer.c_str());
}
return valid;
}
void SongUtil::GetAllSongGenres( vector<RString> &vsOut )
{
set<RString> genres;