option icons working, new font format, more theme metrics cleanup
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
------------------------CVS after 3.00 beta 6----------------
|
------------------------CVS after 3.00 beta 6----------------
|
||||||
|
CHANGE: Font format is not simpler. See README for details.
|
||||||
|
NEW FEATURE: Option Icons.
|
||||||
NEW FEATURE: Best sort now shows only top 30 songs.
|
NEW FEATURE: Best sort now shows only top 30 songs.
|
||||||
NEW FEATURE: Option codes on the Select Music and Select Course screens
|
NEW FEATURE: Option codes on the Select Music and Select Course screens
|
||||||
Codes are defined in the metrics.ini file and thus can be edited and
|
Codes are defined in the metrics.ini file and thus can be edited and
|
||||||
|
|||||||
@@ -13,6 +13,9 @@
|
|||||||
[Common]
|
[Common]
|
||||||
ColorP1=0.4,1.0,0.8,1 // sea green
|
ColorP1=0.4,1.0,0.8,1 // sea green
|
||||||
ColorP2=1.0,0.5,0.2,1 // orange
|
ColorP2=1.0,0.5,0.2,1 // orange
|
||||||
|
ColorEasy=0.9,0.9,0,1 // yellow
|
||||||
|
ColorMedium=1,0.2,0.2,1 // light red
|
||||||
|
ColorHard=0.2,1,0.2,1 // light green
|
||||||
|
|
||||||
[ScreenTitleMenu]
|
[ScreenTitleMenu]
|
||||||
ChoicesX=320
|
ChoicesX=320
|
||||||
@@ -28,6 +31,8 @@ SongsX=20
|
|||||||
SongsY=20
|
SongsY=20
|
||||||
ColorNotSelected=1,1,1,1
|
ColorNotSelected=1,1,1,1
|
||||||
ColorSelected=0.5,1,0.5,1
|
ColorSelected=0.5,1,0.5,1
|
||||||
|
ZoomNotSelected=1.0
|
||||||
|
ZoomSelected=1.3
|
||||||
SecondsBeforeDemonstration=30
|
SecondsBeforeDemonstration=30
|
||||||
SecondsBetweenAttract=12
|
SecondsBetweenAttract=12
|
||||||
HelpText=Use # $ to select, then press START
|
HelpText=Use # $ to select, then press START
|
||||||
@@ -131,8 +136,9 @@ ContentsX=320
|
|||||||
ContentsY=260
|
ContentsY=260
|
||||||
TitlesStartX=20
|
TitlesStartX=20
|
||||||
TitlesStartY=276
|
TitlesStartY=276
|
||||||
TitlesSpacingX=200
|
TitlesWidth=146
|
||||||
TitlesColumns=3
|
TitlesSpacingX=150
|
||||||
|
TitlesColumns=4
|
||||||
TitlesRows=10
|
TitlesRows=10
|
||||||
HelpText=Use ! " to select, then press START
|
HelpText=Use ! " to select, then press START
|
||||||
TimerSeconds=40
|
TimerSeconds=40
|
||||||
@@ -141,7 +147,7 @@ NextScreen=ScreenHowToPlay
|
|||||||
[ScreenHowToPlay]
|
[ScreenHowToPlay]
|
||||||
NextScreenArcade=ScreenSelectMusic
|
NextScreenArcade=ScreenSelectMusic
|
||||||
NextScreenOni=ScreenSelectCourse
|
NextScreenOni=ScreenSelectCourse
|
||||||
HelpText=
|
HelpText=Press START to continue
|
||||||
TimerSeconds=15
|
TimerSeconds=15
|
||||||
|
|
||||||
[ScreenSelectMusic]
|
[ScreenSelectMusic]
|
||||||
@@ -347,6 +353,12 @@ SpinGrades=1
|
|||||||
GradesGlowColor1=1,1,1,0.2
|
GradesGlowColor1=1,1,1,0.2
|
||||||
GradesGlowColor2=1,1,1,0.8
|
GradesGlowColor2=1,1,1,0.8
|
||||||
|
|
||||||
|
[ScreenEditMenu]
|
||||||
|
ExplanationX=320
|
||||||
|
ExplanationY=410
|
||||||
|
ExplanationText=In this mode, you can edit existing notes patterns,::create note patterns, or synchronize notes with the music.
|
||||||
|
HelpText=# $ change line ! " change value START to continue
|
||||||
|
|
||||||
[ScreenManager]
|
[ScreenManager]
|
||||||
StatsX=632
|
StatsX=632
|
||||||
StatsY=10
|
StatsY=10
|
||||||
@@ -555,6 +567,7 @@ TextHAlign=1 // 0,1,2 = left,center,right
|
|||||||
TextVAlign=1 // 0,1,2 = top,middle,bottom
|
TextVAlign=1 // 0,1,2 = top,middle,bottom
|
||||||
TextWidth=128
|
TextWidth=128
|
||||||
TextZoom=0.25
|
TextZoom=0.25
|
||||||
|
Uppercase=1
|
||||||
|
|
||||||
[OptionIconRow]
|
[OptionIconRow]
|
||||||
SpacingX=38
|
SpacingX=38
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ BPMDisplay::BPMDisplay()
|
|||||||
m_rectFrame.SetZoomX( 120 );
|
m_rectFrame.SetZoomX( 120 );
|
||||||
m_rectFrame.SetZoomY( 40 );
|
m_rectFrame.SetZoomY( 40 );
|
||||||
|
|
||||||
m_textBPM.LoadFromFont( THEME->GetPathTo("Fonts","header1") );
|
m_textBPM.LoadFromFont( THEME->GetPathTo("Fonts","bpmdisplay") );
|
||||||
m_textBPM.TurnShadowOff();
|
m_textBPM.TurnShadowOff();
|
||||||
m_textBPM.SetXY( CENTER_X, SCREEN_HEIGHT - 50 );
|
m_textBPM.SetXY( CENTER_X, SCREEN_HEIGHT - 50 );
|
||||||
//m_textBPM.SetSequence( ssprintf("999") );
|
//m_textBPM.SetSequence( ssprintf("999") );
|
||||||
@@ -44,7 +44,7 @@ BPMDisplay::BPMDisplay()
|
|||||||
m_textBPM.SetDiffuseTopEdge( NORMAL_COLOR_TOP ); // yellow
|
m_textBPM.SetDiffuseTopEdge( NORMAL_COLOR_TOP ); // yellow
|
||||||
m_textBPM.SetDiffuseBottomEdge( NORMAL_COLOR_BOTTOM ); // orange
|
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.TurnShadowOff();
|
||||||
m_textLabel.SetXY( 34, 2 );
|
m_textLabel.SetXY( 34, 2 );
|
||||||
m_textLabel.SetText( "BPM" );
|
m_textLabel.SetText( "BPM" );
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ BitmapText::BitmapText()
|
|||||||
BitmapText::~BitmapText()
|
BitmapText::~BitmapText()
|
||||||
{
|
{
|
||||||
if( m_pFont )
|
if( m_pFont )
|
||||||
FONT->UnloadFont( m_pFont->m_sFontFilePath );
|
FONT->UnloadFont( m_pFont->m_sTexturePath );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BitmapText::LoadFromFont( CString sFontFilePath )
|
bool BitmapText::LoadFromFont( CString sFontFilePath )
|
||||||
@@ -78,9 +78,18 @@ bool BitmapText::LoadFromFont( CString sFontFilePath )
|
|||||||
LOG->Trace( "BitmapText::LoadFromFontName(%s)", sFontFilePath );
|
LOG->Trace( "BitmapText::LoadFromFontName(%s)", sFontFilePath );
|
||||||
|
|
||||||
// load font
|
// 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;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -184,14 +193,15 @@ void BitmapText::DrawPrimitives()
|
|||||||
|
|
||||||
|
|
||||||
const int iHeight = pTexture->GetSourceFrameHeight(); // height of a character
|
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
|
const int iFrameWidth = pTexture->GetSourceFrameWidth(); // width of a character frame in logical units
|
||||||
|
|
||||||
int iY; // the center position of the first row of characters
|
int iY; // the center position of the first row of characters
|
||||||
switch( m_VertAlign )
|
switch( m_VertAlign )
|
||||||
{
|
{
|
||||||
case align_bottom: iY = -(m_iNumLines) * m_iLineHeight + m_iLineHeight/2; break;
|
case align_bottom: iY = -(m_iNumLines) * iLineSpacing + iLineSpacing/2; break;
|
||||||
case align_middle: iY = -(m_iNumLines-1) * m_iLineHeight/2; break;
|
case align_middle: iY = -(m_iNumLines-1) * iLineSpacing/2; break;
|
||||||
case align_top: iY = + m_iLineHeight/2; break;
|
case align_top: iY = + iLineSpacing/2; break;
|
||||||
default: ASSERT( false );
|
default: ASSERT( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,21 +229,18 @@ void BitmapText::DrawPrimitives()
|
|||||||
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_sFontFilePath, c );
|
||||||
const int iCharWidth = m_pFont->m_iFrameNoToWidth[iFrameNo];
|
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
|
// 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.
|
// 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
|
// set vertex positions
|
||||||
//
|
//
|
||||||
const float fExtraPixels = fPercentExtra * pTexture->GetSourceFrameWidth();
|
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, iY-iHeight/2.0f, 0 ); // top left
|
v[iNumV++].p = D3DXVECTOR3( (float)iX-iDrawExtraPixelsLeft, iY+iHeight/2.0f, 0 ); // bottom left
|
||||||
v[iNumV++].p = D3DXVECTOR3( iX+iCharWidth+fExtraPixels, iY-iHeight/2.0f, 0 ); // top right
|
v[iNumV++].p = D3DXVECTOR3( (float)iX-iDrawExtraPixelsLeft+iCharWidth+iDrawExtraPixelsRight, iY+iHeight/2.0f, 0 ); // bottom 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
|
|
||||||
|
|
||||||
iX += iCharWidth;
|
iX += iCharWidth;
|
||||||
|
|
||||||
@@ -251,15 +258,16 @@ void BitmapText::DrawPrimitives()
|
|||||||
frectTexCoords.left += fTexCoordsToChopOff/2;
|
frectTexCoords.left += fTexCoordsToChopOff/2;
|
||||||
frectTexCoords.right -= 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.left - fExtraTexCoordsLeft, frectTexCoords.top ); // top left
|
||||||
v[iNumV++].t = D3DXVECTOR2( frectTexCoords.right + fExtraTexCoords, frectTexCoords.top ); // top right
|
v[iNumV++].t = D3DXVECTOR2( frectTexCoords.right + fExtraTexCoordsRight, frectTexCoords.top ); // top right
|
||||||
v[iNumV++].t = D3DXVECTOR2( frectTexCoords.left, frectTexCoords.bottom ); // bottom left
|
v[iNumV++].t = D3DXVECTOR2( frectTexCoords.left - fExtraTexCoordsLeft, frectTexCoords.bottom ); // bottom left
|
||||||
v[iNumV++].t = D3DXVECTOR2( frectTexCoords.right + fExtraTexCoords, frectTexCoords.bottom ); // bottom right
|
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; };
|
int GetWidestLineWidthInSourcePixels() { return m_iWidestLineWidth; };
|
||||||
void CropToWidth( int iWidthInSourcePixels );
|
void CropToWidth( int iWidthInSourcePixels );
|
||||||
void SetLineHeight( int iLineHeight ) { m_iLineHeight = iLineHeight; };
|
|
||||||
|
|
||||||
virtual void DrawPrimitives();
|
virtual void DrawPrimitives();
|
||||||
|
|
||||||
@@ -51,7 +50,6 @@ protected:
|
|||||||
int m_iNumLines;
|
int m_iNumLines;
|
||||||
int m_iLineWidths[MAX_TEXT_LINES]; // in source pixels
|
int m_iLineWidths[MAX_TEXT_LINES]; // in source pixels
|
||||||
int m_iWidestLineWidth; // in source pixels
|
int m_iWidestLineWidth; // in source pixels
|
||||||
int m_iLineHeight;
|
|
||||||
|
|
||||||
bool m_bRainbow;
|
bool m_bRainbow;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -29,13 +29,13 @@ Combo::Combo()
|
|||||||
{
|
{
|
||||||
Reset();
|
Reset();
|
||||||
|
|
||||||
m_sprCombo.Load( THEME->GetPathTo("Graphics", "gameplay combo") );
|
m_sprCombo.Load( THEME->GetPathTo("Graphics", "gameplay combo label") );
|
||||||
m_sprCombo.TurnShadowOn();
|
m_sprCombo.TurnShadowOn();
|
||||||
m_sprCombo.StopAnimating();
|
m_sprCombo.StopAnimating();
|
||||||
m_sprCombo.SetX( 40 );
|
m_sprCombo.SetX( 40 );
|
||||||
m_sprCombo.SetZoom( 1.0f );
|
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.TurnShadowOn();
|
||||||
m_textComboNumber.SetHorizAlign( Actor::align_right );
|
m_textComboNumber.SetHorizAlign( Actor::align_right );
|
||||||
m_textComboNumber.SetX( 0 );
|
m_textComboNumber.SetX( 0 );
|
||||||
|
|||||||
+47
-113
@@ -21,131 +21,68 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
Font::Font( const CString &sFontFilePath )
|
Font::Font( const CString &sASCIITexturePath )
|
||||||
{
|
{
|
||||||
//LOG->Trace( "Font::LoadFromFontName(%s)", sFontFilePath );
|
//LOG->Trace( "Font::LoadFromFontName(%s)", sASCIITexturePath );
|
||||||
for( int i=0; i<MAX_FONT_CHARS; i++ )
|
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for( i=0; i<MAX_FONT_CHARS; i++ )
|
||||||
{
|
{
|
||||||
m_iCharToFrameNo[i] = -1;
|
m_iCharToFrameNo[i] = -1;
|
||||||
m_iFrameNoToWidth[i] = -1;
|
m_iFrameNoToWidth[i] = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_bCapitalsOnly = false;
|
|
||||||
m_fDrawExtraPercent = 0;
|
|
||||||
|
|
||||||
|
|
||||||
m_iRefCount = 1;
|
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
|
// load texture
|
||||||
//
|
m_sTexturePath = sASCIITexturePath;
|
||||||
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.MakeLower();
|
m_sTexturePath.MakeLower();
|
||||||
|
|
||||||
|
|
||||||
m_pTexture = TEXTUREMAN->LoadTexture( m_sTexturePath );
|
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 .ini widths path from texture path
|
||||||
// find out what characters are in this font
|
CString sDir, sFileName, sExtension;
|
||||||
//
|
splitrelpath( sASCIITexturePath, sDir, sFileName, sExtension );
|
||||||
CString sCharacters;
|
const CString sIniPath = sDir + sFileName + ".ini";
|
||||||
if( ini.GetValue("Font", "Characters", sCharacters) ) // the creator supplied characters
|
IniFile ini;
|
||||||
{
|
ini.SetPath( sIniPath );
|
||||||
// sanity check
|
ini.ReadFile();
|
||||||
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() );
|
|
||||||
|
|
||||||
// set the char to frame number map
|
// load character widths
|
||||||
for( int i=0; i<sCharacters.GetLength(); i++ )
|
for( i=0; i<256; i++ )
|
||||||
{
|
if( !ini.GetValueI( "Char Widths", ssprintf("%d",i), m_iFrameNoToWidth[i] ) )
|
||||||
char c = sCharacters[i];
|
throw RageException( "Error reading 'Char Widths from '%s'.", sIniPath );
|
||||||
int iFrameNo = i;
|
|
||||||
|
|
||||||
m_iCharToFrameNo[c] = iFrameNo;
|
m_bCapitalsOnly = false;
|
||||||
}
|
ini.GetValueB( "Char Widths", "CapitalsOnly", m_bCapitalsOnly );
|
||||||
}
|
|
||||||
else // the font file creator did not supply characters. Assume this is a full low ASCII set.
|
m_iDrawExtraPixelsLeft = 0;
|
||||||
{
|
ini.GetValueI( "Char Widths", "DrawExtraPixelsLeft", m_iDrawExtraPixelsLeft );
|
||||||
switch( m_pTexture->GetNumFrames() )
|
|
||||||
{
|
m_iDrawExtraPixelsRight = 0;
|
||||||
case 256: // ASCII 0-255
|
ini.GetValueI( "Char Widths", "DrawExtraPixelsRight", m_iDrawExtraPixelsRight );
|
||||||
|
|
||||||
|
int iAddToAllWidths = 0;
|
||||||
|
if( ini.GetValueI( "Char Widths", "AddToAllWidths", iAddToAllWidths ) )
|
||||||
{
|
{
|
||||||
for( int i=0; i<256; i++ )
|
for( int i=0; i<256; i++ )
|
||||||
m_iCharToFrameNo[i] = i;
|
m_iFrameNoToWidth[i] += iAddToAllWidths;
|
||||||
}
|
|
||||||
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 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
m_iLineSpacing = m_pTexture->GetSourceFrameHeight();
|
||||||
|
ini.GetValueI( "Char Widths", "LineHeight", m_iLineSpacing );
|
||||||
|
|
||||||
ini.GetValueB( "Font", "CapitalsOnly", m_bCapitalsOnly );
|
// force widths to even number
|
||||||
ini.GetValueF( "Font", "DrawExtraPercent", m_fDrawExtraPercent );
|
for( i=0; i<256; i++ )
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
// load character widths
|
|
||||||
//
|
|
||||||
CString sWidthsValue;
|
|
||||||
if( ini.GetValue("Font", "Widths", sWidthsValue) ) // the creator supplied widths
|
|
||||||
{
|
|
||||||
CStringArray asCharWidths;
|
|
||||||
asCharWidths.SetSize( 0, 256 );
|
|
||||||
split( sWidthsValue, ",", asCharWidths );
|
|
||||||
|
|
||||||
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() );
|
|
||||||
|
|
||||||
for( int i=0; i<asCharWidths.GetSize(); i++ )
|
|
||||||
{
|
|
||||||
m_iFrameNoToWidth[i] = atoi( asCharWidths[i] );
|
|
||||||
if( m_iFrameNoToWidth[i]%2 == 1 )
|
if( m_iFrameNoToWidth[i]%2 == 1 )
|
||||||
m_iFrameNoToWidth[i]++;
|
m_iFrameNoToWidth[i]++;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else // The font file creator didn't supply widths. Assume each character is the width of the frame.
|
|
||||||
{
|
|
||||||
for( int i=0; i<(int)m_pTexture->GetNumFrames(); i++ )
|
|
||||||
{
|
|
||||||
m_iFrameNoToWidth[i] = m_pTexture->GetSourceFrameWidth();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Font::Font( const CString &sTexturePath, const CString& sCharacters )
|
Font::Font( const CString &sTexturePath, const CString& sCharacters )
|
||||||
@@ -159,23 +96,21 @@ Font::Font( const CString &sTexturePath, const CString& sCharacters )
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_bCapitalsOnly = false;
|
m_bCapitalsOnly = false;
|
||||||
m_fDrawExtraPercent = 0;
|
m_iDrawExtraPixelsLeft = 0;
|
||||||
|
m_iDrawExtraPixelsRight = 0;
|
||||||
|
|
||||||
m_iRefCount = 1;
|
m_iRefCount = 1;
|
||||||
|
|
||||||
m_sFontFilePath = sTexturePath; // save
|
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// load texture
|
// load texture
|
||||||
//
|
//
|
||||||
m_sTexturePath = sTexturePath; // save the path of the new texture
|
m_sTexturePath = sTexturePath; // save
|
||||||
m_sTexturePath.MakeLower();
|
m_sTexturePath.MakeLower();
|
||||||
|
|
||||||
|
|
||||||
m_pTexture = TEXTUREMAN->LoadTexture( m_sTexturePath );
|
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
|
// sanity check
|
||||||
if( sCharacters.GetLength() != m_pTexture->GetNumFrames() )
|
if( sCharacters.GetLength() != m_pTexture->GetNumFrames() )
|
||||||
throw RageException( "The characters in '%s' does not match the number of frames in the texture."
|
throw RageException( "The image '%s' doesn't have the correct number of frames. It has %d frames but should have %d frames.",
|
||||||
"The font has %d frames, and the texture has %d frames.",
|
m_sTexturePath, m_pTexture->GetNumFrames(), sCharacters.GetLength() );
|
||||||
m_sFontFilePath, sCharacters.GetLength(), m_pTexture->GetNumFrames() );
|
|
||||||
|
|
||||||
// set the char to frame number map
|
// set the char to frame number map
|
||||||
for( i=0; i<sCharacters.GetLength(); i++ )
|
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 char c = szLine[i];
|
||||||
const int iFrameNo = m_iCharToFrameNo[c];
|
const int iFrameNo = m_iCharToFrameNo[c];
|
||||||
if( iFrameNo == -1 ) // this font doesn't impelemnt this character
|
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];
|
iLineWidth += m_iFrameNoToWidth[iFrameNo];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class Font
|
|||||||
protected:
|
protected:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Font( const CString &sFontPath );
|
Font( const CString &sASCIITexturePath );
|
||||||
Font( const CString &sTexturePath, const CString& sChars );
|
Font( const CString &sTexturePath, const CString& sChars );
|
||||||
~Font();
|
~Font();
|
||||||
|
|
||||||
@@ -28,12 +28,12 @@ public:
|
|||||||
|
|
||||||
int m_iRefCount;
|
int m_iRefCount;
|
||||||
|
|
||||||
CString m_sFontFilePath;
|
|
||||||
CString m_sTexturePath;
|
CString m_sTexturePath;
|
||||||
|
|
||||||
RageTexture* m_pTexture;
|
RageTexture* m_pTexture;
|
||||||
bool m_bCapitalsOnly;
|
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_iCharToFrameNo[MAX_FONT_CHARS];
|
||||||
int m_iFrameNoToWidth[MAX_FONT_CHARS]; // in soure coordinate space
|
int m_iFrameNoToWidth[MAX_FONT_CHARS]; // in soure coordinate space
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public:
|
|||||||
FontManager();
|
FontManager();
|
||||||
~FontManager();
|
~FontManager();
|
||||||
|
|
||||||
Font* LoadFont( CString sFontOrTextureFilePath, CString sChars );
|
Font* LoadFont( CString sFontOrTextureFilePath, CString sChars = "" );
|
||||||
bool IsFontLoaded( CString sFontPath );
|
bool IsFontLoaded( CString sFontPath );
|
||||||
void UnloadFont( CString sFontPath );
|
void UnloadFont( CString sFontPath );
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
FootMeter::FootMeter()
|
FootMeter::FootMeter()
|
||||||
{
|
{
|
||||||
LoadFromFont( THEME->GetPathTo("Fonts","meter") );
|
BitmapText::LoadFromTextureAndChars( THEME->GetPathTo("Graphics","select music meter 2x1"), "10" );
|
||||||
|
|
||||||
SetFromNotes( NULL );
|
SetFromNotes( NULL );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,15 +16,18 @@
|
|||||||
|
|
||||||
#define COLOR_P1 THEME->GetMetricC("Common","ColorP1")
|
#define COLOR_P1 THEME->GetMetricC("Common","ColorP1")
|
||||||
#define COLOR_P2 THEME->GetMetricC("Common","ColorP2")
|
#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 )
|
D3DXCOLOR DifficultyClassToColor( DifficultyClass dc )
|
||||||
{
|
{
|
||||||
switch( dc )
|
switch( dc )
|
||||||
{
|
{
|
||||||
case CLASS_EASY: return D3DXCOLOR(1,1,0,1); // yellow
|
case CLASS_EASY: return COLOR_EASY;
|
||||||
case CLASS_MEDIUM: return D3DXCOLOR(1,0,0,1); // red
|
case CLASS_MEDIUM: return COLOR_MEDIUM;
|
||||||
case CLASS_HARD: return D3DXCOLOR(0,1,0,1); // green
|
case CLASS_HARD: return COLOR_HARD;
|
||||||
default: ASSERT(0); return D3DXCOLOR(); // invalid DifficultyClass
|
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++ )
|
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].SetXY( BUTTON_X, BUTTON_START_Y + i*BUTTON_SPACING_Y );
|
||||||
m_screenLabels[i].SetZoom( 0.8f );
|
m_screenLabels[i].SetZoom( 0.8f );
|
||||||
m_screenLabels[i].SetShadowLength( 2 );
|
m_screenLabels[i].SetShadowLength( 2 );
|
||||||
|
|||||||
@@ -53,14 +53,14 @@ void LifeMeterBattery::Load( PlayerNumber pn )
|
|||||||
if( bPlayerEnabled )
|
if( bPlayerEnabled )
|
||||||
this->AddChild( &m_sprBattery );
|
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.SetDiffuse( D3DXCOLOR(1,1,1,1) ); // pink
|
||||||
m_textNumLives.SetZoom( 1.1f );
|
m_textNumLives.SetZoom( 1.1f );
|
||||||
m_textNumLives.TurnShadowOff();
|
m_textNumLives.TurnShadowOff();
|
||||||
if( bPlayerEnabled )
|
if( bPlayerEnabled )
|
||||||
this->AddChild( &m_textNumLives );
|
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.TurnShadowOff();
|
||||||
m_textPercent.SetZoom( 0.7f );
|
m_textPercent.SetZoom( 0.7f );
|
||||||
m_textPercent.SetText( "00.0" );
|
m_textPercent.SetText( "00.0" );
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ MenuElements::MenuElements()
|
|||||||
this->AddChild( &m_Invisible );
|
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()" );
|
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.Load( THEME->GetPathTo("Graphics",ssprintf("menu style icons game %d",GAMESTATE->m_CurGame)) );
|
||||||
m_sprStyleIcon.StopAnimating();
|
m_sprStyleIcon.StopAnimating();
|
||||||
m_sprStyleIcon.SetXY( STYLE_ICON_X, STYLE_ICON_Y );
|
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) );
|
m_sprStyleIcon.SetDiffuse( D3DXCOLOR(1,1,1,0) );
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -91,7 +91,7 @@ void MenuElements::Load( CString sBackgroundPath, CString sTopEdgePath, CString
|
|||||||
|
|
||||||
m_textHelp.SetXY( HELP_X, HELP_Y );
|
m_textHelp.SetXY( HELP_X, HELP_Y );
|
||||||
CStringArray asHelpTips;
|
CStringArray asHelpTips;
|
||||||
split( sHelpText, "::", asHelpTips );
|
split( sHelpText, "\n", asHelpTips );
|
||||||
m_textHelp.SetTips( asHelpTips );
|
m_textHelp.SetTips( asHelpTips );
|
||||||
m_textHelp.SetZoom( 0.5f );
|
m_textHelp.SetZoom( 0.5f );
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public:
|
|||||||
|
|
||||||
virtual void DrawPrimitives();
|
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 SetTimer( int iTimerSeconds );
|
||||||
void StartTimer();
|
void StartTimer();
|
||||||
void StallTimer();
|
void StallTimer();
|
||||||
|
|||||||
@@ -25,12 +25,12 @@ MenuTimer::MenuTimer()
|
|||||||
m_fStallSeconds = 0;
|
m_fStallSeconds = 0;
|
||||||
m_bTimerStopped = false;
|
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.TurnShadowOff();
|
||||||
m_textDigit1.SetXY( -18, 0 );
|
m_textDigit1.SetXY( -18, 0 );
|
||||||
this->AddChild( &m_textDigit1 );
|
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.TurnShadowOff();
|
||||||
m_textDigit2.SetXY( +18, 0 );
|
m_textDigit2.SetXY( +18, 0 );
|
||||||
this->AddChild( &m_textDigit2 );
|
this->AddChild( &m_textDigit2 );
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
* can add a setting that changes which metric group we pull
|
* can add a setting that changes which metric group we pull
|
||||||
* settings out of, so it can be configured separately. */
|
* settings out of, so it can be configured separately. */
|
||||||
#define TITLES_START_X THEME->GetMetricF("ScreenSelectGroup","TitlesStartX")
|
#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_SPACING_X THEME->GetMetricF("ScreenSelectGroup","TitlesSpacingX")
|
||||||
#define TITLES_START_Y THEME->GetMetricF("ScreenSelectGroup","TitlesStartY")
|
#define TITLES_START_Y THEME->GetMetricF("ScreenSelectGroup","TitlesStartY")
|
||||||
#define TITLES_COLUMNS THEME->GetMetricI("ScreenSelectGroup","TitlesColumns")
|
#define TITLES_COLUMNS THEME->GetMetricI("ScreenSelectGroup","TitlesColumns")
|
||||||
@@ -17,7 +18,7 @@ MusicList::MusicList()
|
|||||||
|
|
||||||
for( int i=0; i<TITLES_COLUMNS; i++ )
|
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].SetXY( TITLES_START_X + i*TITLES_SPACING_X, TITLES_START_Y );
|
||||||
m_textTitles[i].SetHorizAlign( Actor::align_left );
|
m_textTitles[i].SetHorizAlign( Actor::align_left );
|
||||||
m_textTitles[i].SetVertAlign( Actor::align_top );
|
m_textTitles[i].SetVertAlign( Actor::align_top );
|
||||||
@@ -76,7 +77,7 @@ void MusicList::SetGroupNo(int group)
|
|||||||
for( int c=0; c<TITLES_COLUMNS; c++ )
|
for( int c=0; c<TITLES_COLUMNS; c++ )
|
||||||
{
|
{
|
||||||
m_textTitles[c].SetText( m_ContentsText[CurGroup].ContentsText[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.Load( THEME->GetPathTo("Graphics","select music section bar") );
|
||||||
m_sprSectionBar.SetXY( 0, 0 );
|
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.TurnShadowOff();
|
||||||
m_textSectionName.SetVertAlign( align_middle );
|
m_textSectionName.SetVertAlign( align_middle );
|
||||||
m_textSectionName.SetXY( SECTION_NAME_X, 0 );
|
m_textSectionName.SetXY( SECTION_NAME_X, 0 );
|
||||||
m_textSectionName.SetZoom( SECTION_ZOOM );
|
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.TurnShadowOff();
|
||||||
m_textRoulette.SetText( "ROULETTE" );
|
m_textRoulette.SetText( "ROULETTE" );
|
||||||
m_textRoulette.TurnRainbowOn();
|
m_textRoulette.TurnRainbowOn();
|
||||||
@@ -102,7 +102,7 @@ WheelItemDisplay::WheelItemDisplay()
|
|||||||
m_GradeDisplay[p].SetXY( GRADE_X(p), 0 );
|
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.TurnShadowOff();
|
||||||
m_textCourse.SetZoom( COURSE_ZOOM );
|
m_textCourse.SetZoom( COURSE_ZOOM );
|
||||||
m_textCourse.SetHorizAlign( align_left );
|
m_textCourse.SetHorizAlign( align_left );
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#define TEXT_V_ALIGN THEME->GetMetricI("OptionIcon","TextVAlign")
|
#define TEXT_V_ALIGN THEME->GetMetricI("OptionIcon","TextVAlign")
|
||||||
#define TEXT_WIDTH THEME->GetMetricI("OptionIcon","TextWidth")
|
#define TEXT_WIDTH THEME->GetMetricI("OptionIcon","TextWidth")
|
||||||
#define TEXT_ZOOM THEME->GetMetricF("OptionIcon","TextZoom")
|
#define TEXT_ZOOM THEME->GetMetricF("OptionIcon","TextZoom")
|
||||||
|
#define UPPERCASE THEME->GetMetricB("OptionIcon","Uppercase")
|
||||||
|
|
||||||
|
|
||||||
OptionIcon::OptionIcon()
|
OptionIcon::OptionIcon()
|
||||||
@@ -39,6 +40,16 @@ OptionIcon::OptionIcon()
|
|||||||
|
|
||||||
void OptionIcon::Load( PlayerNumber pn, CString sText, bool bHeader )
|
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=="");
|
bool bVacant = (sText=="");
|
||||||
m_spr.SetState( pn*3 + (bHeader?0:(bVacant?1:2)) );
|
m_spr.SetState( pn*3 + (bHeader?0:(bVacant?1:2)) );
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#include "OptionIconRow.h"
|
#include "OptionIconRow.h"
|
||||||
#include "ThemeManager.h"
|
#include "ThemeManager.h"
|
||||||
#include "PlayerOptions.h"
|
#include "PlayerOptions.h"
|
||||||
|
#include "GameState.h"
|
||||||
|
|
||||||
|
|
||||||
#define SPACING_X THEME->GetMetricF("OptionIconRow","SpacingX")
|
#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 )
|
void OptionIconRow::Refresh( PlayerNumber pn )
|
||||||
{
|
{
|
||||||
|
// init
|
||||||
for( int i=0; i<NUM_OPTION_COLS; i++ )
|
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()
|
void OptionIconRow::DrawPrimitives()
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ CString PlayerOptions::GetString()
|
|||||||
|
|
||||||
if( m_fArrowScrollSpeed != 1 )
|
if( m_fArrowScrollSpeed != 1 )
|
||||||
{
|
{
|
||||||
CString s = ssprintf( "%2.2f", m_fArrowScrollSpeed );
|
CString s = ssprintf( "%2.1f", m_fArrowScrollSpeed );
|
||||||
if( s[s.GetLength()-1] == '0' )
|
if( s.Right(1) == '0' )
|
||||||
s.Delete(s.GetLength()-1);
|
s.Delete(s.GetLength()-2, 2); // delete last 2 chars
|
||||||
sReturn += s + "X, ";
|
sReturn += s + "X, ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ ScoreDisplayNormal::ScoreDisplayNormal()
|
|||||||
LOG->Trace( "ScoreDisplayNormal::ScoreDisplayNormal()" );
|
LOG->Trace( "ScoreDisplayNormal::ScoreDisplayNormal()" );
|
||||||
|
|
||||||
// init the text
|
// init the text
|
||||||
LoadFromFont( THEME->GetPathTo("Fonts","score numbers") );
|
BitmapText::LoadFromTextureAndChars( THEME->GetPathTo("Graphics","gameplay score numbers 7x2"), "01234 :56789%." );
|
||||||
TurnShadowOff();
|
TurnShadowOff();
|
||||||
|
|
||||||
m_fScore = 0;
|
m_fScore = 0;
|
||||||
|
|||||||
@@ -51,8 +51,8 @@ ScreenAppearanceOptions::ScreenAppearanceOptions() :
|
|||||||
Init(
|
Init(
|
||||||
INPUTMODE_BOTH,
|
INPUTMODE_BOTH,
|
||||||
g_AppearanceOptionsLines,
|
g_AppearanceOptionsLines,
|
||||||
NUM_APPEARANCE_OPTIONS_LINES
|
NUM_APPEARANCE_OPTIONS_LINES,
|
||||||
);
|
false );
|
||||||
m_Menu.StopTimer();
|
m_Menu.StopTimer();
|
||||||
|
|
||||||
MUSIC->LoadAndPlayIfNotAlready( THEME->GetPathTo("Sounds","appearance options music") );
|
MUSIC->LoadAndPlayIfNotAlready( THEME->GetPathTo("Sounds","appearance options music") );
|
||||||
|
|||||||
@@ -25,11 +25,10 @@
|
|||||||
//
|
//
|
||||||
// Defines specific to ScreenEditMenu
|
// Defines specific to ScreenEditMenu
|
||||||
//
|
//
|
||||||
const float EXPLANATION_X = CENTER_X;
|
#define EXPLANATION_X THEME->GetMetricF("ScreenEditMenu","ExplanationX")
|
||||||
const float EXPLANATION_Y = SCREEN_BOTTOM - 70;
|
#define EXPLANATION_Y THEME->GetMetricF("ScreenEditMenu","ExplanationY")
|
||||||
const CString EXPLANATION_TEXT =
|
#define EXPLANATION_TEXT THEME->GetMetric("ScreenEditMenu","ExplanationText")
|
||||||
"In this mode, you can edit existing notes patterns,\n"
|
#define HELP_TEXT THEME->GetMetric("ScreenEditMenu","HelpText")
|
||||||
"create note patterns, or synchronize notes with the music.";
|
|
||||||
|
|
||||||
const ScreenMessage SM_GoToPrevScreen = ScreenMessage(SM_User+1);
|
const ScreenMessage SM_GoToPrevScreen = ScreenMessage(SM_User+1);
|
||||||
const ScreenMessage SM_GoToNextScreen = ScreenMessage(SM_User+2);
|
const ScreenMessage SM_GoToNextScreen = ScreenMessage(SM_User+2);
|
||||||
@@ -48,8 +47,7 @@ ScreenEditMenu::ScreenEditMenu()
|
|||||||
m_Menu.Load(
|
m_Menu.Load(
|
||||||
THEME->GetPathTo("Graphics","edit menu background"),
|
THEME->GetPathTo("Graphics","edit menu background"),
|
||||||
THEME->GetPathTo("Graphics","edit menu top edge"),
|
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) ),
|
HELP_TEXT, false, false, 99
|
||||||
false, 99
|
|
||||||
);
|
);
|
||||||
this->AddChild( &m_Menu );
|
this->AddChild( &m_Menu );
|
||||||
|
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
|
|||||||
m_BannerWithFrame[0].SetXY( BANNER_X, BANNER_Y );
|
m_BannerWithFrame[0].SetXY( BANNER_X, BANNER_Y );
|
||||||
this->AddChild( &m_BannerWithFrame[0] );
|
this->AddChild( &m_BannerWithFrame[0] );
|
||||||
|
|
||||||
m_textStage.LoadFromFont( THEME->GetPathTo("Fonts","header1") );
|
m_textStage.LoadFromFont( THEME->GetPathTo("Fonts","evalstage") );
|
||||||
m_textStage.TurnShadowOff();
|
m_textStage.TurnShadowOff();
|
||||||
m_textStage.SetXY( STAGE_X, STAGE_Y );
|
m_textStage.SetXY( STAGE_X, STAGE_Y );
|
||||||
m_textStage.SetZoom( 0.5f );
|
m_textStage.SetZoom( 0.5f );
|
||||||
@@ -234,7 +234,7 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
|
|||||||
m_Menu.Load(
|
m_Menu.Load(
|
||||||
THEME->GetPathTo("Graphics","evaluation background"),
|
THEME->GetPathTo("Graphics","evaluation background"),
|
||||||
THEME->GetPathTo("Graphics",m_ResultMode==RM_ARCADE_SUMMARY?"evaluation summary top edge":"evaluation top edge"),
|
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 );
|
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
|
// Chris: If EZ2 wants to hide these things, place them off screen using theme metrics
|
||||||
if( bNewRecord[p] )
|
if( bNewRecord[p] )
|
||||||
{
|
{
|
||||||
m_textNewRecord[p].LoadFromFont( THEME->GetPathTo("Fonts","header1") );
|
m_sprNewRecord[p].Load( THEME->GetPathTo("Graphics","evaluation new record") );
|
||||||
m_textNewRecord[p].SetXY( NEW_RECORD_X(p), NEW_RECORD_Y );
|
m_sprNewRecord[p].SetXY( NEW_RECORD_X(p), NEW_RECORD_Y );
|
||||||
m_textNewRecord[p].SetShadowLength( 2 );
|
m_sprNewRecord[p].SetEffectGlowing( 1.0f );
|
||||||
m_textNewRecord[p].SetText( "IT'S A NEW RECORD!" );
|
this->AddChild( &m_sprNewRecord[p] );
|
||||||
m_textNewRecord[p].SetZoom( 0.5f );
|
|
||||||
m_textNewRecord[p].SetEffectGlowing( 1.0f );
|
|
||||||
this->AddChild( &m_textNewRecord[p] );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if( m_bTryExtraStage )
|
if( m_bTryExtraStage )
|
||||||
{
|
{
|
||||||
m_textTryExtraStage.LoadFromFont( THEME->GetPathTo("Fonts","header1") );
|
m_sprTryExtraStage.Load( THEME->GetPathTo("Graphics",GAMESTATE->IsExtraStage()?"evaluation try extra stage1":"evaluation try extra stage2") );
|
||||||
m_textTryExtraStage.SetXY( TRY_EXTRA_STAGE_X, TRY_EXTRA_STAGE_Y );
|
m_sprTryExtraStage.SetXY( TRY_EXTRA_STAGE_X, TRY_EXTRA_STAGE_Y );
|
||||||
if( GAMESTATE->IsExtraStage() )
|
m_sprTryExtraStage.SetEffectGlowing( 1.0f );
|
||||||
m_textTryExtraStage.SetText( "One More ExtraStage!!!" );
|
this->AddChild( &m_sprTryExtraStage );
|
||||||
else
|
|
||||||
m_textTryExtraStage.SetText( "Try ExtraStage!!!" );
|
|
||||||
m_textTryExtraStage.SetZoom( 1 );
|
|
||||||
m_textTryExtraStage.SetEffectGlowing( 1.0f );
|
|
||||||
this->AddChild( &m_textTryExtraStage );
|
|
||||||
|
|
||||||
SOUND->PlayOnceStreamed( THEME->GetPathTo("Sounds","evaluation extra stage") );
|
SOUND->PlayOnceStreamed( THEME->GetPathTo("Sounds","evaluation extra stage") );
|
||||||
}
|
}
|
||||||
@@ -678,7 +670,7 @@ void ScreenEvaluation::TweenOnScreen()
|
|||||||
apActorsInGradeOrPercentFrame.Add( &m_sprPercentFrame[p] );
|
apActorsInGradeOrPercentFrame.Add( &m_sprPercentFrame[p] );
|
||||||
apActorsInGradeOrPercentFrame.Add( &m_textOniPercentLarge[p] );
|
apActorsInGradeOrPercentFrame.Add( &m_textOniPercentLarge[p] );
|
||||||
apActorsInGradeOrPercentFrame.Add( &m_textOniPercentSmall[p] );
|
apActorsInGradeOrPercentFrame.Add( &m_textOniPercentSmall[p] );
|
||||||
apActorsInGradeOrPercentFrame.Add( &m_textNewRecord[p] );
|
apActorsInGradeOrPercentFrame.Add( &m_sprNewRecord[p] );
|
||||||
for( i=0; i<apActorsInGradeOrPercentFrame.GetSize(); i++ )
|
for( i=0; i<apActorsInGradeOrPercentFrame.GetSize(); i++ )
|
||||||
{
|
{
|
||||||
float fOriginalZoomY = apActorsInGradeOrPercentFrame[i]->GetZoomY();
|
float fOriginalZoomY = apActorsInGradeOrPercentFrame[i]->GetZoomY();
|
||||||
@@ -688,10 +680,10 @@ void ScreenEvaluation::TweenOnScreen()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float fOriginalZoomY = m_textTryExtraStage.GetZoomY();
|
float fOriginalZoomY = m_sprTryExtraStage.GetZoomY();
|
||||||
m_textTryExtraStage.SetZoomY( 0 );
|
m_sprTryExtraStage.SetZoomY( 0 );
|
||||||
m_textTryExtraStage.BeginTweening( MENU_ELEMENTS_TWEEN_TIME );
|
m_sprTryExtraStage.BeginTweening( MENU_ELEMENTS_TWEEN_TIME );
|
||||||
m_textTryExtraStage.SetTweenZoomY( fOriginalZoomY );
|
m_sprTryExtraStage.SetTweenZoomY( fOriginalZoomY );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenEvaluation::TweenOffScreen()
|
void ScreenEvaluation::TweenOffScreen()
|
||||||
@@ -758,7 +750,7 @@ void ScreenEvaluation::TweenOffScreen()
|
|||||||
apActorsInGradeOrPercentFrame.Add( &m_sprPercentFrame[p] );
|
apActorsInGradeOrPercentFrame.Add( &m_sprPercentFrame[p] );
|
||||||
apActorsInGradeOrPercentFrame.Add( &m_textOniPercentLarge[p] );
|
apActorsInGradeOrPercentFrame.Add( &m_textOniPercentLarge[p] );
|
||||||
apActorsInGradeOrPercentFrame.Add( &m_textOniPercentSmall[p] );
|
apActorsInGradeOrPercentFrame.Add( &m_textOniPercentSmall[p] );
|
||||||
apActorsInGradeOrPercentFrame.Add( &m_textNewRecord[p] );
|
apActorsInGradeOrPercentFrame.Add( &m_sprNewRecord[p] );
|
||||||
for( i=0; i<apActorsInGradeOrPercentFrame.GetSize(); i++ )
|
for( i=0; i<apActorsInGradeOrPercentFrame.GetSize(); i++ )
|
||||||
{
|
{
|
||||||
apActorsInGradeOrPercentFrame[i]->BeginTweening( MENU_ELEMENTS_TWEEN_TIME );
|
apActorsInGradeOrPercentFrame[i]->BeginTweening( MENU_ELEMENTS_TWEEN_TIME );
|
||||||
@@ -766,8 +758,8 @@ void ScreenEvaluation::TweenOffScreen()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_textTryExtraStage.BeginTweening( MENU_ELEMENTS_TWEEN_TIME );
|
m_sprTryExtraStage.BeginTweening( MENU_ELEMENTS_TWEEN_TIME );
|
||||||
m_textTryExtraStage.SetTweenZoomY( 0 );
|
m_sprTryExtraStage.SetTweenZoomY( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -74,10 +74,10 @@ protected:
|
|||||||
Sprite m_sprScoreLabel;
|
Sprite m_sprScoreLabel;
|
||||||
ScoreDisplayNormal m_ScoreDisplay[NUM_PLAYERS];
|
ScoreDisplayNormal m_ScoreDisplay[NUM_PLAYERS];
|
||||||
|
|
||||||
BitmapText m_textNewRecord[NUM_PLAYERS];
|
Sprite m_sprNewRecord[NUM_PLAYERS];
|
||||||
|
|
||||||
bool m_bTryExtraStage;
|
bool m_bTryExtraStage;
|
||||||
BitmapText m_textTryExtraStage;
|
Sprite m_sprTryExtraStage;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ScreenFinalEvaluation : public ScreenEvaluation
|
class ScreenFinalEvaluation : public ScreenEvaluation
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ ScreenEz2SelectPlayer::ScreenEz2SelectPlayer()
|
|||||||
m_Menu.Load(
|
m_Menu.Load(
|
||||||
THEME->GetPathTo("Graphics","select player background"),
|
THEME->GetPathTo("Graphics","select player background"),
|
||||||
THEME->GetPathTo("Graphics","select player top edge"),
|
THEME->GetPathTo("Graphics","select player top edge"),
|
||||||
HELP_TEXT, true, TIMER_SECONDS
|
HELP_TEXT, false, true, TIMER_SECONDS
|
||||||
);
|
);
|
||||||
this->AddChild( &m_Menu );
|
this->AddChild( &m_Menu );
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ ScreenEz2SelectStyle::ScreenEz2SelectStyle()
|
|||||||
m_Menu.Load(
|
m_Menu.Load(
|
||||||
THEME->GetPathTo("Graphics","select style background"),
|
THEME->GetPathTo("Graphics","select style background"),
|
||||||
THEME->GetPathTo("Graphics","select style top edge"),
|
THEME->GetPathTo("Graphics","select style top edge"),
|
||||||
HELP_TEXT, true, TIMER_SECONDS
|
HELP_TEXT, true, true, TIMER_SECONDS
|
||||||
);
|
);
|
||||||
this->AddChild( &m_Menu );
|
this->AddChild( &m_Menu );
|
||||||
|
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ ScreenGameplay::ScreenGameplay()
|
|||||||
this->AddChild( &m_sprTopFrame );
|
this->AddChild( &m_sprTopFrame );
|
||||||
|
|
||||||
|
|
||||||
m_textStageNumber.LoadFromFont( THEME->GetPathTo("Fonts","Header2") );
|
m_textStageNumber.LoadFromFont( THEME->GetPathTo("Fonts","gameplay stage") );
|
||||||
m_textStageNumber.TurnShadowOff();
|
m_textStageNumber.TurnShadowOff();
|
||||||
m_textStageNumber.SetXY( STAGE_X, STAGE_Y(bExtra) );
|
m_textStageNumber.SetXY( STAGE_X, STAGE_Y(bExtra) );
|
||||||
m_textStageNumber.SetText( GAMESTATE->GetStageText() );
|
m_textStageNumber.SetText( GAMESTATE->GetStageText() );
|
||||||
@@ -295,7 +295,7 @@ ScreenGameplay::ScreenGameplay()
|
|||||||
if( !GAMESTATE->IsPlayerEnabled(PlayerNumber(p)) )
|
if( !GAMESTATE->IsPlayerEnabled(PlayerNumber(p)) )
|
||||||
continue;
|
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] );
|
this->AddChild( &m_DifficultyBanner[p] );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -353,7 +353,7 @@ ScreenGameplay::ScreenGameplay()
|
|||||||
this->AddChild( &m_Fade );
|
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.TurnShadowOff();
|
||||||
m_textSurviveTime.SetXY( SURVIVE_TIME_X, SURVIVE_TIME_Y );
|
m_textSurviveTime.SetXY( SURVIVE_TIME_X, SURVIVE_TIME_Y );
|
||||||
m_textSurviveTime.SetText( "" );
|
m_textSurviveTime.SetText( "" );
|
||||||
|
|||||||
@@ -68,8 +68,8 @@ ScreenGraphicOptions::ScreenGraphicOptions() :
|
|||||||
Init(
|
Init(
|
||||||
INPUTMODE_BOTH,
|
INPUTMODE_BOTH,
|
||||||
g_GraphicOptionsLines,
|
g_GraphicOptionsLines,
|
||||||
NUM_GRAPHIC_OPTIONS_LINES
|
NUM_GRAPHIC_OPTIONS_LINES,
|
||||||
);
|
false );
|
||||||
UpdateRefreshRates();
|
UpdateRefreshRates();
|
||||||
m_Menu.StopTimer();
|
m_Menu.StopTimer();
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ ScreenHowToPlay::ScreenHowToPlay()
|
|||||||
m_Menu.Load(
|
m_Menu.Load(
|
||||||
THEME->GetPathTo("Graphics","How To Play Background"),
|
THEME->GetPathTo("Graphics","How To Play Background"),
|
||||||
THEME->GetPathTo("Graphics","How To Play Top Edge"),
|
THEME->GetPathTo("Graphics","How To Play Top Edge"),
|
||||||
HELP_TEXT, true, TIMER_SECONDS
|
HELP_TEXT, false, true, TIMER_SECONDS
|
||||||
);
|
);
|
||||||
m_Menu.TweenOnScreenFromMenu( SM_None );
|
m_Menu.TweenOnScreenFromMenu( SM_None );
|
||||||
this->AddChild( &m_Menu );
|
this->AddChild( &m_Menu );
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ ScreenOptions::ScreenOptions( CString sBackgroundPath, CString sPagePath, CStrin
|
|||||||
m_Menu.Load(
|
m_Menu.Load(
|
||||||
sBackgroundPath,
|
sBackgroundPath,
|
||||||
sTopEdgePath,
|
sTopEdgePath,
|
||||||
HELP_TEXT, true, TIMER_SECONDS
|
HELP_TEXT, false, true, TIMER_SECONDS
|
||||||
);
|
);
|
||||||
this->AddChild( &m_Menu );
|
this->AddChild( &m_Menu );
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ ScreenOptions::ScreenOptions( CString sBackgroundPath, CString sPagePath, CStrin
|
|||||||
ZeroMemory(&m_OptionDim, sizeof(m_OptionDim));
|
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()" );
|
LOG->Trace( "ScreenOptions::Set()" );
|
||||||
|
|
||||||
@@ -85,6 +85,7 @@ void ScreenOptions::Init( InputMode im, OptionLineData optionLineData[], int iNu
|
|||||||
m_InputMode = im;
|
m_InputMode = im;
|
||||||
m_OptionLineData = optionLineData;
|
m_OptionLineData = optionLineData;
|
||||||
m_iNumOptionLines = iNumOptionLines;
|
m_iNumOptionLines = iNumOptionLines;
|
||||||
|
m_bUseIcons = bUseIcons;
|
||||||
|
|
||||||
|
|
||||||
this->ImportOptions();
|
this->ImportOptions();
|
||||||
@@ -105,7 +106,7 @@ void ScreenOptions::Init( InputMode im, OptionLineData optionLineData[], int iNu
|
|||||||
m_Underline[p][l].Load( (PlayerNumber)p, true );
|
m_Underline[p][l].Load( (PlayerNumber)p, true );
|
||||||
m_framePage.AddChild( &m_Underline[p][l] );
|
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] );
|
m_framePage.AddChild( &m_OptionIcons[p][l] );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,6 +132,7 @@ void ScreenOptions::Init( InputMode im, OptionLineData optionLineData[], int iNu
|
|||||||
InitOptionsText();
|
InitOptionsText();
|
||||||
PositionUnderlines();
|
PositionUnderlines();
|
||||||
PositionIcons();
|
PositionIcons();
|
||||||
|
RefreshIcons();
|
||||||
PositionHighlights();
|
PositionHighlights();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,7 +167,6 @@ void ScreenOptions::InitOptionsText()
|
|||||||
BitmapText &title = m_textOptionLineTitles[i];
|
BitmapText &title = m_textOptionLineTitles[i];
|
||||||
|
|
||||||
title.LoadFromFont( THEME->GetPathTo("Fonts","Header2") );
|
title.LoadFromFont( THEME->GetPathTo("Fonts","Header2") );
|
||||||
title.SetLineHeight( 20 );
|
|
||||||
CString sText = optline.szTitle;
|
CString sText = optline.szTitle;
|
||||||
sText.Replace( " ", "\n" );
|
sText.Replace( " ", "\n" );
|
||||||
title.SetText( sText );
|
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()
|
void ScreenOptions::PositionHighlights()
|
||||||
{
|
{
|
||||||
@@ -338,6 +355,7 @@ void ScreenOptions::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
void ScreenOptions::OnChange()
|
void ScreenOptions::OnChange()
|
||||||
{
|
{
|
||||||
PositionUnderlines();
|
PositionUnderlines();
|
||||||
|
RefreshIcons();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class ScreenOptions : public Screen
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ScreenOptions( CString sBackgroundPath, CString sPagePath, CString sTopEdgePath );
|
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 ~ScreenOptions();
|
||||||
virtual void Update( float fDeltaTime );
|
virtual void Update( float fDeltaTime );
|
||||||
virtual void DrawPrimitives();
|
virtual void DrawPrimitives();
|
||||||
@@ -58,6 +58,7 @@ protected:
|
|||||||
void GetWidthXY( PlayerNumber p, int iRow, int &iWidthOut, int &iXOut, int &iYOut );
|
void GetWidthXY( PlayerNumber p, int iRow, int &iWidthOut, int &iXOut, int &iYOut );
|
||||||
void PositionUnderlines();
|
void PositionUnderlines();
|
||||||
void PositionIcons();
|
void PositionIcons();
|
||||||
|
void RefreshIcons();
|
||||||
void PositionHighlights();
|
void PositionHighlights();
|
||||||
void TweenHighlight( PlayerNumber player_no );
|
void TweenHighlight( PlayerNumber player_no );
|
||||||
virtual void OnChange();
|
virtual void OnChange();
|
||||||
@@ -74,6 +75,7 @@ protected:
|
|||||||
void MenuDown( PlayerNumber p );
|
void MenuDown( PlayerNumber p );
|
||||||
|
|
||||||
InputMode m_InputMode;
|
InputMode m_InputMode;
|
||||||
|
bool m_bUseIcons;
|
||||||
|
|
||||||
OptionLineData* m_OptionLineData;
|
OptionLineData* m_OptionLineData;
|
||||||
int m_iNumOptionLines;
|
int m_iNumOptionLines;
|
||||||
|
|||||||
@@ -62,8 +62,8 @@ ScreenPlayerOptions::ScreenPlayerOptions() :
|
|||||||
Init(
|
Init(
|
||||||
INPUTMODE_PLAYERS,
|
INPUTMODE_PLAYERS,
|
||||||
g_PlayerOptionsLines,
|
g_PlayerOptionsLines,
|
||||||
NUM_PLAYER_OPTIONS_LINES
|
NUM_PLAYER_OPTIONS_LINES,
|
||||||
);
|
true );
|
||||||
|
|
||||||
SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo("player options intro") );
|
SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo("player options intro") );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ ScreenSelectCourse::ScreenSelectCourse()
|
|||||||
m_Menu.Load(
|
m_Menu.Load(
|
||||||
THEME->GetPathTo("Graphics","select course background"),
|
THEME->GetPathTo("Graphics","select course background"),
|
||||||
THEME->GetPathTo("Graphics","select course top edge"),
|
THEME->GetPathTo("Graphics","select course top edge"),
|
||||||
HELP_TEXT, true, TIMER_SECONDS
|
HELP_TEXT, true, true, TIMER_SECONDS
|
||||||
);
|
);
|
||||||
this->AddChild( &m_Menu );
|
this->AddChild( &m_Menu );
|
||||||
|
|
||||||
@@ -79,12 +79,12 @@ ScreenSelectCourse::ScreenSelectCourse()
|
|||||||
m_sprBannerFrame.SetXY( BANNER_FRAME_X, BANNER_FRAME_Y );
|
m_sprBannerFrame.SetXY( BANNER_FRAME_X, BANNER_FRAME_Y );
|
||||||
this->AddChild( &m_sprBannerFrame );
|
this->AddChild( &m_sprBannerFrame );
|
||||||
|
|
||||||
m_textNumStages.LoadFromFont( THEME->GetPathTo("Fonts","header1") );
|
m_textNumSongs.LoadFromFont( THEME->GetPathTo("Fonts","select course num songs") );
|
||||||
m_textNumStages.SetXY( STAGES_X, STAGES_Y );
|
m_textNumSongs.SetXY( STAGES_X, STAGES_Y );
|
||||||
m_textNumStages.TurnShadowOff();
|
m_textNumSongs.TurnShadowOff();
|
||||||
this->AddChild( &m_textNumStages );
|
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.SetXY( TIME_X, TIME_Y );
|
||||||
m_textTime.TurnShadowOff();
|
m_textTime.TurnShadowOff();
|
||||||
this->AddChild( &m_textTime );
|
this->AddChild( &m_textTime );
|
||||||
@@ -151,7 +151,7 @@ void ScreenSelectCourse::DrawPrimitives()
|
|||||||
|
|
||||||
void ScreenSelectCourse::TweenOnScreen()
|
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*);
|
const int iNumActorsInGroupInfoFrame = sizeof(pActorsInCourseInfoFrame) / sizeof(Actor*);
|
||||||
int i;
|
int i;
|
||||||
for( i=0; i<iNumActorsInGroupInfoFrame; i++ )
|
for( i=0; i<iNumActorsInGroupInfoFrame; i++ )
|
||||||
@@ -181,7 +181,7 @@ void ScreenSelectCourse::TweenOnScreen()
|
|||||||
|
|
||||||
void ScreenSelectCourse::TweenOffScreen()
|
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*);
|
const int iNumActorsInGroupInfoFrame = sizeof(pActorsInCourseInfoFrame) / sizeof(Actor*);
|
||||||
int i;
|
int i;
|
||||||
for( i=0; i<iNumActorsInGroupInfoFrame; i++ )
|
for( i=0; i<iNumActorsInGroupInfoFrame; i++ )
|
||||||
@@ -348,7 +348,7 @@ void ScreenSelectCourse::AfterCourseChange()
|
|||||||
{
|
{
|
||||||
Course* pCourse = m_MusicWheel.GetSelectedCourse();
|
Course* pCourse = m_MusicWheel.GetSelectedCourse();
|
||||||
|
|
||||||
m_textNumStages.SetText( ssprintf("%d", pCourse->m_iStages) );
|
m_textNumSongs.SetText( ssprintf("%d", pCourse->m_iStages) );
|
||||||
float fTotalSeconds = 0;
|
float fTotalSeconds = 0;
|
||||||
for( int i=0; i<pCourse->m_iStages; i++ )
|
for( int i=0; i<pCourse->m_iStages; i++ )
|
||||||
fTotalSeconds += pCourse->m_apSongs[i]->m_fMusicLengthSeconds;
|
fTotalSeconds += pCourse->m_apSongs[i]->m_fMusicLengthSeconds;
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ protected:
|
|||||||
|
|
||||||
Sprite m_sprBannerFrame;
|
Sprite m_sprBannerFrame;
|
||||||
FadingBanner m_Banner;
|
FadingBanner m_Banner;
|
||||||
BitmapText m_textNumStages;
|
BitmapText m_textNumSongs;
|
||||||
BitmapText m_textTime;
|
BitmapText m_textTime;
|
||||||
CourseContentsFrame m_CourseContentsFrame;
|
CourseContentsFrame m_CourseContentsFrame;
|
||||||
Sprite m_sprHighScoreFrame[NUM_PLAYERS];
|
Sprite m_sprHighScoreFrame[NUM_PLAYERS];
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ ScreenSelectDifficulty::ScreenSelectDifficulty()
|
|||||||
m_Menu.Load(
|
m_Menu.Load(
|
||||||
THEME->GetPathTo("Graphics","select difficulty background"),
|
THEME->GetPathTo("Graphics","select difficulty background"),
|
||||||
THEME->GetPathTo("Graphics","select difficulty top edge"),
|
THEME->GetPathTo("Graphics","select difficulty top edge"),
|
||||||
HELP_TEXT, true, TIMER_SECONDS
|
HELP_TEXT, true, true, TIMER_SECONDS
|
||||||
);
|
);
|
||||||
this->AddChild( &m_Menu );
|
this->AddChild( &m_Menu );
|
||||||
|
|
||||||
|
|||||||
@@ -69,8 +69,8 @@ ScreenSelectGame::ScreenSelectGame() :
|
|||||||
Init(
|
Init(
|
||||||
INPUTMODE_BOTH,
|
INPUTMODE_BOTH,
|
||||||
g_SelectGameLines,
|
g_SelectGameLines,
|
||||||
NUM_SELECT_GAME_LINES
|
NUM_SELECT_GAME_LINES,
|
||||||
);
|
false );
|
||||||
|
|
||||||
MUSIC->LoadAndPlayIfNotAlready( THEME->GetPathTo("Sounds","select game music") );
|
MUSIC->LoadAndPlayIfNotAlready( THEME->GetPathTo("Sounds","select game music") );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ ScreenSelectGroup::ScreenSelectGroup()
|
|||||||
m_Menu.Load(
|
m_Menu.Load(
|
||||||
THEME->GetPathTo("Graphics","select group background") ,
|
THEME->GetPathTo("Graphics","select group background") ,
|
||||||
THEME->GetPathTo("Graphics","select group top edge"),
|
THEME->GetPathTo("Graphics","select group top edge"),
|
||||||
HELP_TEXT, true, TIMER_SECONDS
|
HELP_TEXT, true, true, TIMER_SECONDS
|
||||||
);
|
);
|
||||||
this->AddChild( &m_Menu );
|
this->AddChild( &m_Menu );
|
||||||
|
|
||||||
@@ -141,7 +141,7 @@ ScreenSelectGroup::ScreenSelectGroup()
|
|||||||
m_sprFrame.SetXY( FRAME_X, FRAME_Y );
|
m_sprFrame.SetXY( FRAME_X, FRAME_Y );
|
||||||
this->AddChild( &m_sprFrame );
|
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.SetXY( NUMBER_X, NUMBER_Y );
|
||||||
m_textNumber.SetHorizAlign( Actor::align_right );
|
m_textNumber.SetHorizAlign( Actor::align_right );
|
||||||
m_textNumber.TurnShadowOff();
|
m_textNumber.TurnShadowOff();
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ ScreenSelectMusic::ScreenSelectMusic()
|
|||||||
m_Menu.Load(
|
m_Menu.Load(
|
||||||
THEME->GetPathTo("Graphics","select music background"),
|
THEME->GetPathTo("Graphics","select music background"),
|
||||||
THEME->GetPathTo("Graphics","select music top edge"),
|
THEME->GetPathTo("Graphics","select music top edge"),
|
||||||
HELP_TEXT, true, TIMER_SECONDS
|
HELP_TEXT, true, true, TIMER_SECONDS
|
||||||
);
|
);
|
||||||
this->AddChild( &m_Menu );
|
this->AddChild( &m_Menu );
|
||||||
|
|
||||||
@@ -180,7 +180,6 @@ ScreenSelectMusic::ScreenSelectMusic()
|
|||||||
m_sprMeterFrame[p].SetState( p );
|
m_sprMeterFrame[p].SetState( p );
|
||||||
this->AddChild( &m_sprMeterFrame[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].SetXY( METER_X(p), METER_Y(p) );
|
||||||
m_FootMeter[p].SetShadowLength( 2 );
|
m_FootMeter[p].SetShadowLength( 2 );
|
||||||
this->AddChild( &m_FootMeter[p] );
|
this->AddChild( &m_FootMeter[p] );
|
||||||
@@ -212,7 +211,7 @@ ScreenSelectMusic::ScreenSelectMusic()
|
|||||||
this->AddChild( &m_MusicSortDisplay );
|
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.SetXY( CENTER_X, CENTER_Y );
|
||||||
m_textHoldForOptions.SetText( "press START again for options" );
|
m_textHoldForOptions.SetText( "press START again for options" );
|
||||||
m_textHoldForOptions.SetZoom( 1 );
|
m_textHoldForOptions.SetZoom( 1 );
|
||||||
@@ -272,7 +271,7 @@ void ScreenSelectMusic::TweenOnScreen()
|
|||||||
|
|
||||||
m_textSongOptions.FadeOn( 0, "fade", TWEEN_TIME );
|
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 );
|
m_OptionIconRow[p].FadeOn( 0, "foldy", TWEEN_TIME );
|
||||||
// fOriginalZoomY = m_textPlayerOptions[p].GetZoomY();
|
// fOriginalZoomY = m_textPlayerOptions[p].GetZoomY();
|
||||||
@@ -317,7 +316,7 @@ void ScreenSelectMusic::TweenOffScreen()
|
|||||||
|
|
||||||
m_textSongOptions.FadeOff( 0, "fade", TWEEN_TIME );
|
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_OptionIconRow[p].FadeOff( 0, "foldy", TWEEN_TIME );
|
||||||
// m_textPlayerOptions[p].FadeOff( 0, "fade", TWEEN_TIME );
|
// m_textPlayerOptions[p].FadeOff( 0, "fade", TWEEN_TIME );
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ ScreenSelectStyle::ScreenSelectStyle()
|
|||||||
m_Menu.Load(
|
m_Menu.Load(
|
||||||
THEME->GetPathTo("Graphics","select style background"),
|
THEME->GetPathTo("Graphics","select style background"),
|
||||||
THEME->GetPathTo("Graphics","select style top edge"),
|
THEME->GetPathTo("Graphics","select style top edge"),
|
||||||
HELP_TEXT, true, TIMER_SECONDS
|
HELP_TEXT, false, true, TIMER_SECONDS
|
||||||
);
|
);
|
||||||
this->AddChild( &m_Menu );
|
this->AddChild( &m_Menu );
|
||||||
|
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ ScreenSelectStyle5th::ScreenSelectStyle5th()
|
|||||||
m_Menu.Load(
|
m_Menu.Load(
|
||||||
THEME->GetPathTo("Graphics","select style background"),
|
THEME->GetPathTo("Graphics","select style background"),
|
||||||
THEME->GetPathTo("Graphics","select style top edge"),
|
THEME->GetPathTo("Graphics","select style top edge"),
|
||||||
HELP_TEXT, true, TIMER_SECONDS
|
HELP_TEXT, false, true, TIMER_SECONDS
|
||||||
);
|
);
|
||||||
this->AddChild( &m_Menu );
|
this->AddChild( &m_Menu );
|
||||||
|
|
||||||
|
|||||||
@@ -50,8 +50,8 @@ ScreenSongOptions::ScreenSongOptions() :
|
|||||||
|
|
||||||
Init( INPUTMODE_BOTH,
|
Init( INPUTMODE_BOTH,
|
||||||
g_SongOptionsLines,
|
g_SongOptionsLines,
|
||||||
NUM_SONG_OPTIONS_LINES
|
NUM_SONG_OPTIONS_LINES,
|
||||||
);
|
false );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenSongOptions::ImportOptions()
|
void ScreenSongOptions::ImportOptions()
|
||||||
|
|||||||
@@ -47,6 +47,8 @@ const CString CHOICE_TEXT[ScreenTitleMenu::NUM_TITLE_MENU_CHOICES] = {
|
|||||||
#define SONGS_Y THEME->GetMetricF("ScreenTitleMenu","SongsY")
|
#define SONGS_Y THEME->GetMetricF("ScreenTitleMenu","SongsY")
|
||||||
#define COLOR_NOT_SELECTED THEME->GetMetricC("ScreenTitleMenu","ColorNotSelected")
|
#define COLOR_NOT_SELECTED THEME->GetMetricC("ScreenTitleMenu","ColorNotSelected")
|
||||||
#define COLOR_SELECTED THEME->GetMetricC("ScreenTitleMenu","ColorSelected")
|
#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_BEFORE_DEMONSTRATION THEME->GetMetricF("ScreenTitleMenu","SecondsBeforeDemonstration")
|
||||||
#define SECONDS_BETWEEN_ATTRACT THEME->GetMetricF("ScreenTitleMenu","SecondsBetweenAttract")
|
#define SECONDS_BETWEEN_ATTRACT THEME->GetMetricF("ScreenTitleMenu","SecondsBetweenAttract")
|
||||||
#define HELP_TEXT THEME->GetMetric("ScreenTitleMenu","HelpText")
|
#define HELP_TEXT THEME->GetMetric("ScreenTitleMenu","HelpText")
|
||||||
@@ -138,7 +140,7 @@ ScreenTitleMenu::ScreenTitleMenu()
|
|||||||
|
|
||||||
for( int i=0; i< NUM_TITLE_MENU_CHOICES; i++ )
|
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].SetText( CHOICE_TEXT[i] );
|
||||||
m_textChoice[i].SetXY( CHOICES_X, CHOICES_START_Y + i*CHOICES_SPACING_Y );
|
m_textChoice[i].SetXY( CHOICES_X, CHOICES_START_Y + i*CHOICES_SPACING_Y );
|
||||||
m_textChoice[i].SetShadowLength( 5 );
|
m_textChoice[i].SetShadowLength( 5 );
|
||||||
@@ -161,6 +163,9 @@ ScreenTitleMenu::ScreenTitleMenu()
|
|||||||
|
|
||||||
|
|
||||||
m_TitleMenuChoice = CHOICE_GAME_START;
|
m_TitleMenuChoice = CHOICE_GAME_START;
|
||||||
|
|
||||||
|
for( i=0; i<NUM_TITLE_MENU_CHOICES; i++ )
|
||||||
|
LoseFocus( i );
|
||||||
GainFocus( m_TitleMenuChoice );
|
GainFocus( m_TitleMenuChoice );
|
||||||
|
|
||||||
MUSIC->LoadAndPlayIfNotAlready( THEME->GetPathTo("Sounds","title menu music") );
|
MUSIC->LoadAndPlayIfNotAlready( THEME->GetPathTo("Sounds","title menu music") );
|
||||||
@@ -294,20 +299,17 @@ void ScreenTitleMenu::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
|
|
||||||
void ScreenTitleMenu::LoseFocus( int iChoiceIndex )
|
void ScreenTitleMenu::LoseFocus( int iChoiceIndex )
|
||||||
{
|
{
|
||||||
m_soundChange.PlayRandom();
|
|
||||||
|
|
||||||
m_textChoice[iChoiceIndex].SetEffectNone();
|
m_textChoice[iChoiceIndex].SetEffectNone();
|
||||||
m_textChoice[iChoiceIndex].StopTweening();
|
m_textChoice[iChoiceIndex].StopTweening();
|
||||||
m_textChoice[iChoiceIndex].BeginTweening( 0.3f );
|
m_textChoice[iChoiceIndex].BeginTweening( 0.3f );
|
||||||
m_textChoice[iChoiceIndex].SetTweenZoom( 0.9f );
|
m_textChoice[iChoiceIndex].SetTweenZoom( ZOOM_NOT_SELECTED );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenTitleMenu::GainFocus( int iChoiceIndex )
|
void ScreenTitleMenu::GainFocus( int iChoiceIndex )
|
||||||
{
|
{
|
||||||
m_textChoice[iChoiceIndex].StopTweening();
|
m_textChoice[iChoiceIndex].StopTweening();
|
||||||
m_textChoice[iChoiceIndex].BeginTweening( 0.3f );
|
m_textChoice[iChoiceIndex].BeginTweening( 0.3f );
|
||||||
m_textChoice[iChoiceIndex].SetTweenZoom( 1.2f );
|
m_textChoice[iChoiceIndex].SetTweenZoom( ZOOM_SELECTED );
|
||||||
D3DXCOLOR color1, color2;
|
D3DXCOLOR color1, color2;
|
||||||
color1 = COLOR_SELECTED;
|
color1 = COLOR_SELECTED;
|
||||||
color2 = color1 * 0.5f;
|
color2 = color1 * 0.5f;
|
||||||
@@ -324,6 +326,8 @@ void ScreenTitleMenu::MenuUp( PlayerNumber p )
|
|||||||
|
|
||||||
m_TitleMenuChoice = TitleMenuChoice( m_TitleMenuChoice-1 );
|
m_TitleMenuChoice = TitleMenuChoice( m_TitleMenuChoice-1 );
|
||||||
|
|
||||||
|
m_soundChange.PlayRandom();
|
||||||
|
|
||||||
GainFocus( m_TitleMenuChoice );
|
GainFocus( m_TitleMenuChoice );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -337,6 +341,8 @@ void ScreenTitleMenu::MenuDown( PlayerNumber p )
|
|||||||
|
|
||||||
m_TitleMenuChoice = TitleMenuChoice( m_TitleMenuChoice+1 );
|
m_TitleMenuChoice = TitleMenuChoice( m_TitleMenuChoice+1 );
|
||||||
|
|
||||||
|
m_soundChange.PlayRandom();
|
||||||
|
|
||||||
GainFocus( m_TitleMenuChoice );
|
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 GROUP_COLOR( i ) THEME->GetMetricC("SongManager",ssprintf("GroupColor%d",i+1))
|
||||||
#define EXTRA_COLOR THEME->GetMetricC("SongManager","ExtraColor")
|
#define EXTRA_COLOR THEME->GetMetricC("SongManager","ExtraColor")
|
||||||
|
|
||||||
const int NUM_GROUP_COLORS = 7;
|
D3DXCOLOR g_GroupColors[30];
|
||||||
D3DXCOLOR GROUP_COLORS[NUM_GROUP_COLORS];
|
|
||||||
|
|
||||||
D3DXCOLOR g_ExtraColor;
|
D3DXCOLOR g_ExtraColor;
|
||||||
|
|
||||||
|
|
||||||
SongManager::SongManager( void(*callback)() )
|
SongManager::SongManager( void(*callback)() )
|
||||||
{
|
{
|
||||||
// Loading these theme metrics is slow, so only do it ever 20th time.
|
for( int i=0; i<NUM_GROUP_COLORS; i++ )
|
||||||
GROUP_COLORS[0] = GROUP_COLOR_1;
|
g_GroupColors[i] = GROUP_COLOR( i );
|
||||||
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;
|
|
||||||
g_ExtraColor = EXTRA_COLOR;
|
g_ExtraColor = EXTRA_COLOR;
|
||||||
|
|
||||||
InitSongArrayFromDisk( callback );
|
InitSongArrayFromDisk( callback );
|
||||||
@@ -55,8 +47,6 @@ SongManager::SongManager( void(*callback)() )
|
|||||||
|
|
||||||
SongManager::~SongManager()
|
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();
|
SaveStatisticsToDisk();
|
||||||
FreeSongArray();
|
FreeSongArray();
|
||||||
}
|
}
|
||||||
@@ -368,7 +358,7 @@ D3DXCOLOR SongManager::GetGroupColor( const CString &sGroupName )
|
|||||||
}
|
}
|
||||||
ASSERT( i != m_arrayGroupNames.GetSize() ); // this is not a valid group
|
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 )
|
D3DXCOLOR SongManager::GetSongColor( Song* pSong )
|
||||||
|
|||||||
@@ -732,6 +732,14 @@ SOURCE=.\OptionIcon.h
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin 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
|
SOURCE=.\OptionsCursor.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
@@ -740,14 +748,6 @@ SOURCE=.\OptionsCursor.h
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin 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
|
SOURCE=.\ScrollBar.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ const float TEXT_BANNER_HEIGHT = 40;
|
|||||||
|
|
||||||
TextBanner::TextBanner()
|
TextBanner::TextBanner()
|
||||||
{
|
{
|
||||||
m_textTitle.LoadFromFont( THEME->GetPathTo("Fonts","text banner") );
|
m_textTitle.LoadFromFont( THEME->GetPathTo("Fonts","musicwheel text banner") );
|
||||||
m_textSubTitle.LoadFromFont( THEME->GetPathTo("Fonts","text banner") );
|
m_textSubTitle.LoadFromFont( THEME->GetPathTo("Fonts","musicwheel text banner") );
|
||||||
m_textArtist.LoadFromFont( THEME->GetPathTo("Fonts","text banner") );
|
m_textArtist.LoadFromFont( THEME->GetPathTo("Fonts","musicwheel text banner") );
|
||||||
|
|
||||||
m_textTitle.SetX( -TEXT_BANNER_WIDTH/2 );
|
m_textTitle.SetX( -TEXT_BANNER_WIDTH/2 );
|
||||||
m_textSubTitle.SetX( -TEXT_BANNER_WIDTH/2 );
|
m_textSubTitle.SetX( -TEXT_BANNER_WIDTH/2 );
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ try_element_again:
|
|||||||
"*.avi", "*.mpg", "*.mpeg", NULL
|
"*.avi", "*.mpg", "*.mpeg", NULL
|
||||||
};
|
};
|
||||||
static const char *sound_masks[] = { ".set", ".mp3", ".ogg", ".wav", ".redir", 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;
|
const char **asset_masks = NULL;
|
||||||
if( sAssetCategory == "graphics" ) asset_masks = graphic_masks;
|
if( sAssetCategory == "graphics" ) asset_masks = graphic_masks;
|
||||||
else if( sAssetCategory == "sounds" ) asset_masks = sound_masks;
|
else if( sAssetCategory == "sounds" ) asset_masks = sound_masks;
|
||||||
@@ -231,7 +231,10 @@ try_metric_again:
|
|||||||
|
|
||||||
CString sValue;
|
CString sValue;
|
||||||
if( m_pIniMetrics->GetValue(sScreenName,sValueName,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;
|
return sValue;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#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 ) )
|
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