move "unlock" and "sound" into GameCommand

This commit is contained in:
Chris Danford
2004-12-05 11:49:29 +00:00
parent 58b52c680f
commit a56f11b221
2 changed files with 3 additions and 19 deletions
+3 -18
View File
@@ -14,7 +14,6 @@
#include "ThemeManager.h" #include "ThemeManager.h"
#include "GameCommand.h" #include "GameCommand.h"
#include "RageDisplay.h" #include "RageDisplay.h"
#include "UnlockSystem.h"
#include "arch/ArchHooks/ArchHooks.h" #include "arch/ArchHooks/ArchHooks.h"
#include "LightsManager.h" #include "LightsManager.h"
@@ -23,7 +22,7 @@
#define CHOICE( sChoiceName ) THEME->GetMetricA(m_sName,ssprintf("Choice%s",sChoiceName.c_str())) #define CHOICE( sChoiceName ) THEME->GetMetricA(m_sName,ssprintf("Choice%s",sChoiceName.c_str()))
#define NUM_CODES THEME->GetMetricI(m_sName,"NumCodes") #define NUM_CODES THEME->GetMetricI(m_sName,"NumCodes")
#define CODE( c ) THEME->GetMetric (m_sName,ssprintf("Code%d",c+1)) #define CODE( c ) THEME->GetMetric (m_sName,ssprintf("Code%d",c+1))
#define CODE_ACTION( c ) THEME->GetMetric (m_sName,ssprintf("Code%dAction",c+1)) #define CODE_ACTION( c ) THEME->GetMetricA(m_sName,ssprintf("Code%dAction",c+1))
#define HELP_TEXT THEME->GetMetric (m_sName,"HelpText") #define HELP_TEXT THEME->GetMetric (m_sName,"HelpText")
#define NEXT_SCREEN( c ) THEME->GetMetric (m_sName,ssprintf("NextScreen%d",c+1)) #define NEXT_SCREEN( c ) THEME->GetMetric (m_sName,ssprintf("NextScreen%d",c+1))
@@ -71,9 +70,8 @@ ScreenSelect::ScreenSelect( CString sClassName ) : ScreenWithMenuElements(sClass
continue; continue;
m_aCodes.push_back( code ); m_aCodes.push_back( code );
m_aCodeActions.push_back( CODE_ACTION(c) );
GameCommand mc; GameCommand mc;
mc.Load( c, ParseCommands(CODE_ACTION(c)) ); mc.Load( c, CODE_ACTION(c) );
m_aCodeChoices.push_back( mc ); m_aCodeChoices.push_back( mc );
} }
@@ -145,20 +143,7 @@ void ScreenSelect::Input( const DeviceInput& DeviceI, const InputEventType type,
if( !m_aCodes[i].EnteredCode( GameI.controller ) ) if( !m_aCodes[i].EnteredCode( GameI.controller ) )
continue; continue;
const CString &action = m_aCodeActions[i]; LOG->Trace("entered code for index %d", i);
LOG->Trace("entered code for '%s'", action.c_str());
vector<CString> parts;
split( action, ";", parts, true );
for( unsigned j = 0; j < parts.size(); ++j )
{
vector<CString> asBits;
split( parts[j], ",", asBits, true );
if( !asBits[0].CompareNoCase("unlock") )
UNLOCKMAN->UnlockCode( atoi(asBits[1]) );
if( !asBits[0].CompareNoCase("sound") )
SOUND->PlayOnce( THEME->GetPathToS( asBits[1] ) );
}
m_aCodeChoices[i].Apply( MenuI.player ); m_aCodeChoices[i].Apply( MenuI.player );
} }
Screen::Input( DeviceI, type, GameI, MenuI, StyleI ); // default input handler Screen::Input( DeviceI, type, GameI, MenuI, StyleI ); // default input handler
-1
View File
@@ -37,7 +37,6 @@ protected:
vector<CodeItem> m_aCodes; vector<CodeItem> m_aCodes;
vector<GameCommand> m_aCodeChoices; vector<GameCommand> m_aCodeChoices;
vector<CString> m_aCodeActions;
}; };
#endif #endif