From 984dc752b22185351f1a5ce2e83f04f52119c506 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 22 Jan 2004 03:26:59 +0000 Subject: [PATCH] add song-based branching --- stepmania/src/ScreenBranch.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/stepmania/src/ScreenBranch.cpp b/stepmania/src/ScreenBranch.cpp index a07de86fb9..77b61a9ee0 100644 --- a/stepmania/src/ScreenBranch.cpp +++ b/stepmania/src/ScreenBranch.cpp @@ -19,6 +19,7 @@ #include "Grade.h" #include "GameState.h" #include "StageStats.h" +#include "SongManager.h" #define CHOICES THEME->GetMetric (m_sName,"Choices") #define CONDITION(choice) THEME->GetMetric (m_sName,"Condition"+choice) @@ -34,6 +35,16 @@ bool EvaluateCondition( CString sCondition ) CStringArray as; split( sCondition, ",", as, false ); + if( as.size()==3 && as[0].CompareNoCase("song")==0 ) + { + const CString &sOp = as[1]; + const CString &path = as[2]; + + const Song *s = SONGMAN->FindSong( path ); + if( sOp == "=" ) + return s == GAMESTATE->m_pCurSong; + } + if( as.size()==3 && as[0].CompareNoCase("topgrade")==0 ) { Grade top_grade = GRADE_FAILED;