Files
itgmania212121/stepmania/src/CourseEntryDisplay.cpp
T

122 lines
3.7 KiB
C++
Raw Normal View History

#include "global.h"
/*
-----------------------------------------------------------------------------
Class: CourseEntryDisplay
Desc: See header.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "CourseEntryDisplay.h"
#include "RageUtil.h"
#include "GameConstantsAndTypes.h"
#include "PrefsManager.h"
#include "RageLog.h"
#include "PrefsManager.h"
#include "Course.h"
#include "SongManager.h"
#include <math.h>
#include "ThemeManager.h"
2003-08-03 00:13:55 +00:00
#include "Steps.h"
#include "GameState.h"
#include "StyleDef.h"
2003-11-16 21:44:42 +00:00
#include "ActorUtil.h"
2003-11-16 21:44:42 +00:00
void CourseEntryDisplay::Load()
{
2003-11-16 21:44:42 +00:00
m_sprFrame.SetName( "Bar" );
m_sprFrame.Load( THEME->GetPathToG("CourseEntryDisplay bar") );
2003-11-16 21:44:42 +00:00
SET_XY_AND_ON_COMMAND( &m_sprFrame );
this->AddChild( &m_sprFrame );
2003-11-16 21:44:42 +00:00
this->m_size.x = (float) m_sprFrame.GetTexture()->GetSourceFrameWidth();
this->m_size.y = (float) m_sprFrame.GetTexture()->GetSourceFrameHeight();
m_textNumber.SetName( "Number" );
m_textNumber.LoadFromFont( THEME->GetPathToF("CourseEntryDisplay number") );
2003-11-16 21:44:42 +00:00
SET_XY_AND_ON_COMMAND( &m_textNumber );
this->AddChild( &m_textNumber );
2003-11-16 21:44:42 +00:00
m_TextBanner.SetName( "TextBanner" );
SET_XY_AND_ON_COMMAND( &m_TextBanner );
this->AddChild( &m_TextBanner );
2003-11-16 21:44:42 +00:00
m_textFoot.SetName( "Foot" );
m_textFoot.LoadFromTextureAndChars( THEME->GetPathToG("CourseEntryDisplay difficulty 2x1"),"10" );
2003-11-16 21:44:42 +00:00
SET_XY_AND_ON_COMMAND( &m_textFoot );
this->AddChild( &m_textFoot );
2003-11-16 21:44:42 +00:00
m_textDifficultyNumber.SetName( "Difficulty" );
m_textDifficultyNumber.LoadFromFont( THEME->GetPathToF("Common normal") );
2003-11-16 21:44:42 +00:00
SET_XY_AND_ON_COMMAND( &m_textDifficultyNumber );
this->AddChild( &m_textDifficultyNumber );
2003-11-16 21:44:42 +00:00
m_textModifiers.SetName( "Modifiers" );
m_textModifiers.LoadFromFont( THEME->GetPathToF("Common normal") );
2003-11-16 21:44:42 +00:00
SET_XY_AND_ON_COMMAND( &m_textModifiers );
this->AddChild( &m_textModifiers );
}
2003-08-03 00:13:55 +00:00
void CourseEntryDisplay::LoadFromSongAndNotes( int iNum, Song* pSong, Steps* pNotes, CString sModifiers )
{
m_textNumber.SetText( ssprintf("%d", iNum) );
RageColor colorGroup = SONGMAN->GetSongColor( pSong );
RageColor colorNotes = SONGMAN->GetDifficultyColor( pNotes->GetDifficulty() );
m_TextBanner.LoadFromSong( pSong );
m_TextBanner.SetDiffuse( colorGroup );
m_textFoot.SetText( "1" );
m_textFoot.SetDiffuse( colorNotes );
m_textDifficultyNumber.SetText( ssprintf("%d", pNotes->GetMeter()) );
m_textDifficultyNumber.SetDiffuse( colorNotes );
m_textModifiers.SetText( sModifiers );
}
void CourseEntryDisplay::LoadFromDifficulty( int iNum, Difficulty dc, CString sModifiers )
{
m_textNumber.SetText( ssprintf("%d", iNum) );
RageColor colorGroup = RageColor(1,1,1,1); // TODO: What should this be?
RageColor colorNotes = SONGMAN->GetDifficultyColor( dc );
m_TextBanner.LoadFromString( "??????????", "??????????", "", "", "", "" );
m_TextBanner.SetDiffuse( colorGroup );
m_textFoot.SetText( "1" );
m_textFoot.SetDiffuse( colorNotes );
m_textDifficultyNumber.SetText( "?" );
m_textDifficultyNumber.SetDiffuse( colorNotes );
m_textModifiers.SetText( sModifiers );
}
void CourseEntryDisplay::LoadFromMeterRange( int iNum, int iLow, int iHigh, CString sModifiers )
{
m_textNumber.SetText( ssprintf("%d", iNum) );
RageColor colorGroup = RageColor(1,1,1,1); // TODO: What should this be?
RageColor colorNotes = RageColor(1,1,1,1);
m_TextBanner.LoadFromString( "??????????", "??????????", "", "", "", "" );
m_TextBanner.SetDiffuse( colorGroup );
m_textFoot.SetText( "1" );
m_textFoot.SetDiffuse( colorNotes );
m_textDifficultyNumber.SetText( ssprintf(iLow==iHigh?"%d":"%d-%d", iLow, iHigh) );
m_textDifficultyNumber.SetDiffuse( colorNotes );
m_textModifiers.SetText( sModifiers );
}