use AutoActor for CanGoLeft/Right so that Right can use the Left image but flipped

This commit is contained in:
Chris Danford
2005-08-30 07:58:24 +00:00
parent b224ac2b13
commit 7af4f48eac
2 changed files with 20 additions and 18 deletions
+17 -16
View File
@@ -14,10 +14,6 @@ OptionsCursor::OptionsCursor()
OptionsCursorPlus::OptionsCursorPlus() OptionsCursorPlus::OptionsCursorPlus()
{ {
this->AddChild( &m_sprCanGoLeft );
this->AddChild( &m_sprCanGoRight );
SetCanGo( false, false );
} }
OptionsCursor::OptionsCursor( const OptionsCursor &cpy ): OptionsCursor::OptionsCursor( const OptionsCursor &cpy ):
@@ -38,8 +34,8 @@ OptionsCursorPlus::OptionsCursorPlus( const OptionsCursorPlus &cpy ):
m_sprCanGoLeft( cpy.m_sprCanGoLeft ), m_sprCanGoLeft( cpy.m_sprCanGoLeft ),
m_sprCanGoRight( cpy.m_sprCanGoRight ) m_sprCanGoRight( cpy.m_sprCanGoRight )
{ {
this->AddChild( &m_sprCanGoLeft ); this->AddChild( m_sprCanGoLeft );
this->AddChild( &m_sprCanGoRight ); this->AddChild( m_sprCanGoRight );
} }
void OptionsCursor::Load( const CString &sType, Element elem ) void OptionsCursor::Load( const CString &sType, Element elem )
@@ -61,6 +57,11 @@ void OptionsCursorPlus::Load( const CString &sType, Element elem )
m_sprCanGoLeft.Load( THEME->GetPathG(sType,"CanGoLeft") ); m_sprCanGoLeft.Load( THEME->GetPathG(sType,"CanGoLeft") );
m_sprCanGoRight.Load( THEME->GetPathG(sType,"CanGoRight") ); m_sprCanGoRight.Load( THEME->GetPathG(sType,"CanGoRight") );
this->AddChild( m_sprCanGoLeft );
this->AddChild( m_sprCanGoRight );
SetCanGo( false, false );
} }
void OptionsCursor::Set( PlayerNumber pn ) void OptionsCursor::Set( PlayerNumber pn )
@@ -79,11 +80,11 @@ void OptionsCursor::Set( PlayerNumber pn )
void OptionsCursorPlus::SetCanGo( bool bCanGoLeft, bool bCanGoRight ) void OptionsCursorPlus::SetCanGo( bool bCanGoLeft, bool bCanGoRight )
{ {
m_sprCanGoLeft.EnableAnimation( bCanGoLeft ); m_sprCanGoLeft->EnableAnimation( bCanGoLeft );
m_sprCanGoRight.EnableAnimation( bCanGoRight ); m_sprCanGoRight->EnableAnimation( bCanGoRight );
m_sprCanGoLeft.SetDiffuse( bCanGoLeft ? RageColor(1,1,1,1) : RageColor(1,1,1,0) ); m_sprCanGoLeft->SetDiffuse( bCanGoLeft ? RageColor(1,1,1,1) : RageColor(1,1,1,0) );
m_sprCanGoRight.SetDiffuse( bCanGoRight ? RageColor(1,1,1,1) : RageColor(1,1,1,0) ); m_sprCanGoRight->SetDiffuse( bCanGoRight ? RageColor(1,1,1,1) : RageColor(1,1,1,0) );
} }
void OptionsCursor::StopTweening() void OptionsCursor::StopTweening()
@@ -99,8 +100,8 @@ void OptionsCursorPlus::StopTweening()
{ {
OptionsCursor::StopTweening(); OptionsCursor::StopTweening();
m_sprCanGoLeft.StopTweening(); m_sprCanGoLeft->StopTweening();
m_sprCanGoRight.StopTweening(); m_sprCanGoRight->StopTweening();
} }
void OptionsCursor::BeginTweening( float fSecs ) void OptionsCursor::BeginTweening( float fSecs )
@@ -116,8 +117,8 @@ void OptionsCursorPlus::BeginTweening( float fSecs )
{ {
OptionsCursor::BeginTweening( fSecs ); OptionsCursor::BeginTweening( fSecs );
m_sprCanGoLeft.BeginTweening( fSecs ); m_sprCanGoLeft->BeginTweening( fSecs );
m_sprCanGoRight.BeginTweening( fSecs ); m_sprCanGoRight->BeginTweening( fSecs );
} }
void OptionsCursor::SetBarWidth( int iWidth ) void OptionsCursor::SetBarWidth( int iWidth )
@@ -136,8 +137,8 @@ void OptionsCursorPlus::SetBarWidth( int iWidth )
{ {
OptionsCursor::SetBarWidth( iWidth ); OptionsCursor::SetBarWidth( iWidth );
m_sprCanGoLeft.SetX( m_sprLeft.GetDestX() ); m_sprCanGoLeft->SetX( m_sprLeft.GetDestX() );
m_sprCanGoRight.SetX( m_sprRight.GetDestX() ); m_sprCanGoRight->SetX( m_sprRight.GetDestX() );
} }
int OptionsCursor::GetBarWidth() int OptionsCursor::GetBarWidth()
+3 -2
View File
@@ -6,6 +6,7 @@
#include "Sprite.h" #include "Sprite.h"
#include "ActorFrame.h" #include "ActorFrame.h"
#include "PlayerNumber.h" #include "PlayerNumber.h"
#include "AutoActor.h"
class OptionsCursor : public ActorFrame class OptionsCursor : public ActorFrame
@@ -45,8 +46,8 @@ public:
protected: protected:
Sprite m_sprCanGoLeft; AutoActor m_sprCanGoLeft;
Sprite m_sprCanGoRight; AutoActor m_sprCanGoRight;
}; };
#endif #endif