Files
itgmania212121/stepmania/src/ScoreDisplayOni.cpp
T

76 lines
2.5 KiB
C++
Raw Normal View History

2003-02-16 04:01:45 +00:00
#include "global.h"
2002-07-23 01:41:40 +00:00
#include "ScoreDisplayOni.h"
#include "RageUtil.h"
#include "RageLog.h"
#include "PrefsManager.h"
#include "RageLog.h"
#include "GameState.h"
#include "ThemeManager.h"
2005-02-16 03:25:45 +00:00
#include "StatsManager.h"
#include "PlayerState.h"
2005-02-12 21:03:39 +00:00
#include "CommonMetrics.h"
2002-07-23 01:41:40 +00:00
ScoreDisplayOni::ScoreDisplayOni()
{
LOG->Trace( "ScoreDisplayOni::ScoreDisplayOni()" );
2002-07-23 01:41:40 +00:00
m_sprFrame.Load( THEME->GetPathG("ScoreDisplayOni","frame") );
2003-05-05 06:48:20 +00:00
this->AddChild( &m_sprFrame );
2002-07-23 01:41:40 +00:00
// init the text
m_text.LoadFromFont( THEME->GetPathF("ScoreDisplayOni","numbers") );
m_text.SetShadowLength( 0 );
2003-02-25 00:33:42 +00:00
this->AddChild( &m_text );
2002-07-23 01:41:40 +00:00
}
void ScoreDisplayOni::Init( const PlayerState* pPlayerState, const PlayerStageStats* pPlayerStageStats )
2002-07-23 01:41:40 +00:00
{
ScoreDisplay::Init( pPlayerState, pPlayerStageStats );
// TODO: Remove use of PlayerNumber.
PlayerNumber pn = pPlayerState->m_PlayerNumber;
2005-08-31 03:41:21 +00:00
m_text.RunCommands( PLAYER_COLOR.GetValue(pn) );
2002-07-23 01:41:40 +00:00
}
2003-02-25 00:33:42 +00:00
void ScoreDisplayOni::Update( float fDelta )
2002-07-23 01:41:40 +00:00
{
2003-02-25 00:33:42 +00:00
ScoreDisplay::Update( fDelta );
2002-07-23 01:41:40 +00:00
// TODO: Remove use of PlayerNumber.
PlayerNumber pn = m_pPlayerState->m_PlayerNumber;
2003-09-27 03:54:31 +00:00
float fSecsIntoPlay = 0;
if( GAMESTATE->IsPlayerEnabled(pn) )
2005-02-16 03:25:45 +00:00
fSecsIntoPlay = STATSMAN->m_CurStageStats.m_player[pn].fAliveSeconds;
2002-07-28 20:28:37 +00:00
2004-02-22 19:51:46 +00:00
m_text.SetText( SecondsToMMSSMsMs(fSecsIntoPlay) );
2002-07-23 01:41:40 +00:00
}
2004-06-08 00:08:04 +00:00
/*
* (c) 2001-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.
*/