This commit is contained in:
Glenn Maynard
2007-05-04 06:37:17 +00:00
parent e244e09369
commit 4abfc6cfb0
2 changed files with 7 additions and 11 deletions
+5 -10
View File
@@ -18,19 +18,19 @@ void ScreenBookkeeping::Init()
m_textAllTime.LoadFromFont( THEME->GetPathF(m_sName,"AllTime") );
m_textAllTime.SetName( "AllTime" );
LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textAllTime );
LOAD_ALL_COMMANDS_AND_SET_XY( m_textAllTime );
this->AddChild( &m_textAllTime );
m_textTitle.LoadFromFont( THEME->GetPathF(m_sName,"title") );
m_textTitle.SetName( "Title" );
LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textTitle );
LOAD_ALL_COMMANDS_AND_SET_XY( m_textTitle );
this->AddChild( &m_textTitle );
for( int i=0; i<NUM_BOOKKEEPING_COLS; i++ )
{
m_textData[i].LoadFromFont( THEME->GetPathF(m_sName,"data") );
m_textData[i].SetName( "Data" );
LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textData[i] );
LOAD_ALL_COMMANDS_AND_SET_XY( m_textData[i] );
float fX = SCALE( i, 0.f, NUM_BOOKKEEPING_COLS-1, SCREEN_LEFT+50, SCREEN_RIGHT-160 );
m_textData[i].SetX( fX );
this->AddChild( &m_textData[i] );
@@ -39,11 +39,6 @@ void ScreenBookkeeping::Init()
ChangeView( (View)0 );
}
ScreenBookkeeping::~ScreenBookkeeping()
{
LOG->Trace( "ScreenBookkeeping::~ScreenBookkeeping()" );
}
void ScreenBookkeeping::Update( float fDelta )
{
ChangeView( m_View ); // refresh so that counts change in real-time
@@ -61,14 +56,14 @@ void ScreenBookkeeping::Input( const InputEventPlus &input )
void ScreenBookkeeping::MenuLeft( const InputEventPlus &input )
{
m_View = (View)(m_View-1);
m_View = enum_add2( m_View, -1 );
ENUM_CLAMP( m_View, View(0), View(NUM_VIEWS-1) );
ChangeView( m_View );
}
void ScreenBookkeeping::MenuRight( const InputEventPlus &input )
{
m_View = (View)(m_View+1);
m_View = enum_add2( m_View, +1 );
ENUM_CLAMP( m_View, View(0), View(NUM_VIEWS-1) );
ChangeView( m_View );
}
+2 -1
View File
@@ -12,7 +12,6 @@ class ScreenBookkeeping : public ScreenWithMenuElements
{
public:
virtual void Init();
virtual ~ScreenBookkeeping();
virtual void Update( float fDelta );
virtual void Input( const InputEventPlus &input );
@@ -24,6 +23,8 @@ public:
virtual void MenuCoin( const InputEventPlus &input );
private:
virtual bool GenericTweenOn() const { return true; }
virtual bool GenericTweenOff() const { return true; }
enum View { VIEW_LAST_DAYS, VIEW_LAST_WEEKS, VIEW_DAY_OF_WEEK, VIEW_HOUR_OF_DAY, NUM_VIEWS };
void ChangeView( View newView );