make all-time total more visible

This commit is contained in:
Chris Danford
2005-05-13 19:04:21 +00:00
parent 20f69eabed
commit 64d2c0a30c
4 changed files with 50 additions and 41 deletions
@@ -0,0 +1 @@
Common Normal
+7 -1
View File
@@ -2610,9 +2610,15 @@ Fallback=ScreenOptionsSubmenu
[ScreenBookkeeping] [ScreenBookkeeping]
Class=ScreenBookkeeping Class=ScreenBookkeeping
Fallback=ScreenOperatorMenu Fallback=ScreenOperatorMenu
AllTimeX=SCREEN_CENTER_X
AllTimeY=110
AllTimeOnCommand=zoom,0.7;diffuseshift;EffectColor1,0.5,0.5,0.5,1
TitleX=SCREEN_CENTER_X TitleX=SCREEN_CENTER_X
TitleY=60 TitleY=140
TitleOnCommand=zoom,0.8 TitleOnCommand=zoom,0.8
DataX=0
DataY=SCREEN_CENTER_Y+16
DataOnCommand=zoom,0.6
[ScreenPackages] [ScreenPackages]
Class=ScreenPackages Class=ScreenPackages
+40 -39
View File
@@ -25,6 +25,11 @@ void ScreenBookkeeping::Init()
{ {
ScreenWithMenuElements::Init(); ScreenWithMenuElements::Init();
m_textAllTime.LoadFromFont( THEME->GetPathF(m_sName,"AllTime") );
m_textAllTime.SetName( "AllTime" );
SET_XY_AND_ON_COMMAND( m_textAllTime );
this->AddChild( &m_textAllTime );
m_textTitle.LoadFromFont( THEME->GetPathF(m_sName,"title") ); m_textTitle.LoadFromFont( THEME->GetPathF(m_sName,"title") );
m_textTitle.SetName( "Title" ); m_textTitle.SetName( "Title" );
SET_XY_AND_ON_COMMAND( m_textTitle ); SET_XY_AND_ON_COMMAND( m_textTitle );
@@ -32,13 +37,12 @@ void ScreenBookkeeping::Init()
for( int i=0; i<NUM_BOOKKEEPING_COLS; i++ ) for( int i=0; i<NUM_BOOKKEEPING_COLS; i++ )
{ {
m_textData[i].LoadFromFont( THEME->GetPathF(m_sName,"data") );
m_textData[i].SetName( "Data" );
SET_XY_AND_ON_COMMAND( m_textData[i] );
float fX = SCALE( i, 0.f, NUM_BOOKKEEPING_COLS-1, SCREEN_LEFT+50, SCREEN_RIGHT-160 ); float fX = SCALE( i, 0.f, NUM_BOOKKEEPING_COLS-1, SCREEN_LEFT+50, SCREEN_RIGHT-160 );
float fY = SCREEN_CENTER_Y+16; m_textData[i].SetX( fX );
m_textCols[i].LoadFromFont( THEME->GetPathF(m_sName,"data") ); this->AddChild( &m_textData[i] );
m_textCols[i].SetName( ssprintf("Data%d",i+1) );
m_textCols[i].SetXY( fX, fY );
m_textCols[i].SetZoom( 0.6f );
this->AddChild( &m_textCols[i] );
} }
ChangeView( (View)0 ); ChangeView( (View)0 );
@@ -118,6 +122,14 @@ void ScreenBookkeeping::ChangeView( View newView )
{ {
m_View = newView; m_View = newView;
{
CString s;
s += "All-time Total: ";
s += ssprintf( "%i\n", BOOKKEEPER->GetCoinsTotal() );
m_textAllTime.SetText( s );
}
switch( m_View ) switch( m_View )
{ {
case VIEW_LAST_DAYS: case VIEW_LAST_DAYS:
@@ -129,17 +141,6 @@ void ScreenBookkeeping::ChangeView( View newView )
int iTotalLast = 0; int iTotalLast = 0;
CString sTitle, sData; CString sTitle, sData;
sTitle += "All-time Total\n";
sData += ssprintf( "%i\n", BOOKKEEPER->GetCoinsTotal() );
sTitle += "Daily Average\n";
float fAverage = iTotalLast/(float)NUM_LAST_DAYS;
sData += ssprintf("%.1f\n",fAverage);
sTitle += "\n";
sData += "\n";
for( int i=0; i<NUM_LAST_DAYS; i++ ) for( int i=0; i<NUM_LAST_DAYS; i++ )
{ {
sTitle += LastDayToString(i) + "\n"; sTitle += LastDayToString(i) + "\n";
@@ -150,12 +151,12 @@ void ScreenBookkeeping::ChangeView( View newView )
sTitle += "Total\n"; sTitle += "Total\n";
sData += ssprintf("%i\n", iTotalLast); sData += ssprintf("%i\n", iTotalLast);
m_textCols[0].SetText( "" ); m_textData[0].SetText( "" );
m_textCols[1].SetHorizAlign( Actor::align_left ); m_textData[1].SetHorizAlign( Actor::align_left );
m_textCols[1].SetText( sTitle ); m_textData[1].SetText( sTitle );
m_textCols[2].SetText( "" ); m_textData[2].SetText( "" );
m_textCols[3].SetHorizAlign( Actor::align_right ); m_textData[3].SetHorizAlign( Actor::align_right );
m_textCols[3].SetText( sData ); m_textData[3].SetText( sData );
} }
break; break;
case VIEW_LAST_WEEKS: case VIEW_LAST_WEEKS:
@@ -175,8 +176,8 @@ void ScreenBookkeeping::ChangeView( View newView )
sTemp += LastWeekToString(week) + ssprintf(": %d",coins[week]) + "\n"; sTemp += LastWeekToString(week) + ssprintf(": %d",coins[week]) + "\n";
} }
m_textCols[col].SetHorizAlign( Actor::align_left ); m_textData[col].SetHorizAlign( Actor::align_left );
m_textCols[col].SetText( sTemp ); m_textData[col].SetText( sTemp );
} }
} }
break; break;
@@ -194,12 +195,12 @@ void ScreenBookkeeping::ChangeView( View newView )
sData += ssprintf("%d",coins[i]) + "\n"; sData += ssprintf("%d",coins[i]) + "\n";
} }
m_textCols[0].SetText( "" ); m_textData[0].SetText( "" );
m_textCols[1].SetHorizAlign( Actor::align_left ); m_textData[1].SetHorizAlign( Actor::align_left );
m_textCols[1].SetText( sTitle ); m_textData[1].SetText( sTitle );
m_textCols[2].SetText( "" ); m_textData[2].SetText( "" );
m_textCols[3].SetHorizAlign( Actor::align_right ); m_textData[3].SetHorizAlign( Actor::align_right );
m_textCols[3].SetText( sData ); m_textData[3].SetText( sData );
} }
break; break;
case VIEW_HOUR_OF_DAY: case VIEW_HOUR_OF_DAY:
@@ -223,14 +224,14 @@ void ScreenBookkeeping::ChangeView( View newView )
sData2 += ssprintf("%d",coins[i]) + "\n"; sData2 += ssprintf("%d",coins[i]) + "\n";
} }
m_textCols[0].SetHorizAlign( Actor::align_left ); m_textData[0].SetHorizAlign( Actor::align_left );
m_textCols[0].SetText( sTitle1 ); m_textData[0].SetText( sTitle1 );
m_textCols[1].SetHorizAlign( Actor::align_right ); m_textData[1].SetHorizAlign( Actor::align_right );
m_textCols[1].SetText( sData1 ); m_textData[1].SetText( sData1 );
m_textCols[2].SetHorizAlign( Actor::align_left ); m_textData[2].SetHorizAlign( Actor::align_left );
m_textCols[2].SetText( sTitle2 ); m_textData[2].SetText( sTitle2 );
m_textCols[3].SetHorizAlign( Actor::align_right ); m_textData[3].SetHorizAlign( Actor::align_right );
m_textCols[3].SetText( sData2 ); m_textData[3].SetText( sData2 );
} }
break; break;
default: default:
+2 -1
View File
@@ -34,8 +34,9 @@ private:
void ChangeView( View newView ); void ChangeView( View newView );
View m_View; View m_View;
BitmapText m_textAllTime;
BitmapText m_textTitle; BitmapText m_textTitle;
BitmapText m_textCols[NUM_BOOKKEEPING_COLS]; BitmapText m_textData[NUM_BOOKKEEPING_COLS];
}; };
#endif #endif