diff --git a/stepmania/NEWS b/stepmania/NEWS index fe848e6c84..63f2fdcc8d 100644 --- a/stepmania/NEWS +++ b/stepmania/NEWS @@ -1,4 +1,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: Option codes on the Select Music and Select Course screens Codes are defined in the metrics.ini file and thus can be edited and diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index 54dffc251e..a862352234 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -11,8 +11,11 @@ // - ScreenSelectStyle [Common] -ColorP1=0.4,1.0,0.8,1 // sea green -ColorP2=1.0,0.5,0.2,1 // orange +ColorP1=0.4,1.0,0.8,1 // sea green +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] ChoicesX=320 @@ -28,6 +31,8 @@ SongsX=20 SongsY=20 ColorNotSelected=1,1,1,1 ColorSelected=0.5,1,0.5,1 +ZoomNotSelected=1.0 +ZoomSelected=1.3 SecondsBeforeDemonstration=30 SecondsBetweenAttract=12 HelpText=Use # $ to select, then press START @@ -131,8 +136,9 @@ ContentsX=320 ContentsY=260 TitlesStartX=20 TitlesStartY=276 -TitlesSpacingX=200 -TitlesColumns=3 +TitlesWidth=146 +TitlesSpacingX=150 +TitlesColumns=4 TitlesRows=10 HelpText=Use ! " to select, then press START TimerSeconds=40 @@ -141,7 +147,7 @@ NextScreen=ScreenHowToPlay [ScreenHowToPlay] NextScreenArcade=ScreenSelectMusic NextScreenOni=ScreenSelectCourse -HelpText= +HelpText=Press START to continue TimerSeconds=15 [ScreenSelectMusic] @@ -347,6 +353,12 @@ SpinGrades=1 GradesGlowColor1=1,1,1,0.2 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] StatsX=632 StatsY=10 @@ -555,6 +567,7 @@ TextHAlign=1 // 0,1,2 = left,center,right TextVAlign=1 // 0,1,2 = top,middle,bottom TextWidth=128 TextZoom=0.25 +Uppercase=1 [OptionIconRow] SpacingX=38 diff --git a/stepmania/src/BPMDisplay.cpp b/stepmania/src/BPMDisplay.cpp index 728b52225a..cb6b842b0f 100644 --- a/stepmania/src/BPMDisplay.cpp +++ b/stepmania/src/BPMDisplay.cpp @@ -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" ); diff --git a/stepmania/src/BitmapText.cpp b/stepmania/src/BitmapText.cpp index dabee1f85e..421d84b7fb 100644 --- a/stepmania/src/BitmapText.cpp +++ b/stepmania/src/BitmapText.cpp @@ -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; } diff --git a/stepmania/src/BitmapText.h b/stepmania/src/BitmapText.h index 1b1f3b333b..b39d617fc2 100644 --- a/stepmania/src/BitmapText.h +++ b/stepmania/src/BitmapText.h @@ -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; }; diff --git a/stepmania/src/Combo.cpp b/stepmania/src/Combo.cpp index 3c09483e0e..18ec8b4703 100644 --- a/stepmania/src/Combo.cpp +++ b/stepmania/src/Combo.cpp @@ -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 ); diff --git a/stepmania/src/Font.cpp b/stepmania/src/Font.cpp index c96329c927..cfd89932d6 100644 --- a/stepmania/src/Font.cpp +++ b/stepmania/src/Font.cpp @@ -21,130 +21,67 @@ #include #include -Font::Font( const CString &sFontFilePath ) +Font::Font( const CString &sASCIITexturePath ) { - //LOG->Trace( "Font::LoadFromFontName(%s)", sFontFilePath ); - for( int i=0; iTrace( "Font::LoadFromFontName(%s)", sASCIITexturePath ); + + int i; + + for( i=0; iLoadTexture( 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; iGetNumFrames() ) - { - 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; iGetNumFrames(); 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; iGetPathTo("Fonts","meter") ); + BitmapText::LoadFromTextureAndChars( THEME->GetPathTo("Graphics","select music meter 2x1"), "10" ); SetFromNotes( NULL ); } diff --git a/stepmania/src/GameConstantsAndTypes.cpp b/stepmania/src/GameConstantsAndTypes.cpp index 084f958c5e..59bab5f39f 100644 --- a/stepmania/src/GameConstantsAndTypes.cpp +++ b/stepmania/src/GameConstantsAndTypes.cpp @@ -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 } } diff --git a/stepmania/src/GroupList.cpp b/stepmania/src/GroupList.cpp index 0240cc1af9..19af4e2009 100644 --- a/stepmania/src/GroupList.cpp +++ b/stepmania/src/GroupList.cpp @@ -30,7 +30,7 @@ void GroupList::DoneAddingGroups() for( i=0; iGetPathTo("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 ); diff --git a/stepmania/src/LifeMeterBattery.cpp b/stepmania/src/LifeMeterBattery.cpp index 29931af844..2c98dbda30 100644 --- a/stepmania/src/LifeMeterBattery.cpp +++ b/stepmania/src/LifeMeterBattery.cpp @@ -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" ); diff --git a/stepmania/src/MenuElements.cpp b/stepmania/src/MenuElements.cpp index 5a6eff8274..12bc593590 100644 --- a/stepmania/src/MenuElements.cpp +++ b/stepmania/src/MenuElements.cpp @@ -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 ); diff --git a/stepmania/src/MenuElements.h b/stepmania/src/MenuElements.h index c4c505a7ef..7fabcf3bec 100644 --- a/stepmania/src/MenuElements.h +++ b/stepmania/src/MenuElements.h @@ -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(); diff --git a/stepmania/src/MenuTimer.cpp b/stepmania/src/MenuTimer.cpp index 5408d29666..c33ef463e2 100644 --- a/stepmania/src/MenuTimer.cpp +++ b/stepmania/src/MenuTimer.cpp @@ -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 ); diff --git a/stepmania/src/MusicList.cpp b/stepmania/src/MusicList.cpp index cbf8fad03b..3a33615dac 100644 --- a/stepmania/src/MusicList.cpp +++ b/stepmania/src/MusicList.cpp @@ -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; iGetPathTo("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; cGetPathTo("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 ); diff --git a/stepmania/src/OptionIcon.cpp b/stepmania/src/OptionIcon.cpp index 8e4182718e..996cfb7d42 100644 --- a/stepmania/src/OptionIcon.cpp +++ b/stepmania/src/OptionIcon.cpp @@ -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; iGetMetricF("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; im_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; iTrace( "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; diff --git a/stepmania/src/ScreenAppearanceOptions.cpp b/stepmania/src/ScreenAppearanceOptions.cpp index e9499191e0..6fe43af02d 100644 --- a/stepmania/src/ScreenAppearanceOptions.cpp +++ b/stepmania/src/ScreenAppearanceOptions.cpp @@ -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") ); diff --git a/stepmania/src/ScreenEditMenu.cpp b/stepmania/src/ScreenEditMenu.cpp index 091e8fe14c..48fd360af0 100644 --- a/stepmania/src/ScreenEditMenu.cpp +++ b/stepmania/src/ScreenEditMenu.cpp @@ -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 ); diff --git a/stepmania/src/ScreenEvaluation.cpp b/stepmania/src/ScreenEvaluation.cpp index 316927b3e0..4ee3df5ba3 100644 --- a/stepmania/src/ScreenEvaluation.cpp +++ b/stepmania/src/ScreenEvaluation.cpp @@ -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; iGetZoomY(); @@ -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; iBeginTweening( 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 ); } diff --git a/stepmania/src/ScreenEvaluation.h b/stepmania/src/ScreenEvaluation.h index 46c8f228e9..6a4be37ff2 100644 --- a/stepmania/src/ScreenEvaluation.h +++ b/stepmania/src/ScreenEvaluation.h @@ -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 diff --git a/stepmania/src/ScreenEz2SelectPlayer.cpp b/stepmania/src/ScreenEz2SelectPlayer.cpp index 549522a709..cb7b078b2a 100644 --- a/stepmania/src/ScreenEz2SelectPlayer.cpp +++ b/stepmania/src/ScreenEz2SelectPlayer.cpp @@ -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 ); diff --git a/stepmania/src/ScreenEz2SelectStyle.cpp b/stepmania/src/ScreenEz2SelectStyle.cpp index 776ebc809f..41831a4324 100644 --- a/stepmania/src/ScreenEz2SelectStyle.cpp +++ b/stepmania/src/ScreenEz2SelectStyle.cpp @@ -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 ); diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index d4f03fb3ec..e3a5942f90 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -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( "" ); diff --git a/stepmania/src/ScreenGraphicOptions.cpp b/stepmania/src/ScreenGraphicOptions.cpp index f44bf2e0af..3170bf4b0a 100644 --- a/stepmania/src/ScreenGraphicOptions.cpp +++ b/stepmania/src/ScreenGraphicOptions.cpp @@ -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(); diff --git a/stepmania/src/ScreenHowToPlay.cpp b/stepmania/src/ScreenHowToPlay.cpp index 60bb10a582..9745ec9ba3 100644 --- a/stepmania/src/ScreenHowToPlay.cpp +++ b/stepmania/src/ScreenHowToPlay.cpp @@ -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 ); diff --git a/stepmania/src/ScreenOptions.cpp b/stepmania/src/ScreenOptions.cpp index ca66109f62..c79edd761a 100644 --- a/stepmania/src/ScreenOptions.cpp +++ b/stepmania/src/ScreenOptions.cpp @@ -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; pPlayOnceStreamedFromDir( ANNOUNCER->GetPathTo("player options intro") ); } diff --git a/stepmania/src/ScreenSelectCourse.cpp b/stepmania/src/ScreenSelectCourse.cpp index f5e00bf6c6..f6a0bc6341 100644 --- a/stepmania/src/ScreenSelectCourse.cpp +++ b/stepmania/src/ScreenSelectCourse.cpp @@ -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; im_iStages) ); + m_textNumSongs.SetText( ssprintf("%d", pCourse->m_iStages) ); float fTotalSeconds = 0; for( int i=0; im_iStages; i++ ) fTotalSeconds += pCourse->m_apSongs[i]->m_fMusicLengthSeconds; diff --git a/stepmania/src/ScreenSelectCourse.h b/stepmania/src/ScreenSelectCourse.h index 2a65817a1a..89d90ecc74 100644 --- a/stepmania/src/ScreenSelectCourse.h +++ b/stepmania/src/ScreenSelectCourse.h @@ -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]; diff --git a/stepmania/src/ScreenSelectDifficulty.cpp b/stepmania/src/ScreenSelectDifficulty.cpp index e01232c786..88c33e85c4 100644 --- a/stepmania/src/ScreenSelectDifficulty.cpp +++ b/stepmania/src/ScreenSelectDifficulty.cpp @@ -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 ); diff --git a/stepmania/src/ScreenSelectGame.cpp b/stepmania/src/ScreenSelectGame.cpp index f5e28f7e00..a7139c3442 100644 --- a/stepmania/src/ScreenSelectGame.cpp +++ b/stepmania/src/ScreenSelectGame.cpp @@ -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") ); } diff --git a/stepmania/src/ScreenSelectGroup.cpp b/stepmania/src/ScreenSelectGroup.cpp index fcefeb1c17..38a9e2980a 100644 --- a/stepmania/src/ScreenSelectGroup.cpp +++ b/stepmania/src/ScreenSelectGroup.cpp @@ -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(); diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index c8954a7559..86223289c6 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -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; pGetPathTo("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 ); diff --git a/stepmania/src/ScreenSelectStyle5th.cpp b/stepmania/src/ScreenSelectStyle5th.cpp index f862768135..78a0840a61 100644 --- a/stepmania/src/ScreenSelectStyle5th.cpp +++ b/stepmania/src/ScreenSelectStyle5th.cpp @@ -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 ); diff --git a/stepmania/src/ScreenSongOptions.cpp b/stepmania/src/ScreenSongOptions.cpp index e2e2a15c56..fa1cc3979a 100644 --- a/stepmania/src/ScreenSongOptions.cpp +++ b/stepmania/src/ScreenSongOptions.cpp @@ -50,8 +50,8 @@ ScreenSongOptions::ScreenSongOptions() : Init( INPUTMODE_BOTH, g_SongOptionsLines, - NUM_SONG_OPTIONS_LINES - ); + NUM_SONG_OPTIONS_LINES, + false ); } void ScreenSongOptions::ImportOptions() diff --git a/stepmania/src/ScreenTitleMenu.cpp b/stepmania/src/ScreenTitleMenu.cpp index 65557e74ef..6c875ebd24 100644 --- a/stepmania/src/ScreenTitleMenu.cpp +++ b/stepmania/src/ScreenTitleMenu.cpp @@ -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; iLoadAndPlayIfNotAlready( 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 ); } diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index a43d09e02f..3dd2e48e98 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -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; iGetPathTo("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 ); diff --git a/stepmania/src/ThemeManager.cpp b/stepmania/src/ThemeManager.cpp index 5f788a50a8..a197b2bf97 100644 --- a/stepmania/src/ThemeManager.cpp +++ b/stepmania/src/ThemeManager.cpp @@ -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 ) )