2004-03-23 06:33:01 +00:00
|
|
|
#include "global.h"
|
|
|
|
|
#include "ScreenTestLights.h"
|
|
|
|
|
#include "ScreenManager.h"
|
|
|
|
|
#include "GameConstantsAndTypes.h"
|
|
|
|
|
#include "RageLog.h"
|
|
|
|
|
#include "GameState.h"
|
2004-07-08 00:10:34 +00:00
|
|
|
#include "GameSoundManager.h"
|
2004-03-23 06:33:01 +00:00
|
|
|
#include "ThemeManager.h"
|
|
|
|
|
#include "LightsManager.h"
|
2004-07-25 17:07:32 +00:00
|
|
|
#include "Game.h"
|
2004-09-21 06:07:12 +00:00
|
|
|
#include "ScreenDimensions.h"
|
2004-03-23 06:33:01 +00:00
|
|
|
|
|
|
|
|
|
2004-05-01 23:19:33 +00:00
|
|
|
ScreenTestLights::ScreenTestLights( CString sClassName ) : ScreenWithMenuElements( sClassName )
|
2004-03-23 06:33:01 +00:00
|
|
|
{
|
|
|
|
|
LOG->Trace( "ScreenTestLights::ScreenTestLights()" );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_textInputs.LoadFromFont( THEME->GetPathToF("Common normal") );
|
|
|
|
|
m_textInputs.SetText( "" );
|
|
|
|
|
m_textInputs.SetXY( CENTER_X, CENTER_Y );
|
|
|
|
|
m_textInputs.SetDiffuse( RageColor(1,1,1,1) );
|
|
|
|
|
m_textInputs.SetZoom( 0.8f );
|
|
|
|
|
this->AddChild( &m_textInputs );
|
|
|
|
|
|
|
|
|
|
SOUND->PlayMusic( THEME->GetPathToS("ScreenTestLights music") );
|
|
|
|
|
|
|
|
|
|
LIGHTSMAN->SetLightsMode( LIGHTSMODE_TEST );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ScreenTestLights::~ScreenTestLights()
|
|
|
|
|
{
|
|
|
|
|
LOG->Trace( "ScreenTestLights::~ScreenTestLights()" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ScreenTestLights::Update( float fDeltaTime )
|
|
|
|
|
{
|
|
|
|
|
Screen::Update( fDeltaTime );
|
|
|
|
|
|
|
|
|
|
int iSec = (int)RageTimer::GetTimeSinceStart();
|
|
|
|
|
|
2004-03-29 09:44:00 +00:00
|
|
|
CabinetLight cl = (CabinetLight)(iSec%NUM_CABINET_LIGHTS);
|
2004-07-25 17:07:32 +00:00
|
|
|
int iNumGameButtonsToShow = GAMESTATE->GetCurrentGame()->GetNumGameplayButtons();
|
2004-03-30 04:32:27 +00:00
|
|
|
GameButton gb = (GameButton)(iSec%iNumGameButtonsToShow);
|
2004-03-29 09:44:00 +00:00
|
|
|
CString sCabLight = CabinetLightToString(cl);
|
2004-07-25 17:07:32 +00:00
|
|
|
CString sGameButton = GAMESTATE->GetCurrentGame()->m_szButtonNames[gb];
|
2004-03-29 09:44:00 +00:00
|
|
|
|
2004-03-23 06:33:01 +00:00
|
|
|
CString s;
|
2004-03-29 09:44:00 +00:00
|
|
|
s += ssprintf("cabinet light %d: %s\n", cl, sCabLight.c_str());
|
2004-03-23 06:33:01 +00:00
|
|
|
FOREACH_GameController( gc )
|
2004-03-29 09:44:00 +00:00
|
|
|
s += ssprintf("controller %d light %d: %s\n", gc+1, gb, sGameButton.c_str());
|
2004-03-23 06:33:01 +00:00
|
|
|
|
|
|
|
|
m_textInputs.SetText( s );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ScreenTestLights::DrawPrimitives()
|
|
|
|
|
{
|
|
|
|
|
Screen::DrawPrimitives();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenTestLights::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
|
|
|
|
|
{
|
|
|
|
|
if( type != IET_FIRST_PRESS && type != IET_SLOW_REPEAT )
|
|
|
|
|
return; // ignore
|
|
|
|
|
|
|
|
|
|
Screen::Input( DeviceI, type, GameI, MenuI, StyleI ); // default handler
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenTestLights::HandleScreenMessage( const ScreenMessage SM )
|
|
|
|
|
{
|
|
|
|
|
switch( SM )
|
|
|
|
|
{
|
|
|
|
|
case SM_GoToNextScreen:
|
|
|
|
|
case SM_GoToPrevScreen:
|
|
|
|
|
SCREENMAN->SetNewScreen( "ScreenOptionsMenu" );
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenTestLights::MenuStart( PlayerNumber pn )
|
|
|
|
|
{
|
|
|
|
|
MenuBack(pn);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenTestLights::MenuBack( PlayerNumber pn )
|
|
|
|
|
{
|
2004-05-01 23:19:33 +00:00
|
|
|
if(!IsTransitioning())
|
2004-03-23 06:33:01 +00:00
|
|
|
{
|
2004-03-23 23:56:38 +00:00
|
|
|
SCREENMAN->PlayStartSound();
|
2004-05-01 23:19:33 +00:00
|
|
|
StartTransitioning( SM_GoToPrevScreen );
|
2004-03-23 06:33:01 +00:00
|
|
|
}
|
|
|
|
|
}
|
2004-06-08 05:22:33 +00:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* (c) 2004 Chris Danford
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
|
* copy of this software and associated documentation files (the
|
|
|
|
|
* "Software"), to deal in the Software without restriction, including
|
|
|
|
|
* without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
|
* distribute, and/or sell copies of the Software, and to permit persons to
|
|
|
|
|
* whom the Software is furnished to do so, provided that the above
|
|
|
|
|
* copyright notice(s) and this permission notice appear in all copies of
|
|
|
|
|
* the Software and that both the above copyright notice(s) and this
|
|
|
|
|
* permission notice appear in supporting documentation.
|
|
|
|
|
*
|
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
|
|
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
|
|
|
|
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
|
|
|
|
|
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
|
|
|
|
|
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
|
|
|
|
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
|
|
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
|
|
* PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
|
*/
|