option icons working, new font format, more theme metrics cleanup
This commit is contained in:
@@ -35,7 +35,7 @@ BPMDisplay::BPMDisplay()
|
||||
m_rectFrame.SetZoomX( 120 );
|
||||
m_rectFrame.SetZoomY( 40 );
|
||||
|
||||
m_textBPM.LoadFromFont( THEME->GetPathTo("Fonts","header1") );
|
||||
m_textBPM.LoadFromFont( THEME->GetPathTo("Fonts","bpmdisplay") );
|
||||
m_textBPM.TurnShadowOff();
|
||||
m_textBPM.SetXY( CENTER_X, SCREEN_HEIGHT - 50 );
|
||||
//m_textBPM.SetSequence( ssprintf("999") );
|
||||
@@ -44,7 +44,7 @@ BPMDisplay::BPMDisplay()
|
||||
m_textBPM.SetDiffuseTopEdge( NORMAL_COLOR_TOP ); // yellow
|
||||
m_textBPM.SetDiffuseBottomEdge( NORMAL_COLOR_BOTTOM ); // orange
|
||||
|
||||
m_textLabel.LoadFromFont( THEME->GetPathTo("Fonts","header1") );
|
||||
m_textLabel.LoadFromFont( THEME->GetPathTo("Fonts","bpmdisplay") );
|
||||
m_textLabel.TurnShadowOff();
|
||||
m_textLabel.SetXY( 34, 2 );
|
||||
m_textLabel.SetText( "BPM" );
|
||||
|
||||
@@ -70,7 +70,7 @@ BitmapText::BitmapText()
|
||||
BitmapText::~BitmapText()
|
||||
{
|
||||
if( m_pFont )
|
||||
FONT->UnloadFont( m_pFont->m_sFontFilePath );
|
||||
FONT->UnloadFont( m_pFont->m_sTexturePath );
|
||||
}
|
||||
|
||||
bool BitmapText::LoadFromFont( CString sFontFilePath )
|
||||
@@ -78,9 +78,18 @@ bool BitmapText::LoadFromFont( CString sFontFilePath )
|
||||
LOG->Trace( "BitmapText::LoadFromFontName(%s)", sFontFilePath );
|
||||
|
||||
// load font
|
||||
m_pFont = FONT->LoadFont( sFontFilePath, "" );
|
||||
m_pFont = FONT->LoadFont( sFontFilePath );
|
||||
|
||||
m_iLineHeight = m_pFont->m_pTexture->GetSourceFrameHeight();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool BitmapText::LoadFromTextureAndChars( CString sTexturePath, CString sChars )
|
||||
{
|
||||
LOG->Trace( "BitmapText::LoadFromTextureAndChars(%s)", sTexturePath );
|
||||
|
||||
// load font
|
||||
m_pFont = FONT->LoadFont( sTexturePath, sChars );
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -184,14 +193,15 @@ void BitmapText::DrawPrimitives()
|
||||
|
||||
|
||||
const int iHeight = pTexture->GetSourceFrameHeight(); // height of a character
|
||||
const int iLineSpacing = m_pFont->m_iLineSpacing; // spacing between lines
|
||||
const int iFrameWidth = pTexture->GetSourceFrameWidth(); // width of a character frame in logical units
|
||||
|
||||
int iY; // the center position of the first row of characters
|
||||
switch( m_VertAlign )
|
||||
{
|
||||
case align_bottom: iY = -(m_iNumLines) * m_iLineHeight + m_iLineHeight/2; break;
|
||||
case align_middle: iY = -(m_iNumLines-1) * m_iLineHeight/2; break;
|
||||
case align_top: iY = + m_iLineHeight/2; break;
|
||||
case align_bottom: iY = -(m_iNumLines) * iLineSpacing + iLineSpacing/2; break;
|
||||
case align_middle: iY = -(m_iNumLines-1) * iLineSpacing/2; break;
|
||||
case align_top: iY = + iLineSpacing/2; break;
|
||||
default: ASSERT( false );
|
||||
}
|
||||
|
||||
@@ -219,21 +229,18 @@ void BitmapText::DrawPrimitives()
|
||||
throw RageException( "The font '%s' does not implement the character '%c'", m_sFontFilePath, c );
|
||||
const int iCharWidth = m_pFont->m_iFrameNoToWidth[iFrameNo];
|
||||
|
||||
// HACK:
|
||||
// The right side of any italic letter is being cropped. So, we're going to draw a little bit
|
||||
// to the right of the normal character.
|
||||
const float fPercentExtra = min( m_pFont->m_fDrawExtraPercent, (iFrameWidth-iCharWidth)/(float)iFrameWidth ); // don't draw from the adjacent frame
|
||||
|
||||
const int iDrawExtraPixelsLeft = min( m_pFont->m_iDrawExtraPixelsLeft, (iFrameWidth-iCharWidth)/2 );
|
||||
const int iDrawExtraPixelsRight = min( m_pFont->m_iDrawExtraPixelsRight, (iFrameWidth-iCharWidth)/2 );
|
||||
|
||||
//
|
||||
// set vertex positions
|
||||
//
|
||||
const float fExtraPixels = fPercentExtra * pTexture->GetSourceFrameWidth();
|
||||
|
||||
v[iNumV++].p = D3DXVECTOR3( (float)iX, iY-iHeight/2.0f, 0 ); // top left
|
||||
v[iNumV++].p = D3DXVECTOR3( iX+iCharWidth+fExtraPixels, iY-iHeight/2.0f, 0 ); // top right
|
||||
v[iNumV++].p = D3DXVECTOR3( (float)iX, iY+iHeight/2.0f, 0 ); // bottom left
|
||||
v[iNumV++].p = D3DXVECTOR3( iX+iCharWidth+fExtraPixels, iY+iHeight/2.0f, 0 ); // bottom right
|
||||
v[iNumV++].p = D3DXVECTOR3( (float)iX-iDrawExtraPixelsLeft, iY-iHeight/2.0f, 0 ); // top left
|
||||
v[iNumV++].p = D3DXVECTOR3( (float)iX-iDrawExtraPixelsLeft+iCharWidth+iDrawExtraPixelsRight, iY-iHeight/2.0f, 0 ); // top right
|
||||
v[iNumV++].p = D3DXVECTOR3( (float)iX-iDrawExtraPixelsLeft, iY+iHeight/2.0f, 0 ); // bottom left
|
||||
v[iNumV++].p = D3DXVECTOR3( (float)iX-iDrawExtraPixelsLeft+iCharWidth+iDrawExtraPixelsRight, iY+iHeight/2.0f, 0 ); // bottom right
|
||||
|
||||
iX += iCharWidth;
|
||||
|
||||
@@ -251,15 +258,16 @@ void BitmapText::DrawPrimitives()
|
||||
frectTexCoords.left += fTexCoordsToChopOff/2;
|
||||
frectTexCoords.right -= fTexCoordsToChopOff/2;
|
||||
|
||||
const float fExtraTexCoords = fPercentExtra * pTexture->GetTextureFrameWidth() / pTexture->GetTextureWidth();
|
||||
const float fExtraTexCoordsLeft = iDrawExtraPixelsLeft / (float)pTexture->GetSourceWidth();
|
||||
const float fExtraTexCoordsRight = iDrawExtraPixelsRight / (float)pTexture->GetSourceWidth();
|
||||
|
||||
v[iNumV++].t = D3DXVECTOR2( frectTexCoords.left, frectTexCoords.top ); // top left
|
||||
v[iNumV++].t = D3DXVECTOR2( frectTexCoords.right + fExtraTexCoords, frectTexCoords.top ); // top right
|
||||
v[iNumV++].t = D3DXVECTOR2( frectTexCoords.left, frectTexCoords.bottom ); // bottom left
|
||||
v[iNumV++].t = D3DXVECTOR2( frectTexCoords.right + fExtraTexCoords, frectTexCoords.bottom ); // bottom right
|
||||
v[iNumV++].t = D3DXVECTOR2( frectTexCoords.left - fExtraTexCoordsLeft, frectTexCoords.top ); // top left
|
||||
v[iNumV++].t = D3DXVECTOR2( frectTexCoords.right + fExtraTexCoordsRight, frectTexCoords.top ); // top right
|
||||
v[iNumV++].t = D3DXVECTOR2( frectTexCoords.left - fExtraTexCoordsLeft, frectTexCoords.bottom ); // bottom left
|
||||
v[iNumV++].t = D3DXVECTOR2( frectTexCoords.right + fExtraTexCoordsRight, frectTexCoords.bottom ); // bottom right
|
||||
}
|
||||
|
||||
iY += m_iLineHeight;
|
||||
iY += iLineSpacing;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,6 @@ public:
|
||||
|
||||
int GetWidestLineWidthInSourcePixels() { return m_iWidestLineWidth; };
|
||||
void CropToWidth( int iWidthInSourcePixels );
|
||||
void SetLineHeight( int iLineHeight ) { m_iLineHeight = iLineHeight; };
|
||||
|
||||
virtual void DrawPrimitives();
|
||||
|
||||
@@ -51,7 +50,6 @@ protected:
|
||||
int m_iNumLines;
|
||||
int m_iLineWidths[MAX_TEXT_LINES]; // in source pixels
|
||||
int m_iWidestLineWidth; // in source pixels
|
||||
int m_iLineHeight;
|
||||
|
||||
bool m_bRainbow;
|
||||
};
|
||||
|
||||
@@ -29,13 +29,13 @@ Combo::Combo()
|
||||
{
|
||||
Reset();
|
||||
|
||||
m_sprCombo.Load( THEME->GetPathTo("Graphics", "gameplay combo") );
|
||||
m_sprCombo.Load( THEME->GetPathTo("Graphics", "gameplay combo label") );
|
||||
m_sprCombo.TurnShadowOn();
|
||||
m_sprCombo.StopAnimating();
|
||||
m_sprCombo.SetX( 40 );
|
||||
m_sprCombo.SetZoom( 1.0f );
|
||||
|
||||
m_textComboNumber.LoadFromFont( THEME->GetPathTo("Fonts","combo numbers") );
|
||||
m_textComboNumber.LoadFromTextureAndChars( THEME->GetPathTo("Graphics","gameplay combo numbers 5x2"), "0123456789" );
|
||||
m_textComboNumber.TurnShadowOn();
|
||||
m_textComboNumber.SetHorizAlign( Actor::align_right );
|
||||
m_textComboNumber.SetX( 0 );
|
||||
|
||||
+50
-116
@@ -21,130 +21,67 @@
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
||||
Font::Font( const CString &sFontFilePath )
|
||||
Font::Font( const CString &sASCIITexturePath )
|
||||
{
|
||||
//LOG->Trace( "Font::LoadFromFontName(%s)", sFontFilePath );
|
||||
for( int i=0; i<MAX_FONT_CHARS; i++ )
|
||||
//LOG->Trace( "Font::LoadFromFontName(%s)", sASCIITexturePath );
|
||||
|
||||
int i;
|
||||
|
||||
for( i=0; i<MAX_FONT_CHARS; i++ )
|
||||
{
|
||||
m_iCharToFrameNo[i] = -1;
|
||||
m_iFrameNoToWidth[i] = -1;
|
||||
}
|
||||
|
||||
m_bCapitalsOnly = false;
|
||||
m_fDrawExtraPercent = 0;
|
||||
|
||||
|
||||
m_iRefCount = 1;
|
||||
|
||||
m_sFontFilePath = sFontFilePath; // save
|
||||
|
||||
|
||||
//
|
||||
// Split for the directory. We'll need it below
|
||||
//
|
||||
CString sFontDir, sFontFileName, sFontExtension;
|
||||
splitrelpath( sFontFilePath, sFontDir, sFontFileName, sFontExtension );
|
||||
|
||||
//
|
||||
// Read .font file
|
||||
//
|
||||
IniFile ini;
|
||||
ini.SetPath( m_sFontFilePath );
|
||||
if( !ini.ReadFile() )
|
||||
throw RageException( "Error opening Font file '%s'.", m_sFontFilePath );
|
||||
|
||||
|
||||
//
|
||||
// load texture
|
||||
//
|
||||
CString sTextureFile;
|
||||
ini.GetValue( "Font", "Texture", sTextureFile );
|
||||
if( sTextureFile == "" )
|
||||
throw RageException( "Error reading value 'Texture' from %s.", m_sFontFilePath );
|
||||
|
||||
m_sTexturePath = sFontDir + sTextureFile; // save the path of the new texture
|
||||
m_sTexturePath = sASCIITexturePath;
|
||||
m_sTexturePath.MakeLower();
|
||||
|
||||
|
||||
m_pTexture = TEXTUREMAN->LoadTexture( m_sTexturePath );
|
||||
assert( m_pTexture != NULL );
|
||||
ASSERT( m_pTexture != NULL );
|
||||
if( m_pTexture->GetNumFrames() != 16*16 )
|
||||
throw RageException( "The font '%s' has only %d frames. All fonts must have 16*16 frames.", m_sTexturePath );
|
||||
|
||||
for( i=0; i<256; i++ )
|
||||
m_iCharToFrameNo[i] = i;
|
||||
|
||||
//
|
||||
// find out what characters are in this font
|
||||
//
|
||||
CString sCharacters;
|
||||
if( ini.GetValue("Font", "Characters", sCharacters) ) // the creator supplied characters
|
||||
{
|
||||
// sanity check
|
||||
if( sCharacters.GetLength() != m_pTexture->GetNumFrames() )
|
||||
throw RageException( "The characters in '%s' does not match the number of frames in the texture."
|
||||
"The font has %d characters, and the texture has %d frames.",
|
||||
m_sFontFilePath, sCharacters.GetLength(), m_pTexture->GetNumFrames() );
|
||||
// Find .ini widths path from texture path
|
||||
CString sDir, sFileName, sExtension;
|
||||
splitrelpath( sASCIITexturePath, sDir, sFileName, sExtension );
|
||||
const CString sIniPath = sDir + sFileName + ".ini";
|
||||
IniFile ini;
|
||||
ini.SetPath( sIniPath );
|
||||
ini.ReadFile();
|
||||
|
||||
// set the char to frame number map
|
||||
for( int i=0; i<sCharacters.GetLength(); i++ )
|
||||
{
|
||||
char c = sCharacters[i];
|
||||
int iFrameNo = i;
|
||||
|
||||
m_iCharToFrameNo[c] = iFrameNo;
|
||||
}
|
||||
}
|
||||
else // the font file creator did not supply characters. Assume this is a full low ASCII set.
|
||||
{
|
||||
switch( m_pTexture->GetNumFrames() )
|
||||
{
|
||||
case 256: // ASCII 0-255
|
||||
{
|
||||
for( int i=0; i<256; i++ )
|
||||
m_iCharToFrameNo[i] = i;
|
||||
}
|
||||
break;
|
||||
case 128: // ASCII 32-159
|
||||
{
|
||||
for( int i=32; i<128+32; i++ )
|
||||
m_iCharToFrameNo[i] = i-32;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw RageException( "No characters were specified in '%s' and the font is not a standard ASCII set.", m_sFontFilePath );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ini.GetValueB( "Font", "CapitalsOnly", m_bCapitalsOnly );
|
||||
ini.GetValueF( "Font", "DrawExtraPercent", m_fDrawExtraPercent );
|
||||
|
||||
|
||||
//
|
||||
// load character widths
|
||||
//
|
||||
CString sWidthsValue;
|
||||
if( ini.GetValue("Font", "Widths", sWidthsValue) ) // the creator supplied widths
|
||||
{
|
||||
CStringArray asCharWidths;
|
||||
asCharWidths.SetSize( 0, 256 );
|
||||
split( sWidthsValue, ",", asCharWidths );
|
||||
for( i=0; i<256; i++ )
|
||||
if( !ini.GetValueI( "Char Widths", ssprintf("%d",i), m_iFrameNoToWidth[i] ) )
|
||||
throw RageException( "Error reading 'Char Widths from '%s'.", sIniPath );
|
||||
|
||||
if( asCharWidths.GetSize() != m_pTexture->GetNumFrames() )
|
||||
throw RageException( "The number of widths specified in '%s' (%d) do not match the number of frames in the texture (%d).",
|
||||
m_sFontFilePath, asCharWidths.GetSize(), m_pTexture->GetNumFrames() );
|
||||
m_bCapitalsOnly = false;
|
||||
ini.GetValueB( "Char Widths", "CapitalsOnly", m_bCapitalsOnly );
|
||||
|
||||
for( int i=0; i<asCharWidths.GetSize(); i++ )
|
||||
{
|
||||
m_iFrameNoToWidth[i] = atoi( asCharWidths[i] );
|
||||
if( m_iFrameNoToWidth[i]%2 == 1 )
|
||||
m_iFrameNoToWidth[i]++;
|
||||
}
|
||||
}
|
||||
else // The font file creator didn't supply widths. Assume each character is the width of the frame.
|
||||
m_iDrawExtraPixelsLeft = 0;
|
||||
ini.GetValueI( "Char Widths", "DrawExtraPixelsLeft", m_iDrawExtraPixelsLeft );
|
||||
|
||||
m_iDrawExtraPixelsRight = 0;
|
||||
ini.GetValueI( "Char Widths", "DrawExtraPixelsRight", m_iDrawExtraPixelsRight );
|
||||
|
||||
int iAddToAllWidths = 0;
|
||||
if( ini.GetValueI( "Char Widths", "AddToAllWidths", iAddToAllWidths ) )
|
||||
{
|
||||
for( int i=0; i<(int)m_pTexture->GetNumFrames(); i++ )
|
||||
{
|
||||
m_iFrameNoToWidth[i] = m_pTexture->GetSourceFrameWidth();
|
||||
}
|
||||
for( int i=0; i<256; i++ )
|
||||
m_iFrameNoToWidth[i] += iAddToAllWidths;
|
||||
}
|
||||
|
||||
m_iLineSpacing = m_pTexture->GetSourceFrameHeight();
|
||||
ini.GetValueI( "Char Widths", "LineHeight", m_iLineSpacing );
|
||||
|
||||
// force widths to even number
|
||||
for( i=0; i<256; i++ )
|
||||
if( m_iFrameNoToWidth[i]%2 == 1 )
|
||||
m_iFrameNoToWidth[i]++;
|
||||
}
|
||||
|
||||
|
||||
@@ -159,23 +96,21 @@ Font::Font( const CString &sTexturePath, const CString& sCharacters )
|
||||
}
|
||||
|
||||
m_bCapitalsOnly = false;
|
||||
m_fDrawExtraPercent = 0;
|
||||
|
||||
m_iDrawExtraPixelsLeft = 0;
|
||||
m_iDrawExtraPixelsRight = 0;
|
||||
|
||||
m_iRefCount = 1;
|
||||
|
||||
m_sFontFilePath = sTexturePath; // save
|
||||
|
||||
|
||||
//
|
||||
// load texture
|
||||
//
|
||||
m_sTexturePath = sTexturePath; // save the path of the new texture
|
||||
m_sTexturePath = sTexturePath; // save
|
||||
m_sTexturePath.MakeLower();
|
||||
|
||||
|
||||
m_pTexture = TEXTUREMAN->LoadTexture( m_sTexturePath );
|
||||
assert( m_pTexture != NULL );
|
||||
ASSERT( m_pTexture != NULL );
|
||||
m_iLineSpacing = m_pTexture->GetSourceFrameHeight();
|
||||
|
||||
|
||||
//
|
||||
@@ -183,9 +118,8 @@ Font::Font( const CString &sTexturePath, const CString& sCharacters )
|
||||
//
|
||||
// sanity check
|
||||
if( sCharacters.GetLength() != m_pTexture->GetNumFrames() )
|
||||
throw RageException( "The characters in '%s' does not match the number of frames in the texture."
|
||||
"The font has %d frames, and the texture has %d frames.",
|
||||
m_sFontFilePath, sCharacters.GetLength(), m_pTexture->GetNumFrames() );
|
||||
throw RageException( "The image '%s' doesn't have the correct number of frames. It has %d frames but should have %d frames.",
|
||||
m_sTexturePath, m_pTexture->GetNumFrames(), sCharacters.GetLength() );
|
||||
|
||||
// set the char to frame number map
|
||||
for( i=0; i<sCharacters.GetLength(); i++ )
|
||||
@@ -218,7 +152,7 @@ int Font::GetLineWidthInSourcePixels( const char *szLine, int iLength )
|
||||
const char c = szLine[i];
|
||||
const int iFrameNo = m_iCharToFrameNo[c];
|
||||
if( iFrameNo == -1 ) // this font doesn't impelemnt this character
|
||||
throw RageException( "The font '%s' does not implement the character '%c'", m_sFontFilePath, c );
|
||||
throw RageException( "The font '%s' does not implement the character '%c'", m_sTexturePath, c );
|
||||
|
||||
iLineWidth += m_iFrameNoToWidth[iFrameNo];
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ class Font
|
||||
protected:
|
||||
|
||||
public:
|
||||
Font( const CString &sFontPath );
|
||||
Font( const CString &sASCIITexturePath );
|
||||
Font( const CString &sTexturePath, const CString& sChars );
|
||||
~Font();
|
||||
|
||||
@@ -28,12 +28,12 @@ public:
|
||||
|
||||
int m_iRefCount;
|
||||
|
||||
CString m_sFontFilePath;
|
||||
CString m_sTexturePath;
|
||||
|
||||
RageTexture* m_pTexture;
|
||||
bool m_bCapitalsOnly;
|
||||
float m_fDrawExtraPercent; // for italic fonts
|
||||
int m_iDrawExtraPixelsLeft, m_iDrawExtraPixelsRight; // for italic fonts
|
||||
int m_iLineSpacing;
|
||||
|
||||
int m_iCharToFrameNo[MAX_FONT_CHARS];
|
||||
int m_iFrameNoToWidth[MAX_FONT_CHARS]; // in soure coordinate space
|
||||
|
||||
@@ -22,7 +22,7 @@ public:
|
||||
FontManager();
|
||||
~FontManager();
|
||||
|
||||
Font* LoadFont( CString sFontOrTextureFilePath, CString sChars );
|
||||
Font* LoadFont( CString sFontOrTextureFilePath, CString sChars = "" );
|
||||
bool IsFontLoaded( CString sFontPath );
|
||||
void UnloadFont( CString sFontPath );
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
FootMeter::FootMeter()
|
||||
{
|
||||
LoadFromFont( THEME->GetPathTo("Fonts","meter") );
|
||||
BitmapText::LoadFromTextureAndChars( THEME->GetPathTo("Graphics","select music meter 2x1"), "10" );
|
||||
|
||||
SetFromNotes( NULL );
|
||||
}
|
||||
|
||||
@@ -16,15 +16,18 @@
|
||||
|
||||
#define COLOR_P1 THEME->GetMetricC("Common","ColorP1")
|
||||
#define COLOR_P2 THEME->GetMetricC("Common","ColorP2")
|
||||
#define COLOR_EASY THEME->GetMetricC("Common","ColorEasy")
|
||||
#define COLOR_MEDIUM THEME->GetMetricC("Common","ColorMedium")
|
||||
#define COLOR_HARD THEME->GetMetricC("Common","ColorHard")
|
||||
|
||||
|
||||
D3DXCOLOR DifficultyClassToColor( DifficultyClass dc )
|
||||
{
|
||||
switch( dc )
|
||||
{
|
||||
case CLASS_EASY: return D3DXCOLOR(1,1,0,1); // yellow
|
||||
case CLASS_MEDIUM: return D3DXCOLOR(1,0,0,1); // red
|
||||
case CLASS_HARD: return D3DXCOLOR(0,1,0,1); // green
|
||||
case CLASS_EASY: return COLOR_EASY;
|
||||
case CLASS_MEDIUM: return COLOR_MEDIUM;
|
||||
case CLASS_HARD: return COLOR_HARD;
|
||||
default: ASSERT(0); return D3DXCOLOR(); // invalid DifficultyClass
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ void GroupList::DoneAddingGroups()
|
||||
|
||||
for( i=0; i<min(m_textLabels.GetSize(), MAX_GROUPS_ONSCREEN); i++ )
|
||||
{
|
||||
m_screenLabels[i].LoadFromFont( THEME->GetPathTo("Fonts","normal") );
|
||||
m_screenLabels[i].LoadFromFont( THEME->GetPathTo("Fonts","select group button label") );
|
||||
m_screenLabels[i].SetXY( BUTTON_X, BUTTON_START_Y + i*BUTTON_SPACING_Y );
|
||||
m_screenLabels[i].SetZoom( 0.8f );
|
||||
m_screenLabels[i].SetShadowLength( 2 );
|
||||
|
||||
@@ -53,14 +53,14 @@ void LifeMeterBattery::Load( PlayerNumber pn )
|
||||
if( bPlayerEnabled )
|
||||
this->AddChild( &m_sprBattery );
|
||||
|
||||
m_textNumLives.LoadFromFont( THEME->GetPathTo("Fonts","header1") );
|
||||
m_textNumLives.LoadFromTextureAndChars( THEME->GetPathTo("Graphics","gameplay battery life numbers 7x2"), "01234 :56789%." );
|
||||
m_textNumLives.SetDiffuse( D3DXCOLOR(1,1,1,1) ); // pink
|
||||
m_textNumLives.SetZoom( 1.1f );
|
||||
m_textNumLives.TurnShadowOff();
|
||||
if( bPlayerEnabled )
|
||||
this->AddChild( &m_textNumLives );
|
||||
|
||||
m_textPercent.LoadFromFont( THEME->GetPathTo("Fonts","score numbers") );
|
||||
m_textPercent.LoadFromTextureAndChars( THEME->GetPathTo("Graphics","gameplay battery percent numbers 7x2"), "01234 :56789%." );
|
||||
m_textPercent.TurnShadowOff();
|
||||
m_textPercent.SetZoom( 0.7f );
|
||||
m_textPercent.SetText( "00.0" );
|
||||
|
||||
@@ -53,7 +53,7 @@ MenuElements::MenuElements()
|
||||
this->AddChild( &m_Invisible );
|
||||
}
|
||||
|
||||
void MenuElements::Load( CString sBackgroundPath, CString sTopEdgePath, CString sHelpText, bool bTimerEnabled, int iTimerSeconds )
|
||||
void MenuElements::Load( CString sBackgroundPath, CString sTopEdgePath, CString sHelpText, bool bShowStyleIcon, bool bTimerEnabled, int iTimerSeconds )
|
||||
{
|
||||
LOG->Trace( "MenuElements::MenuElements()" );
|
||||
|
||||
@@ -68,7 +68,7 @@ void MenuElements::Load( CString sBackgroundPath, CString sTopEdgePath, CString
|
||||
m_sprStyleIcon.Load( THEME->GetPathTo("Graphics",ssprintf("menu style icons game %d",GAMESTATE->m_CurGame)) );
|
||||
m_sprStyleIcon.StopAnimating();
|
||||
m_sprStyleIcon.SetXY( STYLE_ICON_X, STYLE_ICON_Y );
|
||||
if( GAMESTATE->m_CurStyle == STYLE_NONE )
|
||||
if( GAMESTATE->m_CurStyle == STYLE_NONE || !bShowStyleIcon )
|
||||
m_sprStyleIcon.SetDiffuse( D3DXCOLOR(1,1,1,0) );
|
||||
else
|
||||
{
|
||||
@@ -91,7 +91,7 @@ void MenuElements::Load( CString sBackgroundPath, CString sTopEdgePath, CString
|
||||
|
||||
m_textHelp.SetXY( HELP_X, HELP_Y );
|
||||
CStringArray asHelpTips;
|
||||
split( sHelpText, "::", asHelpTips );
|
||||
split( sHelpText, "\n", asHelpTips );
|
||||
m_textHelp.SetTips( asHelpTips );
|
||||
m_textHelp.SetZoom( 0.5f );
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
|
||||
virtual void DrawPrimitives();
|
||||
|
||||
void Load( CString sBackgroundPath, CString sTopEdgePath, CString sHelpText, bool bTimerEnabled, int iTimerSeconds );
|
||||
void Load( CString sBackgroundPath, CString sTopEdgePath, CString sHelpText, bool bShowStyleIcon, bool bTimerEnabled, int iTimerSeconds );
|
||||
void SetTimer( int iTimerSeconds );
|
||||
void StartTimer();
|
||||
void StallTimer();
|
||||
|
||||
@@ -25,12 +25,12 @@ MenuTimer::MenuTimer()
|
||||
m_fStallSeconds = 0;
|
||||
m_bTimerStopped = false;
|
||||
|
||||
m_textDigit1.LoadFromFont( THEME->GetPathTo("Fonts","timer numbers") );
|
||||
m_textDigit1.LoadFromTextureAndChars( THEME->GetPathTo("Graphics","menu timer numbers 5x2"), "0123456789" );
|
||||
m_textDigit1.TurnShadowOff();
|
||||
m_textDigit1.SetXY( -18, 0 );
|
||||
this->AddChild( &m_textDigit1 );
|
||||
|
||||
m_textDigit2.LoadFromFont( THEME->GetPathTo("Fonts","timer numbers") );
|
||||
m_textDigit2.LoadFromTextureAndChars( THEME->GetPathTo("Graphics","menu timer numbers 5x2"), "0123456789" );
|
||||
m_textDigit2.TurnShadowOff();
|
||||
m_textDigit2.SetXY( +18, 0 );
|
||||
this->AddChild( &m_textDigit2 );
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
* can add a setting that changes which metric group we pull
|
||||
* settings out of, so it can be configured separately. */
|
||||
#define TITLES_START_X THEME->GetMetricF("ScreenSelectGroup","TitlesStartX")
|
||||
#define TITLES_WIDTH THEME->GetMetricF("ScreenSelectGroup","TitlesWidth")
|
||||
#define TITLES_SPACING_X THEME->GetMetricF("ScreenSelectGroup","TitlesSpacingX")
|
||||
#define TITLES_START_Y THEME->GetMetricF("ScreenSelectGroup","TitlesStartY")
|
||||
#define TITLES_COLUMNS THEME->GetMetricI("ScreenSelectGroup","TitlesColumns")
|
||||
@@ -17,7 +18,7 @@ MusicList::MusicList()
|
||||
|
||||
for( int i=0; i<TITLES_COLUMNS; i++ )
|
||||
{
|
||||
m_textTitles[i].LoadFromFont( THEME->GetPathTo("Fonts","normal") );
|
||||
m_textTitles[i].LoadFromFont( THEME->GetPathTo("Fonts","small titles") );
|
||||
m_textTitles[i].SetXY( TITLES_START_X + i*TITLES_SPACING_X, TITLES_START_Y );
|
||||
m_textTitles[i].SetHorizAlign( Actor::align_left );
|
||||
m_textTitles[i].SetVertAlign( Actor::align_top );
|
||||
@@ -76,7 +77,7 @@ void MusicList::SetGroupNo(int group)
|
||||
for( int c=0; c<TITLES_COLUMNS; c++ )
|
||||
{
|
||||
m_textTitles[c].SetText( m_ContentsText[CurGroup].ContentsText[c] );
|
||||
m_textTitles[c].CropToWidth( int(TITLES_SPACING_X/m_textTitles[c].GetZoom()) );
|
||||
m_textTitles[c].CropToWidth( int(TITLES_WIDTH/m_textTitles[c].GetZoom()) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -81,14 +81,14 @@ WheelItemDisplay::WheelItemDisplay()
|
||||
m_sprSectionBar.Load( THEME->GetPathTo("Graphics","select music section bar") );
|
||||
m_sprSectionBar.SetXY( 0, 0 );
|
||||
|
||||
m_textSectionName.LoadFromFont( THEME->GetPathTo("Fonts","header1") );
|
||||
m_textSectionName.LoadFromFont( THEME->GetPathTo("Fonts","musicwheel section") );
|
||||
m_textSectionName.TurnShadowOff();
|
||||
m_textSectionName.SetVertAlign( align_middle );
|
||||
m_textSectionName.SetXY( SECTION_NAME_X, 0 );
|
||||
m_textSectionName.SetZoom( SECTION_ZOOM );
|
||||
|
||||
|
||||
m_textRoulette.LoadFromFont( THEME->GetPathTo("Fonts","text banner") );
|
||||
m_textRoulette.LoadFromFont( THEME->GetPathTo("Fonts","musicwheel roulette") );
|
||||
m_textRoulette.TurnShadowOff();
|
||||
m_textRoulette.SetText( "ROULETTE" );
|
||||
m_textRoulette.TurnRainbowOn();
|
||||
@@ -102,7 +102,7 @@ WheelItemDisplay::WheelItemDisplay()
|
||||
m_GradeDisplay[p].SetXY( GRADE_X(p), 0 );
|
||||
}
|
||||
|
||||
m_textCourse.LoadFromFont( THEME->GetPathTo("Fonts","text banner") );
|
||||
m_textCourse.LoadFromFont( THEME->GetPathTo("Fonts","musicwheel course") );
|
||||
m_textCourse.TurnShadowOff();
|
||||
m_textCourse.SetZoom( COURSE_ZOOM );
|
||||
m_textCourse.SetHorizAlign( align_left );
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#define TEXT_V_ALIGN THEME->GetMetricI("OptionIcon","TextVAlign")
|
||||
#define TEXT_WIDTH THEME->GetMetricI("OptionIcon","TextWidth")
|
||||
#define TEXT_ZOOM THEME->GetMetricF("OptionIcon","TextZoom")
|
||||
#define UPPERCASE THEME->GetMetricB("OptionIcon","Uppercase")
|
||||
|
||||
|
||||
OptionIcon::OptionIcon()
|
||||
@@ -39,6 +40,16 @@ OptionIcon::OptionIcon()
|
||||
|
||||
void OptionIcon::Load( PlayerNumber pn, CString sText, bool bHeader )
|
||||
{
|
||||
static CString sStopWords[] = { "OFF", "VISIBLE", "VIVID" };
|
||||
const int iNumStopWords = sizeof(sStopWords)/sizeof(sStopWords[0]);
|
||||
|
||||
for( int i=0; i<iNumStopWords; i++ )
|
||||
if( sText == sStopWords[i] )
|
||||
sText = "";
|
||||
|
||||
if( UPPERCASE )
|
||||
sText.MakeUpper();
|
||||
|
||||
bool bVacant = (sText=="");
|
||||
m_spr.SetState( pn*3 + (bHeader?0:(bVacant?1:2)) );
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "OptionIconRow.h"
|
||||
#include "ThemeManager.h"
|
||||
#include "PlayerOptions.h"
|
||||
#include "GameState.h"
|
||||
|
||||
|
||||
#define SPACING_X THEME->GetMetricF("OptionIconRow","SpacingX")
|
||||
@@ -28,10 +29,95 @@ OptionIconRow::OptionIconRow()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
struct OptionColumnEntry
|
||||
{
|
||||
char szString[30];
|
||||
int iSlotIndex;
|
||||
};
|
||||
|
||||
const OptionColumnEntry g_OptionColumnEntries[] =
|
||||
{
|
||||
{"0.5X", 0},
|
||||
{"0.75X", 0},
|
||||
{"1X", 0},
|
||||
{"1.5X", 0},
|
||||
{"2X", 0},
|
||||
{"3X", 0},
|
||||
{"4X", 0},
|
||||
{"5X", 0},
|
||||
{"8X", 0},
|
||||
{"Boost", 1},
|
||||
{"Wave", 1},
|
||||
{"Drunk", 1},
|
||||
{"Dizzy", 1},
|
||||
{"Space", 1},
|
||||
{"Mini", 1},
|
||||
{"Flip", 1},
|
||||
{"Tornado", 1},
|
||||
{"Hidden", 2},
|
||||
{"Sudden", 2},
|
||||
{"Stealth", 2},
|
||||
{"Blink", 2},
|
||||
{"Mirror", 3},
|
||||
{"Left", 3},
|
||||
{"Right", 3},
|
||||
{"Shuffle", 3},
|
||||
{"SuperShuffle", 3},
|
||||
{"Little", 4},
|
||||
{"NoHolds", 4},
|
||||
{"Dark", 4},
|
||||
{"Reverse", 5},
|
||||
{"Note", 6},
|
||||
{"Flat", 6},
|
||||
{"Plain", 6},
|
||||
};
|
||||
const int NUM_OPTION_COL_ENTRIES = sizeof(g_OptionColumnEntries)/sizeof(OptionColumnEntry);
|
||||
|
||||
int OptionToPreferredColumn( CString sOptionText )
|
||||
{
|
||||
for( int i=0; i<NUM_OPTION_COL_ENTRIES; i++ )
|
||||
if( g_OptionColumnEntries[i].szString == sOptionText )
|
||||
return g_OptionColumnEntries[i].iSlotIndex;
|
||||
|
||||
ASSERT(0); // we encountered an option that isn't in our lookup table. You should add it above.
|
||||
return -1;
|
||||
}
|
||||
|
||||
void OptionIconRow::Refresh( PlayerNumber pn )
|
||||
{
|
||||
// init
|
||||
for( int i=0; i<NUM_OPTION_COLS; i++ )
|
||||
m_OptionIcon[i].Load( pn, "BLAH", i==0 );
|
||||
m_OptionIcon[i].Load( pn, "", i==0 );
|
||||
|
||||
CString sOptions = GAMESTATE->m_PlayerOptions[pn].GetString();
|
||||
CStringArray asOptions;
|
||||
split( sOptions, ", ", asOptions, true );
|
||||
|
||||
|
||||
CString asTabs[NUM_OPTION_COLS-1]; // fill these with what will be displayed on the tabs
|
||||
|
||||
// for each option, look for the best column to place it in
|
||||
for( i=0; i<asOptions.GetSize(); i++ )
|
||||
{
|
||||
CString sOption = asOptions[i];
|
||||
int iPerferredCol = OptionToPreferredColumn( sOption );
|
||||
|
||||
// search for a vacant spot
|
||||
for( int i=iPerferredCol; i<NUM_OPTION_COLS-1; i++ )
|
||||
{
|
||||
if( asTabs[i] != "" )
|
||||
continue;
|
||||
else
|
||||
{
|
||||
asTabs[i] = sOption;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for( i=0; i<NUM_OPTION_COLS-1; i++ )
|
||||
m_OptionIcon[i+1].Load( pn, asTabs[i], false );
|
||||
}
|
||||
|
||||
void OptionIconRow::DrawPrimitives()
|
||||
|
||||
@@ -20,9 +20,9 @@ CString PlayerOptions::GetString()
|
||||
|
||||
if( m_fArrowScrollSpeed != 1 )
|
||||
{
|
||||
CString s = ssprintf( "%2.2f", m_fArrowScrollSpeed );
|
||||
if( s[s.GetLength()-1] == '0' )
|
||||
s.Delete(s.GetLength()-1);
|
||||
CString s = ssprintf( "%2.1f", m_fArrowScrollSpeed );
|
||||
if( s.Right(1) == '0' )
|
||||
s.Delete(s.GetLength()-2, 2); // delete last 2 chars
|
||||
sReturn += s + "X, ";
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ ScoreDisplayNormal::ScoreDisplayNormal()
|
||||
LOG->Trace( "ScoreDisplayNormal::ScoreDisplayNormal()" );
|
||||
|
||||
// init the text
|
||||
LoadFromFont( THEME->GetPathTo("Fonts","score numbers") );
|
||||
BitmapText::LoadFromTextureAndChars( THEME->GetPathTo("Graphics","gameplay score numbers 7x2"), "01234 :56789%." );
|
||||
TurnShadowOff();
|
||||
|
||||
m_fScore = 0;
|
||||
|
||||
@@ -51,8 +51,8 @@ ScreenAppearanceOptions::ScreenAppearanceOptions() :
|
||||
Init(
|
||||
INPUTMODE_BOTH,
|
||||
g_AppearanceOptionsLines,
|
||||
NUM_APPEARANCE_OPTIONS_LINES
|
||||
);
|
||||
NUM_APPEARANCE_OPTIONS_LINES,
|
||||
false );
|
||||
m_Menu.StopTimer();
|
||||
|
||||
MUSIC->LoadAndPlayIfNotAlready( THEME->GetPathTo("Sounds","appearance options music") );
|
||||
|
||||
@@ -25,11 +25,10 @@
|
||||
//
|
||||
// Defines specific to ScreenEditMenu
|
||||
//
|
||||
const float EXPLANATION_X = CENTER_X;
|
||||
const float EXPLANATION_Y = SCREEN_BOTTOM - 70;
|
||||
const CString EXPLANATION_TEXT =
|
||||
"In this mode, you can edit existing notes patterns,\n"
|
||||
"create note patterns, or synchronize notes with the music.";
|
||||
#define EXPLANATION_X THEME->GetMetricF("ScreenEditMenu","ExplanationX")
|
||||
#define EXPLANATION_Y THEME->GetMetricF("ScreenEditMenu","ExplanationY")
|
||||
#define EXPLANATION_TEXT THEME->GetMetric("ScreenEditMenu","ExplanationText")
|
||||
#define HELP_TEXT THEME->GetMetric("ScreenEditMenu","HelpText")
|
||||
|
||||
const ScreenMessage SM_GoToPrevScreen = ScreenMessage(SM_User+1);
|
||||
const ScreenMessage SM_GoToNextScreen = ScreenMessage(SM_User+2);
|
||||
@@ -48,8 +47,7 @@ ScreenEditMenu::ScreenEditMenu()
|
||||
m_Menu.Load(
|
||||
THEME->GetPathTo("Graphics","edit menu background"),
|
||||
THEME->GetPathTo("Graphics","edit menu top edge"),
|
||||
ssprintf("%c %c change line %c %c change value START to continue", char(3), char(4), char(1), char(2) ),
|
||||
false, 99
|
||||
HELP_TEXT, false, false, 99
|
||||
);
|
||||
this->AddChild( &m_Menu );
|
||||
|
||||
|
||||
@@ -190,7 +190,7 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
|
||||
m_BannerWithFrame[0].SetXY( BANNER_X, BANNER_Y );
|
||||
this->AddChild( &m_BannerWithFrame[0] );
|
||||
|
||||
m_textStage.LoadFromFont( THEME->GetPathTo("Fonts","header1") );
|
||||
m_textStage.LoadFromFont( THEME->GetPathTo("Fonts","evalstage") );
|
||||
m_textStage.TurnShadowOff();
|
||||
m_textStage.SetXY( STAGE_X, STAGE_Y );
|
||||
m_textStage.SetZoom( 0.5f );
|
||||
@@ -234,7 +234,7 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
|
||||
m_Menu.Load(
|
||||
THEME->GetPathTo("Graphics","evaluation background"),
|
||||
THEME->GetPathTo("Graphics",m_ResultMode==RM_ARCADE_SUMMARY?"evaluation summary top edge":"evaluation top edge"),
|
||||
HELP_TEXT, true, TIMER_SECONDS
|
||||
HELP_TEXT, true, true, TIMER_SECONDS
|
||||
);
|
||||
this->AddChild( &m_Menu );
|
||||
|
||||
@@ -520,28 +520,20 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
|
||||
// Chris: If EZ2 wants to hide these things, place them off screen using theme metrics
|
||||
if( bNewRecord[p] )
|
||||
{
|
||||
m_textNewRecord[p].LoadFromFont( THEME->GetPathTo("Fonts","header1") );
|
||||
m_textNewRecord[p].SetXY( NEW_RECORD_X(p), NEW_RECORD_Y );
|
||||
m_textNewRecord[p].SetShadowLength( 2 );
|
||||
m_textNewRecord[p].SetText( "IT'S A NEW RECORD!" );
|
||||
m_textNewRecord[p].SetZoom( 0.5f );
|
||||
m_textNewRecord[p].SetEffectGlowing( 1.0f );
|
||||
this->AddChild( &m_textNewRecord[p] );
|
||||
m_sprNewRecord[p].Load( THEME->GetPathTo("Graphics","evaluation new record") );
|
||||
m_sprNewRecord[p].SetXY( NEW_RECORD_X(p), NEW_RECORD_Y );
|
||||
m_sprNewRecord[p].SetEffectGlowing( 1.0f );
|
||||
this->AddChild( &m_sprNewRecord[p] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( m_bTryExtraStage )
|
||||
{
|
||||
m_textTryExtraStage.LoadFromFont( THEME->GetPathTo("Fonts","header1") );
|
||||
m_textTryExtraStage.SetXY( TRY_EXTRA_STAGE_X, TRY_EXTRA_STAGE_Y );
|
||||
if( GAMESTATE->IsExtraStage() )
|
||||
m_textTryExtraStage.SetText( "One More ExtraStage!!!" );
|
||||
else
|
||||
m_textTryExtraStage.SetText( "Try ExtraStage!!!" );
|
||||
m_textTryExtraStage.SetZoom( 1 );
|
||||
m_textTryExtraStage.SetEffectGlowing( 1.0f );
|
||||
this->AddChild( &m_textTryExtraStage );
|
||||
m_sprTryExtraStage.Load( THEME->GetPathTo("Graphics",GAMESTATE->IsExtraStage()?"evaluation try extra stage1":"evaluation try extra stage2") );
|
||||
m_sprTryExtraStage.SetXY( TRY_EXTRA_STAGE_X, TRY_EXTRA_STAGE_Y );
|
||||
m_sprTryExtraStage.SetEffectGlowing( 1.0f );
|
||||
this->AddChild( &m_sprTryExtraStage );
|
||||
|
||||
SOUND->PlayOnceStreamed( THEME->GetPathTo("Sounds","evaluation extra stage") );
|
||||
}
|
||||
@@ -678,7 +670,7 @@ void ScreenEvaluation::TweenOnScreen()
|
||||
apActorsInGradeOrPercentFrame.Add( &m_sprPercentFrame[p] );
|
||||
apActorsInGradeOrPercentFrame.Add( &m_textOniPercentLarge[p] );
|
||||
apActorsInGradeOrPercentFrame.Add( &m_textOniPercentSmall[p] );
|
||||
apActorsInGradeOrPercentFrame.Add( &m_textNewRecord[p] );
|
||||
apActorsInGradeOrPercentFrame.Add( &m_sprNewRecord[p] );
|
||||
for( i=0; i<apActorsInGradeOrPercentFrame.GetSize(); i++ )
|
||||
{
|
||||
float fOriginalZoomY = apActorsInGradeOrPercentFrame[i]->GetZoomY();
|
||||
@@ -688,10 +680,10 @@ void ScreenEvaluation::TweenOnScreen()
|
||||
}
|
||||
}
|
||||
|
||||
float fOriginalZoomY = m_textTryExtraStage.GetZoomY();
|
||||
m_textTryExtraStage.SetZoomY( 0 );
|
||||
m_textTryExtraStage.BeginTweening( MENU_ELEMENTS_TWEEN_TIME );
|
||||
m_textTryExtraStage.SetTweenZoomY( fOriginalZoomY );
|
||||
float fOriginalZoomY = m_sprTryExtraStage.GetZoomY();
|
||||
m_sprTryExtraStage.SetZoomY( 0 );
|
||||
m_sprTryExtraStage.BeginTweening( MENU_ELEMENTS_TWEEN_TIME );
|
||||
m_sprTryExtraStage.SetTweenZoomY( fOriginalZoomY );
|
||||
}
|
||||
|
||||
void ScreenEvaluation::TweenOffScreen()
|
||||
@@ -758,7 +750,7 @@ void ScreenEvaluation::TweenOffScreen()
|
||||
apActorsInGradeOrPercentFrame.Add( &m_sprPercentFrame[p] );
|
||||
apActorsInGradeOrPercentFrame.Add( &m_textOniPercentLarge[p] );
|
||||
apActorsInGradeOrPercentFrame.Add( &m_textOniPercentSmall[p] );
|
||||
apActorsInGradeOrPercentFrame.Add( &m_textNewRecord[p] );
|
||||
apActorsInGradeOrPercentFrame.Add( &m_sprNewRecord[p] );
|
||||
for( i=0; i<apActorsInGradeOrPercentFrame.GetSize(); i++ )
|
||||
{
|
||||
apActorsInGradeOrPercentFrame[i]->BeginTweening( MENU_ELEMENTS_TWEEN_TIME );
|
||||
@@ -766,8 +758,8 @@ void ScreenEvaluation::TweenOffScreen()
|
||||
}
|
||||
}
|
||||
|
||||
m_textTryExtraStage.BeginTweening( MENU_ELEMENTS_TWEEN_TIME );
|
||||
m_textTryExtraStage.SetTweenZoomY( 0 );
|
||||
m_sprTryExtraStage.BeginTweening( MENU_ELEMENTS_TWEEN_TIME );
|
||||
m_sprTryExtraStage.SetTweenZoomY( 0 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -74,10 +74,10 @@ protected:
|
||||
Sprite m_sprScoreLabel;
|
||||
ScoreDisplayNormal m_ScoreDisplay[NUM_PLAYERS];
|
||||
|
||||
BitmapText m_textNewRecord[NUM_PLAYERS];
|
||||
Sprite m_sprNewRecord[NUM_PLAYERS];
|
||||
|
||||
bool m_bTryExtraStage;
|
||||
BitmapText m_textTryExtraStage;
|
||||
Sprite m_sprTryExtraStage;
|
||||
};
|
||||
|
||||
class ScreenFinalEvaluation : public ScreenEvaluation
|
||||
|
||||
@@ -69,7 +69,7 @@ ScreenEz2SelectPlayer::ScreenEz2SelectPlayer()
|
||||
m_Menu.Load(
|
||||
THEME->GetPathTo("Graphics","select player background"),
|
||||
THEME->GetPathTo("Graphics","select player top edge"),
|
||||
HELP_TEXT, true, TIMER_SECONDS
|
||||
HELP_TEXT, false, true, TIMER_SECONDS
|
||||
);
|
||||
this->AddChild( &m_Menu );
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ ScreenEz2SelectStyle::ScreenEz2SelectStyle()
|
||||
m_Menu.Load(
|
||||
THEME->GetPathTo("Graphics","select style background"),
|
||||
THEME->GetPathTo("Graphics","select style top edge"),
|
||||
HELP_TEXT, true, TIMER_SECONDS
|
||||
HELP_TEXT, true, true, TIMER_SECONDS
|
||||
);
|
||||
this->AddChild( &m_Menu );
|
||||
|
||||
|
||||
@@ -207,7 +207,7 @@ ScreenGameplay::ScreenGameplay()
|
||||
this->AddChild( &m_sprTopFrame );
|
||||
|
||||
|
||||
m_textStageNumber.LoadFromFont( THEME->GetPathTo("Fonts","Header2") );
|
||||
m_textStageNumber.LoadFromFont( THEME->GetPathTo("Fonts","gameplay stage") );
|
||||
m_textStageNumber.TurnShadowOff();
|
||||
m_textStageNumber.SetXY( STAGE_X, STAGE_Y(bExtra) );
|
||||
m_textStageNumber.SetText( GAMESTATE->GetStageText() );
|
||||
@@ -295,7 +295,7 @@ ScreenGameplay::ScreenGameplay()
|
||||
if( !GAMESTATE->IsPlayerEnabled(PlayerNumber(p)) )
|
||||
continue;
|
||||
|
||||
m_DifficultyBanner[p].SetXY( DIFFICULTY_X(p), DIFFICULTY_Y(p,bReverse[p],bExtra) );
|
||||
m_DifficultyBanner[p].SetXY( DIFFICULTY_X(p), DIFFICULTY_Y(p,bExtra,bReverse[p]) );
|
||||
this->AddChild( &m_DifficultyBanner[p] );
|
||||
}
|
||||
|
||||
@@ -353,7 +353,7 @@ ScreenGameplay::ScreenGameplay()
|
||||
this->AddChild( &m_Fade );
|
||||
|
||||
|
||||
m_textSurviveTime.LoadFromFont( THEME->GetPathTo("Fonts","header1") );
|
||||
m_textSurviveTime.LoadFromTextureAndChars( THEME->GetPathTo("Graphics","gameplay survive time numbers 7x2"), "01234 :56789%." );
|
||||
m_textSurviveTime.TurnShadowOff();
|
||||
m_textSurviveTime.SetXY( SURVIVE_TIME_X, SURVIVE_TIME_Y );
|
||||
m_textSurviveTime.SetText( "" );
|
||||
|
||||
@@ -65,11 +65,11 @@ ScreenGraphicOptions::ScreenGraphicOptions() :
|
||||
{
|
||||
LOG->Trace( "ScreenGraphicOptions::ScreenGraphicOptions()" );
|
||||
|
||||
Init(
|
||||
Init(
|
||||
INPUTMODE_BOTH,
|
||||
g_GraphicOptionsLines,
|
||||
NUM_GRAPHIC_OPTIONS_LINES
|
||||
);
|
||||
NUM_GRAPHIC_OPTIONS_LINES,
|
||||
false );
|
||||
UpdateRefreshRates();
|
||||
m_Menu.StopTimer();
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ ScreenHowToPlay::ScreenHowToPlay()
|
||||
m_Menu.Load(
|
||||
THEME->GetPathTo("Graphics","How To Play Background"),
|
||||
THEME->GetPathTo("Graphics","How To Play Top Edge"),
|
||||
HELP_TEXT, true, TIMER_SECONDS
|
||||
HELP_TEXT, false, true, TIMER_SECONDS
|
||||
);
|
||||
m_Menu.TweenOnScreenFromMenu( SM_None );
|
||||
this->AddChild( &m_Menu );
|
||||
|
||||
@@ -47,7 +47,7 @@ ScreenOptions::ScreenOptions( CString sBackgroundPath, CString sPagePath, CStrin
|
||||
m_Menu.Load(
|
||||
sBackgroundPath,
|
||||
sTopEdgePath,
|
||||
HELP_TEXT, true, TIMER_SECONDS
|
||||
HELP_TEXT, false, true, TIMER_SECONDS
|
||||
);
|
||||
this->AddChild( &m_Menu );
|
||||
|
||||
@@ -77,7 +77,7 @@ ScreenOptions::ScreenOptions( CString sBackgroundPath, CString sPagePath, CStrin
|
||||
ZeroMemory(&m_OptionDim, sizeof(m_OptionDim));
|
||||
}
|
||||
|
||||
void ScreenOptions::Init( InputMode im, OptionLineData optionLineData[], int iNumOptionLines )
|
||||
void ScreenOptions::Init( InputMode im, OptionLineData optionLineData[], int iNumOptionLines, bool bUseIcons )
|
||||
{
|
||||
LOG->Trace( "ScreenOptions::Set()" );
|
||||
|
||||
@@ -85,6 +85,7 @@ void ScreenOptions::Init( InputMode im, OptionLineData optionLineData[], int iNu
|
||||
m_InputMode = im;
|
||||
m_OptionLineData = optionLineData;
|
||||
m_iNumOptionLines = iNumOptionLines;
|
||||
m_bUseIcons = bUseIcons;
|
||||
|
||||
|
||||
this->ImportOptions();
|
||||
@@ -105,7 +106,7 @@ void ScreenOptions::Init( InputMode im, OptionLineData optionLineData[], int iNu
|
||||
m_Underline[p][l].Load( (PlayerNumber)p, true );
|
||||
m_framePage.AddChild( &m_Underline[p][l] );
|
||||
|
||||
m_OptionIcons[p][l].Load( (PlayerNumber)p, "BLAH", false );
|
||||
m_OptionIcons[p][l].Load( (PlayerNumber)p, "", false );
|
||||
m_framePage.AddChild( &m_OptionIcons[p][l] );
|
||||
}
|
||||
|
||||
@@ -131,6 +132,7 @@ void ScreenOptions::Init( InputMode im, OptionLineData optionLineData[], int iNu
|
||||
InitOptionsText();
|
||||
PositionUnderlines();
|
||||
PositionIcons();
|
||||
RefreshIcons();
|
||||
PositionHighlights();
|
||||
}
|
||||
|
||||
@@ -165,7 +167,6 @@ void ScreenOptions::InitOptionsText()
|
||||
BitmapText &title = m_textOptionLineTitles[i];
|
||||
|
||||
title.LoadFromFont( THEME->GetPathTo("Fonts","Header2") );
|
||||
title.SetLineHeight( 20 );
|
||||
CString sText = optline.szTitle;
|
||||
sText.Replace( " ", "\n" );
|
||||
title.SetText( sText );
|
||||
@@ -260,6 +261,22 @@ void ScreenOptions::PositionIcons()
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenOptions::RefreshIcons()
|
||||
{
|
||||
// Set the position of the underscores showing the current choice for each option line.
|
||||
for( int p=0; p<NUM_PLAYERS; p++ ) // foreach player
|
||||
{
|
||||
for( int i=0; i<m_iNumOptionLines; i++ ) // foreach options line
|
||||
{
|
||||
OptionIcon &icon = m_OptionIcons[p][i];
|
||||
|
||||
int iSelection = m_iSelectedOption[p][i];
|
||||
CString sSelection = m_OptionLineData[i].szOptionsText[iSelection];
|
||||
icon.Load( (PlayerNumber)p, m_bUseIcons ? sSelection : "", false );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ScreenOptions::PositionHighlights()
|
||||
{
|
||||
@@ -338,6 +355,7 @@ void ScreenOptions::HandleScreenMessage( const ScreenMessage SM )
|
||||
void ScreenOptions::OnChange()
|
||||
{
|
||||
PositionUnderlines();
|
||||
RefreshIcons();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ class ScreenOptions : public Screen
|
||||
{
|
||||
public:
|
||||
ScreenOptions( CString sBackgroundPath, CString sPagePath, CString sTopEdgePath );
|
||||
void Init( InputMode im, OptionLineData optionLineData[], int iNumOptionLines );
|
||||
void Init( InputMode im, OptionLineData optionLineData[], int iNumOptionLines, bool bUseIcons );
|
||||
virtual ~ScreenOptions();
|
||||
virtual void Update( float fDeltaTime );
|
||||
virtual void DrawPrimitives();
|
||||
@@ -58,6 +58,7 @@ protected:
|
||||
void GetWidthXY( PlayerNumber p, int iRow, int &iWidthOut, int &iXOut, int &iYOut );
|
||||
void PositionUnderlines();
|
||||
void PositionIcons();
|
||||
void RefreshIcons();
|
||||
void PositionHighlights();
|
||||
void TweenHighlight( PlayerNumber player_no );
|
||||
virtual void OnChange();
|
||||
@@ -74,6 +75,7 @@ protected:
|
||||
void MenuDown( PlayerNumber p );
|
||||
|
||||
InputMode m_InputMode;
|
||||
bool m_bUseIcons;
|
||||
|
||||
OptionLineData* m_OptionLineData;
|
||||
int m_iNumOptionLines;
|
||||
|
||||
@@ -62,8 +62,8 @@ ScreenPlayerOptions::ScreenPlayerOptions() :
|
||||
Init(
|
||||
INPUTMODE_PLAYERS,
|
||||
g_PlayerOptionsLines,
|
||||
NUM_PLAYER_OPTIONS_LINES
|
||||
);
|
||||
NUM_PLAYER_OPTIONS_LINES,
|
||||
true );
|
||||
|
||||
SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo("player options intro") );
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ ScreenSelectCourse::ScreenSelectCourse()
|
||||
m_Menu.Load(
|
||||
THEME->GetPathTo("Graphics","select course background"),
|
||||
THEME->GetPathTo("Graphics","select course top edge"),
|
||||
HELP_TEXT, true, TIMER_SECONDS
|
||||
HELP_TEXT, true, true, TIMER_SECONDS
|
||||
);
|
||||
this->AddChild( &m_Menu );
|
||||
|
||||
@@ -79,12 +79,12 @@ ScreenSelectCourse::ScreenSelectCourse()
|
||||
m_sprBannerFrame.SetXY( BANNER_FRAME_X, BANNER_FRAME_Y );
|
||||
this->AddChild( &m_sprBannerFrame );
|
||||
|
||||
m_textNumStages.LoadFromFont( THEME->GetPathTo("Fonts","header1") );
|
||||
m_textNumStages.SetXY( STAGES_X, STAGES_Y );
|
||||
m_textNumStages.TurnShadowOff();
|
||||
this->AddChild( &m_textNumStages );
|
||||
m_textNumSongs.LoadFromFont( THEME->GetPathTo("Fonts","select course num songs") );
|
||||
m_textNumSongs.SetXY( STAGES_X, STAGES_Y );
|
||||
m_textNumSongs.TurnShadowOff();
|
||||
this->AddChild( &m_textNumSongs );
|
||||
|
||||
m_textTime.LoadFromFont( THEME->GetPathTo("Fonts","header1") );
|
||||
m_textTime.LoadFromFont( THEME->GetPathTo("Fonts","select course total time") );
|
||||
m_textTime.SetXY( TIME_X, TIME_Y );
|
||||
m_textTime.TurnShadowOff();
|
||||
this->AddChild( &m_textTime );
|
||||
@@ -151,7 +151,7 @@ void ScreenSelectCourse::DrawPrimitives()
|
||||
|
||||
void ScreenSelectCourse::TweenOnScreen()
|
||||
{
|
||||
Actor* pActorsInCourseInfoFrame[] = { &m_sprBannerFrame, &m_Banner, &m_textNumStages, &m_textTime };
|
||||
Actor* pActorsInCourseInfoFrame[] = { &m_sprBannerFrame, &m_Banner, &m_textNumSongs, &m_textTime };
|
||||
const int iNumActorsInGroupInfoFrame = sizeof(pActorsInCourseInfoFrame) / sizeof(Actor*);
|
||||
int i;
|
||||
for( i=0; i<iNumActorsInGroupInfoFrame; i++ )
|
||||
@@ -181,7 +181,7 @@ void ScreenSelectCourse::TweenOnScreen()
|
||||
|
||||
void ScreenSelectCourse::TweenOffScreen()
|
||||
{
|
||||
Actor* pActorsInCourseInfoFrame[] = { &m_sprBannerFrame, &m_Banner, &m_textNumStages, &m_textTime };
|
||||
Actor* pActorsInCourseInfoFrame[] = { &m_sprBannerFrame, &m_Banner, &m_textNumSongs, &m_textTime };
|
||||
const int iNumActorsInGroupInfoFrame = sizeof(pActorsInCourseInfoFrame) / sizeof(Actor*);
|
||||
int i;
|
||||
for( i=0; i<iNumActorsInGroupInfoFrame; i++ )
|
||||
@@ -348,7 +348,7 @@ void ScreenSelectCourse::AfterCourseChange()
|
||||
{
|
||||
Course* pCourse = m_MusicWheel.GetSelectedCourse();
|
||||
|
||||
m_textNumStages.SetText( ssprintf("%d", pCourse->m_iStages) );
|
||||
m_textNumSongs.SetText( ssprintf("%d", pCourse->m_iStages) );
|
||||
float fTotalSeconds = 0;
|
||||
for( int i=0; i<pCourse->m_iStages; i++ )
|
||||
fTotalSeconds += pCourse->m_apSongs[i]->m_fMusicLengthSeconds;
|
||||
|
||||
@@ -48,7 +48,7 @@ protected:
|
||||
|
||||
Sprite m_sprBannerFrame;
|
||||
FadingBanner m_Banner;
|
||||
BitmapText m_textNumStages;
|
||||
BitmapText m_textNumSongs;
|
||||
BitmapText m_textTime;
|
||||
CourseContentsFrame m_CourseContentsFrame;
|
||||
Sprite m_sprHighScoreFrame[NUM_PLAYERS];
|
||||
|
||||
@@ -91,7 +91,7 @@ ScreenSelectDifficulty::ScreenSelectDifficulty()
|
||||
m_Menu.Load(
|
||||
THEME->GetPathTo("Graphics","select difficulty background"),
|
||||
THEME->GetPathTo("Graphics","select difficulty top edge"),
|
||||
HELP_TEXT, true, TIMER_SECONDS
|
||||
HELP_TEXT, true, true, TIMER_SECONDS
|
||||
);
|
||||
this->AddChild( &m_Menu );
|
||||
|
||||
|
||||
@@ -69,8 +69,8 @@ ScreenSelectGame::ScreenSelectGame() :
|
||||
Init(
|
||||
INPUTMODE_BOTH,
|
||||
g_SelectGameLines,
|
||||
NUM_SELECT_GAME_LINES
|
||||
);
|
||||
NUM_SELECT_GAME_LINES,
|
||||
false );
|
||||
|
||||
MUSIC->LoadAndPlayIfNotAlready( THEME->GetPathTo("Sounds","select game music") );
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ ScreenSelectGroup::ScreenSelectGroup()
|
||||
m_Menu.Load(
|
||||
THEME->GetPathTo("Graphics","select group background") ,
|
||||
THEME->GetPathTo("Graphics","select group top edge"),
|
||||
HELP_TEXT, true, TIMER_SECONDS
|
||||
HELP_TEXT, true, true, TIMER_SECONDS
|
||||
);
|
||||
this->AddChild( &m_Menu );
|
||||
|
||||
@@ -141,7 +141,7 @@ ScreenSelectGroup::ScreenSelectGroup()
|
||||
m_sprFrame.SetXY( FRAME_X, FRAME_Y );
|
||||
this->AddChild( &m_sprFrame );
|
||||
|
||||
m_textNumber.LoadFromFont( THEME->GetPathTo("Fonts","header1") );
|
||||
m_textNumber.LoadFromFont( THEME->GetPathTo("Fonts","select group num songs") );
|
||||
m_textNumber.SetXY( NUMBER_X, NUMBER_Y );
|
||||
m_textNumber.SetHorizAlign( Actor::align_right );
|
||||
m_textNumber.TurnShadowOff();
|
||||
|
||||
@@ -89,7 +89,7 @@ ScreenSelectMusic::ScreenSelectMusic()
|
||||
m_Menu.Load(
|
||||
THEME->GetPathTo("Graphics","select music background"),
|
||||
THEME->GetPathTo("Graphics","select music top edge"),
|
||||
HELP_TEXT, true, TIMER_SECONDS
|
||||
HELP_TEXT, true, true, TIMER_SECONDS
|
||||
);
|
||||
this->AddChild( &m_Menu );
|
||||
|
||||
@@ -180,7 +180,6 @@ ScreenSelectMusic::ScreenSelectMusic()
|
||||
m_sprMeterFrame[p].SetState( p );
|
||||
this->AddChild( &m_sprMeterFrame[p] );
|
||||
|
||||
m_FootMeter[p].LoadFromFont( THEME->GetPathTo("Fonts","meter") );
|
||||
m_FootMeter[p].SetXY( METER_X(p), METER_Y(p) );
|
||||
m_FootMeter[p].SetShadowLength( 2 );
|
||||
this->AddChild( &m_FootMeter[p] );
|
||||
@@ -212,7 +211,7 @@ ScreenSelectMusic::ScreenSelectMusic()
|
||||
this->AddChild( &m_MusicSortDisplay );
|
||||
|
||||
|
||||
m_textHoldForOptions.LoadFromFont( THEME->GetPathTo("Fonts","stage") );
|
||||
m_textHoldForOptions.LoadFromFont( THEME->GetPathTo("Fonts","select music stage") );
|
||||
m_textHoldForOptions.SetXY( CENTER_X, CENTER_Y );
|
||||
m_textHoldForOptions.SetText( "press START again for options" );
|
||||
m_textHoldForOptions.SetZoom( 1 );
|
||||
@@ -272,7 +271,7 @@ void ScreenSelectMusic::TweenOnScreen()
|
||||
|
||||
m_textSongOptions.FadeOn( 0, "fade", TWEEN_TIME );
|
||||
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
m_OptionIconRow[p].FadeOn( 0, "foldy", TWEEN_TIME );
|
||||
// fOriginalZoomY = m_textPlayerOptions[p].GetZoomY();
|
||||
@@ -317,7 +316,7 @@ void ScreenSelectMusic::TweenOffScreen()
|
||||
|
||||
m_textSongOptions.FadeOff( 0, "fade", TWEEN_TIME );
|
||||
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
m_OptionIconRow[p].FadeOff( 0, "foldy", TWEEN_TIME );
|
||||
// m_textPlayerOptions[p].FadeOff( 0, "fade", TWEEN_TIME );
|
||||
|
||||
@@ -88,7 +88,7 @@ ScreenSelectStyle::ScreenSelectStyle()
|
||||
m_Menu.Load(
|
||||
THEME->GetPathTo("Graphics","select style background"),
|
||||
THEME->GetPathTo("Graphics","select style top edge"),
|
||||
HELP_TEXT, true, TIMER_SECONDS
|
||||
HELP_TEXT, false, true, TIMER_SECONDS
|
||||
);
|
||||
this->AddChild( &m_Menu );
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ ScreenSelectStyle5th::ScreenSelectStyle5th()
|
||||
m_Menu.Load(
|
||||
THEME->GetPathTo("Graphics","select style background"),
|
||||
THEME->GetPathTo("Graphics","select style top edge"),
|
||||
HELP_TEXT, true, TIMER_SECONDS
|
||||
HELP_TEXT, false, true, TIMER_SECONDS
|
||||
);
|
||||
this->AddChild( &m_Menu );
|
||||
|
||||
|
||||
@@ -50,8 +50,8 @@ ScreenSongOptions::ScreenSongOptions() :
|
||||
|
||||
Init( INPUTMODE_BOTH,
|
||||
g_SongOptionsLines,
|
||||
NUM_SONG_OPTIONS_LINES
|
||||
);
|
||||
NUM_SONG_OPTIONS_LINES,
|
||||
false );
|
||||
}
|
||||
|
||||
void ScreenSongOptions::ImportOptions()
|
||||
|
||||
@@ -47,6 +47,8 @@ const CString CHOICE_TEXT[ScreenTitleMenu::NUM_TITLE_MENU_CHOICES] = {
|
||||
#define SONGS_Y THEME->GetMetricF("ScreenTitleMenu","SongsY")
|
||||
#define COLOR_NOT_SELECTED THEME->GetMetricC("ScreenTitleMenu","ColorNotSelected")
|
||||
#define COLOR_SELECTED THEME->GetMetricC("ScreenTitleMenu","ColorSelected")
|
||||
#define ZOOM_NOT_SELECTED THEME->GetMetricF("ScreenTitleMenu","ZoomNotSelected")
|
||||
#define ZOOM_SELECTED THEME->GetMetricF("ScreenTitleMenu","ZoomSelected")
|
||||
#define SECONDS_BEFORE_DEMONSTRATION THEME->GetMetricF("ScreenTitleMenu","SecondsBeforeDemonstration")
|
||||
#define SECONDS_BETWEEN_ATTRACT THEME->GetMetricF("ScreenTitleMenu","SecondsBetweenAttract")
|
||||
#define HELP_TEXT THEME->GetMetric("ScreenTitleMenu","HelpText")
|
||||
@@ -138,7 +140,7 @@ ScreenTitleMenu::ScreenTitleMenu()
|
||||
|
||||
for( int i=0; i< NUM_TITLE_MENU_CHOICES; i++ )
|
||||
{
|
||||
m_textChoice[i].LoadFromFont( THEME->GetPathTo("Fonts","header1") );
|
||||
m_textChoice[i].LoadFromFont( THEME->GetPathTo("Fonts","titlemenu") );
|
||||
m_textChoice[i].SetText( CHOICE_TEXT[i] );
|
||||
m_textChoice[i].SetXY( CHOICES_X, CHOICES_START_Y + i*CHOICES_SPACING_Y );
|
||||
m_textChoice[i].SetShadowLength( 5 );
|
||||
@@ -161,6 +163,9 @@ ScreenTitleMenu::ScreenTitleMenu()
|
||||
|
||||
|
||||
m_TitleMenuChoice = CHOICE_GAME_START;
|
||||
|
||||
for( i=0; i<NUM_TITLE_MENU_CHOICES; i++ )
|
||||
LoseFocus( i );
|
||||
GainFocus( m_TitleMenuChoice );
|
||||
|
||||
MUSIC->LoadAndPlayIfNotAlready( THEME->GetPathTo("Sounds","title menu music") );
|
||||
@@ -294,20 +299,17 @@ void ScreenTitleMenu::HandleScreenMessage( const ScreenMessage SM )
|
||||
|
||||
void ScreenTitleMenu::LoseFocus( int iChoiceIndex )
|
||||
{
|
||||
m_soundChange.PlayRandom();
|
||||
|
||||
m_textChoice[iChoiceIndex].SetEffectNone();
|
||||
m_textChoice[iChoiceIndex].StopTweening();
|
||||
m_textChoice[iChoiceIndex].BeginTweening( 0.3f );
|
||||
m_textChoice[iChoiceIndex].SetTweenZoom( 0.9f );
|
||||
|
||||
m_textChoice[iChoiceIndex].SetTweenZoom( ZOOM_NOT_SELECTED );
|
||||
}
|
||||
|
||||
void ScreenTitleMenu::GainFocus( int iChoiceIndex )
|
||||
{
|
||||
m_textChoice[iChoiceIndex].StopTweening();
|
||||
m_textChoice[iChoiceIndex].BeginTweening( 0.3f );
|
||||
m_textChoice[iChoiceIndex].SetTweenZoom( 1.2f );
|
||||
m_textChoice[iChoiceIndex].SetTweenZoom( ZOOM_SELECTED );
|
||||
D3DXCOLOR color1, color2;
|
||||
color1 = COLOR_SELECTED;
|
||||
color2 = color1 * 0.5f;
|
||||
@@ -324,6 +326,8 @@ void ScreenTitleMenu::MenuUp( PlayerNumber p )
|
||||
|
||||
m_TitleMenuChoice = TitleMenuChoice( m_TitleMenuChoice-1 );
|
||||
|
||||
m_soundChange.PlayRandom();
|
||||
|
||||
GainFocus( m_TitleMenuChoice );
|
||||
}
|
||||
|
||||
@@ -337,6 +341,8 @@ void ScreenTitleMenu::MenuDown( PlayerNumber p )
|
||||
|
||||
m_TitleMenuChoice = TitleMenuChoice( m_TitleMenuChoice+1 );
|
||||
|
||||
m_soundChange.PlayRandom();
|
||||
|
||||
GainFocus( m_TitleMenuChoice );
|
||||
}
|
||||
|
||||
|
||||
@@ -29,22 +29,14 @@ const CString g_sStatisticsFileName = "statistics.ini";
|
||||
#define GROUP_COLOR( i ) THEME->GetMetricC("SongManager",ssprintf("GroupColor%d",i+1))
|
||||
#define EXTRA_COLOR THEME->GetMetricC("SongManager","ExtraColor")
|
||||
|
||||
const int NUM_GROUP_COLORS = 7;
|
||||
D3DXCOLOR GROUP_COLORS[NUM_GROUP_COLORS];
|
||||
|
||||
D3DXCOLOR g_GroupColors[30];
|
||||
D3DXCOLOR g_ExtraColor;
|
||||
|
||||
|
||||
SongManager::SongManager( void(*callback)() )
|
||||
{
|
||||
// Loading these theme metrics is slow, so only do it ever 20th time.
|
||||
GROUP_COLORS[0] = GROUP_COLOR_1;
|
||||
GROUP_COLORS[1] = GROUP_COLOR_2;
|
||||
GROUP_COLORS[2] = GROUP_COLOR_3;
|
||||
GROUP_COLORS[3] = GROUP_COLOR_4;
|
||||
GROUP_COLORS[4] = GROUP_COLOR_5;
|
||||
GROUP_COLORS[5] = GROUP_COLOR_6;
|
||||
GROUP_COLORS[6] = GROUP_COLOR_7;
|
||||
for( int i=0; i<NUM_GROUP_COLORS; i++ )
|
||||
g_GroupColors[i] = GROUP_COLOR( i );
|
||||
g_ExtraColor = EXTRA_COLOR;
|
||||
|
||||
InitSongArrayFromDisk( callback );
|
||||
@@ -55,8 +47,6 @@ SongManager::SongManager( void(*callback)() )
|
||||
|
||||
SongManager::~SongManager()
|
||||
{
|
||||
// BUG FIX: Stats will no longer save if you're in autoplay mode - Andy.
|
||||
// BUG BUG FIX: if user used autoplay, the evaluation screen already detects this...
|
||||
SaveStatisticsToDisk();
|
||||
FreeSongArray();
|
||||
}
|
||||
@@ -368,7 +358,7 @@ D3DXCOLOR SongManager::GetGroupColor( const CString &sGroupName )
|
||||
}
|
||||
ASSERT( i != m_arrayGroupNames.GetSize() ); // this is not a valid group
|
||||
|
||||
return GROUP_COLORS[i%NUM_GROUP_COLORS];
|
||||
return g_GroupColors[i%NUM_GROUP_COLORS];
|
||||
}
|
||||
|
||||
D3DXCOLOR SongManager::GetSongColor( Song* pSong )
|
||||
|
||||
+10
-10
@@ -59,7 +59,7 @@ IntDir=.\../Release
|
||||
TargetDir=\stepmania\stepmania
|
||||
TargetName=StepMania
|
||||
SOURCE="$(InputPath)"
|
||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
|
||||
# End Special Build Tool
|
||||
|
||||
@@ -95,7 +95,7 @@ IntDir=.\../Debug
|
||||
TargetDir=\stepmania\stepmania
|
||||
TargetName=StepMania-debug
|
||||
SOURCE="$(InputPath)"
|
||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
|
||||
# End Special Build Tool
|
||||
|
||||
@@ -732,6 +732,14 @@ SOURCE=.\OptionIcon.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\OptionIconRow.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\OptionIconRow.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\OptionsCursor.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -740,14 +748,6 @@ SOURCE=.\OptionsCursor.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\PlayerOptionIcons.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\PlayerOptionIcons.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ScrollBar.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -22,9 +22,9 @@ const float TEXT_BANNER_HEIGHT = 40;
|
||||
|
||||
TextBanner::TextBanner()
|
||||
{
|
||||
m_textTitle.LoadFromFont( THEME->GetPathTo("Fonts","text banner") );
|
||||
m_textSubTitle.LoadFromFont( THEME->GetPathTo("Fonts","text banner") );
|
||||
m_textArtist.LoadFromFont( THEME->GetPathTo("Fonts","text banner") );
|
||||
m_textTitle.LoadFromFont( THEME->GetPathTo("Fonts","musicwheel text banner") );
|
||||
m_textSubTitle.LoadFromFont( THEME->GetPathTo("Fonts","musicwheel text banner") );
|
||||
m_textArtist.LoadFromFont( THEME->GetPathTo("Fonts","musicwheel text banner") );
|
||||
|
||||
m_textTitle.SetX( -TEXT_BANNER_WIDTH/2 );
|
||||
m_textSubTitle.SetX( -TEXT_BANNER_WIDTH/2 );
|
||||
|
||||
@@ -147,7 +147,7 @@ try_element_again:
|
||||
"*.avi", "*.mpg", "*.mpeg", NULL
|
||||
};
|
||||
static const char *sound_masks[] = { ".set", ".mp3", ".ogg", ".wav", ".redir", NULL };
|
||||
static const char *font_masks[] = { ".font", ".redir", NULL };
|
||||
static const char *font_masks[] = { " 16x16.png", ".redir", NULL };
|
||||
const char **asset_masks = NULL;
|
||||
if( sAssetCategory == "graphics" ) asset_masks = graphic_masks;
|
||||
else if( sAssetCategory == "sounds" ) asset_masks = sound_masks;
|
||||
@@ -231,7 +231,10 @@ try_metric_again:
|
||||
|
||||
CString sValue;
|
||||
if( m_pIniMetrics->GetValue(sScreenName,sValueName,sValue) )
|
||||
{
|
||||
sValue.Replace("::","\n"); // "::" means newline since you can't use line breaks in an ini file.
|
||||
return sValue;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
if( IDRETRY == AfxMessageBox( ssprintf("The theme metric %s-%s is missing. Correct this and click Retry, or Cancel to break.",sScreenName,sValueName), MB_RETRYCANCEL ) )
|
||||
|
||||
Reference in New Issue
Block a user