simplify: add SetInputMode, like SetNavigation (rest of commit coming)
This commit is contained in:
@@ -78,7 +78,7 @@ void ScreenCourseManager::Init()
|
||||
vDefs.push_back( def );
|
||||
vHands.push_back( NULL );
|
||||
|
||||
ScreenOptions::InitMenu( INPUTMODE_SHARE_CURSOR, vDefs, vHands );
|
||||
ScreenOptions::InitMenu( vDefs, vHands );
|
||||
|
||||
|
||||
AfterChangeValueInRow( GAMESTATE->m_MasterPlayerNumber );
|
||||
|
||||
@@ -139,7 +139,7 @@ void ScreenEditCourse::Init()
|
||||
vDefs.push_back( def );
|
||||
vHands.push_back( NULL );
|
||||
|
||||
ScreenOptions::InitMenu( INPUTMODE_SHARE_CURSOR, vDefs, vHands );
|
||||
ScreenOptions::InitMenu( vDefs, vHands );
|
||||
|
||||
AfterChangeValueInRow( GAMESTATE->m_MasterPlayerNumber );
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ void ScreenEditCourseEntry::Init()
|
||||
vDefs.push_back( def );
|
||||
vHands.push_back( NULL );
|
||||
|
||||
ScreenOptions::InitMenu( INPUTMODE_SHARE_CURSOR, vDefs, vHands );
|
||||
ScreenOptions::InitMenu( vDefs, vHands );
|
||||
|
||||
ImportAllOptions();
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ void ScreenNetworkOptions::Init()
|
||||
vector<OptionRowDefinition> vDefs( &g_NetworkOptionsLines[0], &g_NetworkOptionsLines[ARRAYSIZE(g_NetworkOptionsLines)] );
|
||||
vector<OptionRowHandler*> vHands( vDefs.size(), NULL );
|
||||
|
||||
InitMenu( INPUTMODE_SHARE_CURSOR, vDefs, vHands );
|
||||
InitMenu( vDefs, vHands );
|
||||
|
||||
SOUND->PlayMusic( THEME->GetPathS("ScreenMachineOptions","music") );
|
||||
}
|
||||
|
||||
@@ -96,8 +96,9 @@ ScreenOptions::ScreenOptions( CString sClassName ) : ScreenWithMenuElements(sCla
|
||||
{
|
||||
m_fLockInputSecs = 0.0001f; // always lock for a tiny amount of time so that we throw away any queued inputs during the load.
|
||||
|
||||
// This can be overridden in a derived Init().
|
||||
// These can be overridden in a derived Init().
|
||||
m_OptionsNavigation = PREFSMAN->m_bArcadeOptionsNavigation? NAV_THREE_KEY:NAV_FIVE_KEY;
|
||||
m_InputMode = INPUTMODE_SHARE_CURSOR;
|
||||
|
||||
LOG->Trace( "ScreenOptions::ScreenOptions()" );
|
||||
}
|
||||
@@ -184,14 +185,12 @@ void ScreenOptions::LoadOptionIcon( PlayerNumber pn, int iRow, CString sText )
|
||||
m_pRows[iRow]->LoadOptionIcon( pn, sText );
|
||||
}
|
||||
|
||||
void ScreenOptions::InitMenu( InputMode im, const vector<OptionRowDefinition> &vDefs, const vector<OptionRowHandler*> &vHands )
|
||||
void ScreenOptions::InitMenu( const vector<OptionRowDefinition> &vDefs, const vector<OptionRowHandler*> &vHands )
|
||||
{
|
||||
LOG->Trace( "ScreenOptions::Set()" );
|
||||
|
||||
ASSERT( vDefs.size() == vHands.size() );
|
||||
|
||||
m_InputMode = im;
|
||||
|
||||
for( unsigned r=0; r<vDefs.size(); r++ ) // foreach row
|
||||
{
|
||||
m_pRows.push_back( new OptionRow() );
|
||||
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
ScreenOptions( CString sClassName );
|
||||
virtual void Init();
|
||||
virtual void BeginScreen();
|
||||
void InitMenu( InputMode im, const vector<OptionRowDefinition> &vDefs, const vector<OptionRowHandler*> &vHands );
|
||||
void InitMenu( const vector<OptionRowDefinition> &vDefs, const vector<OptionRowHandler*> &vHands );
|
||||
virtual ~ScreenOptions();
|
||||
virtual void Update( float fDeltaTime );
|
||||
virtual void Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI );
|
||||
@@ -84,6 +84,7 @@ protected: // derived classes need access to these
|
||||
void LoadOptionIcon( PlayerNumber pn, int iRow, CString sText );
|
||||
enum Navigation { NAV_THREE_KEY, NAV_THREE_KEY_MENU, NAV_FIVE_KEY, NAV_TOGGLE_THREE_KEY, NAV_TOGGLE_FIVE_KEY };
|
||||
void SetNavigation( Navigation nav ) { m_OptionsNavigation = nav; }
|
||||
void SetInputMode( InputMode im ) { m_InputMode = im; }
|
||||
|
||||
protected:
|
||||
/* Map menu lines to m_OptionRow entries. */
|
||||
|
||||
@@ -67,6 +67,8 @@ void ScreenOptionsMaster::Init()
|
||||
RageException::Throw( "Unknown flag \"%s\"", sFlag.c_str() );
|
||||
}
|
||||
|
||||
SetInputMode( im );
|
||||
|
||||
// Call this after enabling players, if any.
|
||||
ScreenOptions::Init();
|
||||
|
||||
@@ -94,7 +96,7 @@ void ScreenOptionsMaster::Init()
|
||||
|
||||
ASSERT( OptionRowHandlers.size() == asLineNames.size() );
|
||||
|
||||
InitMenu( im, OptionRowDefs, OptionRowHandlers );
|
||||
InitMenu( OptionRowDefs, OptionRowHandlers );
|
||||
}
|
||||
|
||||
ScreenOptionsMaster::~ScreenOptionsMaster()
|
||||
|
||||
@@ -80,7 +80,7 @@ void ScreenProfileOptions::Init()
|
||||
|
||||
vector<OptionRowDefinition> vDefs( &g_ProfileOptionsLines[0], &g_ProfileOptionsLines[ARRAYSIZE(g_ProfileOptionsLines)] );
|
||||
vector<OptionRowHandler*> vHands( vDefs.size(), NULL );
|
||||
InitMenu( INPUTMODE_SHARE_CURSOR, vDefs, vHands );
|
||||
InitMenu( vDefs, vHands );
|
||||
|
||||
SOUND->PlayMusic( THEME->GetPathS("ScreenMachineOptions","music") );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user