split out ScreenTestInput components

This commit is contained in:
Glenn Maynard
2006-03-19 02:06:31 +00:00
parent 40b44ee6b8
commit 4c1e9ed6bb
2 changed files with 53 additions and 67 deletions
+22 -29
View File
@@ -14,43 +14,31 @@
#include "LocalizedString.h" #include "LocalizedString.h"
REGISTER_SCREEN_CLASS( ScreenTestInput ); class DeviceList: public BitmapText
void ScreenTestInput::Init()
{ {
ScreenWithMenuElements::Init(); public:
void Update( float fDeltaTime )
m_textDevices.LoadFromFont( THEME->GetPathF("Common","normal") ); {
m_textDevices.SetXY( SCREEN_LEFT+20, SCREEN_TOP+80 ); //
m_textDevices.SetDiffuse( RageColor(1,1,1,1) ); // Update devices text
m_textDevices.SetZoom( 0.7f ); //
m_textDevices.SetHorizAlign( Actor::align_left ); this->SetText( INPUTMAN->GetDisplayDevicesString() );
this->AddChild( &m_textDevices );
m_textInputs.LoadFromFont( THEME->GetPathF("Common","normal") );
m_textInputs.SetXY( SCREEN_CENTER_X-250, SCREEN_CENTER_Y );
m_textInputs.SetDiffuse( RageColor(1,1,1,1) );
m_textInputs.SetZoom( 0.7f );
m_textInputs.SetHorizAlign( Actor::align_left );
m_textInputs.SetVertSpacing( +8 );
this->AddChild( &m_textInputs );
this->SortByDrawOrder();
} }
virtual Actor *Copy() const;
};
REGISTER_ACTOR_CLASS( DeviceList );
static LocalizedString CONTROLLER ( "ScreenTestInput", "Controller" ); static LocalizedString CONTROLLER ( "ScreenTestInput", "Controller" );
static LocalizedString SECONDARY ( "ScreenTestInput", "secondary" ); static LocalizedString SECONDARY ( "ScreenTestInput", "secondary" );
static LocalizedString NOT_MAPPED ( "ScreenTestInput", "not mapped" ); static LocalizedString NOT_MAPPED ( "ScreenTestInput", "not mapped" );
void ScreenTestInput::Update( float fDeltaTime ) class InputList: public BitmapText
{ {
Screen::Update( fDeltaTime ); virtual Actor *Copy() const;
//
// Update devices text
//
m_textDevices.SetText( INPUTMAN->GetDisplayDevicesString() );
void Update( float fDeltaTime )
{
// //
// Update input texts // Update input texts
// //
@@ -89,9 +77,14 @@ void ScreenTestInput::Update( float fDeltaTime )
asInputs.push_back( sTemp ); asInputs.push_back( sTemp );
} }
m_textInputs.SetText( join( "\n", asInputs ) ); this->SetText( join( "\n", asInputs ) );
} }
};
REGISTER_ACTOR_CLASS( InputList );
REGISTER_SCREEN_CLASS( ScreenTestInput );
void ScreenTestInput::Input( const InputEventPlus &input ) void ScreenTestInput::Input( const InputEventPlus &input )
{ {
-7
View File
@@ -10,17 +10,10 @@
class ScreenTestInput : public ScreenWithMenuElements class ScreenTestInput : public ScreenWithMenuElements
{ {
public: public:
virtual void Init();
virtual void Update( float fDelta );
virtual void Input( const InputEventPlus &input ); virtual void Input( const InputEventPlus &input );
virtual void MenuStart( PlayerNumber pn ); virtual void MenuStart( PlayerNumber pn );
virtual void MenuBack( PlayerNumber pn ); virtual void MenuBack( PlayerNumber pn );
private:
BitmapText m_textDevices;
BitmapText m_textInputs;
}; };
#endif #endif