2003-03-30 20:21:20 +00:00
|
|
|
#include "global.h"
|
|
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
Class: HelpDisplay
|
|
|
|
|
|
|
|
|
|
Desc: See header
|
|
|
|
|
|
|
|
|
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
|
|
|
|
Chris Danford
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "HelpDisplay.h"
|
|
|
|
|
#include "RageUtil.h"
|
|
|
|
|
#include "PrefsManager.h"
|
|
|
|
|
#include "RageLog.h"
|
|
|
|
|
#include "ThemeManager.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const float TIP_SHOW_TIME = 3.5f;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HelpDisplay::HelpDisplay()
|
|
|
|
|
{
|
|
|
|
|
LOG->Trace( "HelpDisplay::HelpDisplay()" );
|
|
|
|
|
|
2003-04-12 17:39:27 +00:00
|
|
|
m_textTip.LoadFromFont( THEME->GetPathToF("HelpDisplay") );
|
2003-03-30 20:21:20 +00:00
|
|
|
m_textTip.SetEffectDiffuseBlink();
|
|
|
|
|
m_textTip.EnableShadow( false );
|
|
|
|
|
this->AddChild( &m_textTip );
|
|
|
|
|
|
|
|
|
|
m_iCurTipIndex = 0;
|
|
|
|
|
m_fSecsUntilSwitch = TIP_SHOW_TIME;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-11-07 20:43:03 +00:00
|
|
|
void HelpDisplay::SetTips( const CStringArray &arrayTips )
|
2003-03-30 20:21:20 +00:00
|
|
|
{
|
|
|
|
|
m_arrayTips = arrayTips;
|
|
|
|
|
if( !m_arrayTips.empty() )
|
|
|
|
|
m_textTip.SetText( m_arrayTips[0] );
|
2003-11-07 20:43:03 +00:00
|
|
|
else
|
|
|
|
|
m_textTip.SetText( "" );
|
2003-03-30 20:21:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void HelpDisplay::Update( float fDeltaTime )
|
|
|
|
|
{
|
|
|
|
|
ActorFrame::Update( fDeltaTime );
|
|
|
|
|
|
|
|
|
|
if( !m_arrayTips.empty() )
|
|
|
|
|
{
|
|
|
|
|
m_fSecsUntilSwitch -= fDeltaTime;
|
|
|
|
|
if( m_fSecsUntilSwitch < 0 ) // time to switch states
|
|
|
|
|
{
|
|
|
|
|
m_iCurTipIndex++;
|
|
|
|
|
m_iCurTipIndex = m_iCurTipIndex % m_arrayTips.size();
|
|
|
|
|
m_fSecsUntilSwitch = TIP_SHOW_TIME;
|
|
|
|
|
m_textTip.SetText( m_arrayTips[m_iCurTipIndex] );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|