Files
itgmania212121/stepmania/src/ScoreDisplayOni.cpp
T

52 lines
1.2 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
/*
-----------------------------------------------------------------------------
2002-09-05 03:45:07 +00:00
Class: ScoreDisplayOni
2002-07-23 01:41:40 +00:00
Desc: A graphic displayed in the ScoreDisplayOni during Dancing.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "ScoreDisplayOni.h"
#include "RageUtil.h"
#include "RageLog.h"
#include "PrefsManager.h"
#include "RageLog.h"
#include "GameState.h"
#include "ThemeManager.h"
2002-07-23 01:41:40 +00:00
ScoreDisplayOni::ScoreDisplayOni()
{
LOG->Trace( "ScoreDisplayOni::ScoreDisplayOni()" );
2002-07-23 01:41:40 +00:00
2003-05-05 06:48:20 +00:00
m_sprFrame.Load( THEME->GetPathToG("ScoreDisplayOni frame") );
this->AddChild( &m_sprFrame );
2002-07-23 01:41:40 +00:00
// init the text
m_text.LoadFromNumbers( THEME->GetPathToN("ScoreDisplayOni") );
2003-03-02 01:43:33 +00:00
m_text.EnableShadow( false );
2003-02-25 00:33:42 +00:00
this->AddChild( &m_text );
2002-07-23 01:41:40 +00:00
}
2003-02-25 00:33:42 +00:00
void ScoreDisplayOni::Init( PlayerNumber pn )
2002-07-23 01:41:40 +00:00
{
2003-02-25 00:33:42 +00:00
ScoreDisplay::Init( pn );
m_text.SetDiffuse( PlayerToColor(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
2003-09-27 03:54:31 +00:00
float fSecsIntoPlay = 0;
2002-08-01 13:42:56 +00:00
if( GAMESTATE->IsPlayerEnabled(m_PlayerNumber) )
2003-09-27 03:54:31 +00:00
fSecsIntoPlay = GAMESTATE->m_CurStageStats.fAliveSeconds[m_PlayerNumber];
2002-07-28 20:28:37 +00:00
2003-02-25 00:33:42 +00:00
m_text.SetText( SecondsToTime(fSecsIntoPlay) );
2002-07-23 01:41:40 +00:00
}