diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index 77056d4233..a8c4ce0f6b 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -10,8 +10,6 @@ // - ScreenSelectDifficultyEX // - ScreenSelectGroup // - ScreenSelectMusic -// - ScreenSelectStyle5th -// - ScreenSelectStyle [Common] ColorP1=0.4,1.0,0.8,1 // sea green @@ -56,6 +54,7 @@ Choice7=screen,ScreenExit Name7=EXIT Choice8=screen,ScreenTest Name8=SANDBOX +NumCodes=0 TimerSeconds=-1 // none StyleIcon=0 MemoryCardIcons=0 @@ -107,6 +106,7 @@ Choice2=Style,versus;name,versus Choice3=Style,couple;name,couple Choice4=Style,double;name,double Choice5=Style,solo;name,solo +NumCodes=0 TimerSeconds=40 StyleIcon=1 MemoryCardIcons=1 @@ -268,6 +268,7 @@ Choice5=PlayMode,nonstop;name,nonstop Choice6=PlayMode,oni;name,oni Choice7=PlayMode,endless;name,endless Choice8=PlayMode,rave;name,rave +NumCodes=0 NumChoicesOnPage1=4 TimerSeconds=40 StyleIcon=1 diff --git a/stepmania/src/ScreenSelect.cpp b/stepmania/src/ScreenSelect.cpp index a8605c8d0e..1440b8e790 100644 --- a/stepmania/src/ScreenSelect.cpp +++ b/stepmania/src/ScreenSelect.cpp @@ -25,11 +25,15 @@ #include "ThemeManager.h" #include "ModeChoice.h" #include "RageDisplay.h" +#include "UnlockSystem.h" #include "arch/ArchHooks/ArchHooks.h" #define NUM_CHOICES THEME->GetMetricI(m_sName,"NumChoices") #define CHOICE( choice ) THEME->GetMetric (m_sName,ssprintf("Choice%d",choice+1)) +#define NUM_CODES THEME->GetMetricI(m_sName,"NumCodes") +#define CODE( choice ) THEME->GetMetric (m_sName,ssprintf("Code%d",choice+1)) +#define CODE_ACTION( choice ) THEME->GetMetric (m_sName,ssprintf("Code%dAction",choice+1)) #define HELP_TEXT THEME->GetMetric (m_sName,"HelpText") #define NEXT_SCREEN( choice ) THEME->GetMetric (m_sName,ssprintf("NextScreen%d",choice+1)) @@ -39,7 +43,8 @@ ScreenSelect::ScreenSelect( CString sClassName ) : Screen(sClassName) m_sName = sClassName; - for( int c=0; cAddChild( &m_Menu ); + + for( c=0; cTrace("entered code for '%s'", action.c_str()); + vector parts; + split( action, ";", parts, true ); + for( unsigned j = 0; j < parts.size(); ++j ) + { + vector asBits; + split( parts[j], ",", asBits, true ); + if( !asBits[0].CompareNoCase("unlock") ) + UNLOCKSYS->UnlockCode( atoi(asBits[1]) ); + if( !asBits[0].CompareNoCase("sound") ) + SOUND->PlayOnce( THEME->GetPathToS( asBits[1] ) ); + } + + } Screen::Input( DeviceI, type, GameI, MenuI, StyleI ); // default input handler } diff --git a/stepmania/src/ScreenSelect.h b/stepmania/src/ScreenSelect.h index 6f897b2330..af4219298e 100644 --- a/stepmania/src/ScreenSelect.h +++ b/stepmania/src/ScreenSelect.h @@ -15,6 +15,7 @@ #include "MenuElements.h" #include "BGAnimation.h" #include "ModeChoice.h" +#include "CodeDetector.h" // Derived classes must send this when done const ScreenMessage SM_AllDoneChoosing = (ScreenMessage)(SM_User+123); // unique @@ -43,6 +44,9 @@ protected: MenuElements m_Menu; BGAnimation m_BGAnimations[MAX_CHOICES]; vector m_aModeChoices; // derived classes should look here for what choices are available + + vector m_aCodes; + vector m_aCodeActions; };