simplify: use GameInput
This commit is contained in:
@@ -486,22 +486,17 @@ CabinetLight LightsManager::GetFirstLitCabinetLight()
|
||||
return CabinetLight_Invalid;
|
||||
}
|
||||
|
||||
void LightsManager::GetFirstLitGameButtonLight( GameController &gcOut, GameButton &gbOut )
|
||||
GameInput LightsManager::GetFirstLitGameButtonLight()
|
||||
{
|
||||
FOREACH_GameController( gc )
|
||||
{
|
||||
FOREACH_GameButton( gb )
|
||||
{
|
||||
if( m_LightsState.m_bGameButtonLights[gc][gb] )
|
||||
{
|
||||
gcOut = gc;
|
||||
gbOut = gb;
|
||||
return;
|
||||
}
|
||||
return GameInput( gc, gb );
|
||||
}
|
||||
}
|
||||
gcOut = GameController_Invalid;
|
||||
gbOut = GameButton_Invalid;
|
||||
return GameInput();
|
||||
}
|
||||
|
||||
bool LightsManager::IsEnabled() const
|
||||
|
||||
@@ -80,7 +80,7 @@ public:
|
||||
void NextTestGameButtonLight() { ChangeTestGameButtonLight(+1); }
|
||||
|
||||
CabinetLight GetFirstLitCabinetLight();
|
||||
void GetFirstLitGameButtonLight( GameController &gcOut, GameButton &gbOut );
|
||||
GameInput GetFirstLitGameButtonLight();
|
||||
|
||||
private:
|
||||
void ChangeTestCabinetLight( int iDir );
|
||||
|
||||
@@ -50,9 +50,7 @@ void ScreenTestLights::Update( float fDeltaTime )
|
||||
|
||||
|
||||
CabinetLight cl = LIGHTSMAN->GetFirstLitCabinetLight();
|
||||
GameController gc;
|
||||
GameButton gb;
|
||||
LIGHTSMAN->GetFirstLitGameButtonLight( gc, gb );
|
||||
GameInput gi = LIGHTSMAN->GetFirstLitGameButtonLight();
|
||||
|
||||
RString s;
|
||||
|
||||
@@ -71,15 +69,15 @@ void ScreenTestLights::Update( float fDeltaTime )
|
||||
else
|
||||
s += ssprintf( CABINET_LIGHT.GetValue()+": %d %s\n", cl, CabinetLightToString(cl).c_str() );
|
||||
|
||||
if( gc == GameController_Invalid )
|
||||
if( !gi.IsValid() )
|
||||
{
|
||||
s += ssprintf( CONTROLLER_LIGHT.GetValue()+": -----\n" );
|
||||
}
|
||||
else
|
||||
{
|
||||
RString sGameButton = GameButtonToLocalizedString( INPUTMAPPER->GetInputScheme(), gb );
|
||||
PlayerNumber pn = (PlayerNumber)(gc);
|
||||
s += ssprintf( CONTROLLER_LIGHT.GetValue()+": %s %d %s\n", PlayerNumberToString(pn).c_str(), gb, sGameButton.c_str() );
|
||||
RString sGameButton = GameButtonToLocalizedString( INPUTMAPPER->GetInputScheme(), gi.button );
|
||||
PlayerNumber pn = (PlayerNumber)(gi.controller);
|
||||
s += ssprintf( CONTROLLER_LIGHT.GetValue()+": %s %d %s\n", PlayerNumberToString(pn).c_str(), gi.button, sGameButton.c_str() );
|
||||
}
|
||||
|
||||
m_textInputs.SetText( s );
|
||||
|
||||
Reference in New Issue
Block a user