diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index cba431e5b8..daf91cd16f 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -8,6 +8,16 @@ ________________________________________________________________________________ StepMania 5.0 $NEXT | 20110xyy -------------------------------------------------------------------------------- +2011/05/14 +---------- +* [ModIcon] Added StopWords metric. [AJ] +* [ScreenSelectMaster] Add "ScreenEmpty" param to MenuStartP# when the GameCommand + doesn't set a screen. [AJ] +* [StepsDisplay] Added MeterFormatString metric. [AJ] +* [MusicWheel] Added ShowSectionsInBPMSort and ShowSectionsInLengthSort metrics. [AJ] +* [ScreenEvaluation] Stop the Bonus bars from overflowing in course modes. [AJ] +* [Banner] Added ScrollMode and ScrollSortOrder metrics. [AJ] + 2011/05/11 ---------- * [GameSoundManager] Added PlayAnnouncer Lua binding. [AJ] diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index 0ab21a76f5..4be294753a 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -220,6 +220,8 @@ BottomEdge=SCREEN_BOTTOM # Scroll stuff when you roll over it, DDR Extreme style. ScrollRandom=false ScrollRoulette=false +ScrollMode=false +ScrollSortOrder=false # Control how fast the banner scrolls. Higher numbers mean slower. ScrollSpeedDivisor=2 @@ -857,7 +859,9 @@ ShowRoulette=true ShowRandom=false ShowPortal=false +ShowSectionsInBPMSort=true SortBPMDivision=20 +ShowSectionsInLengthSort=true SortLengthDivision=5 MostPlayedSongsToShow=30 @@ -1282,6 +1286,7 @@ TicksSetCommand= # ShowMeter=false ZeroMeterString="0" +MeterFormatString="%i" MeterX=0 MeterY=0 MeterOnCommand= @@ -2005,6 +2010,7 @@ TicksOnCommand=shadowlength,0; TicksSetCommand=%function(self,param) self:diffuse(CustomDifficultyToColor(param.CustomDifficulty)) if param.Meter > 9 then self:glowshift() else self:stopeffect() end end ShowTicks=false ShowMeter=true +MeterFormatString="%i" ZeroMeterString="?" MeterX=30 MeterY=0 @@ -4031,6 +4037,7 @@ TextX=0 TextY=0 TextOnCommand=maxwidth,40;uppercase,true;shadowlength,0;diffuse,color("#f6ff00") CropTextToWidth=50 +StopWords="1X,default,Overhead,Off" [ModIconSelectMusic] Fallback="ModIcon" diff --git a/src/Banner.cpp b/src/Banner.cpp index b8d115e206..f78777d73d 100644 --- a/src/Banner.cpp +++ b/src/Banner.cpp @@ -17,8 +17,8 @@ REGISTER_ACTOR_CLASS( Banner ); ThemeMetric SCROLL_RANDOM ("Banner","ScrollRandom"); ThemeMetric SCROLL_ROULETTE ("Banner","ScrollRoulette"); -//ThemeMetric SCROLL_MODE ("Banner","ScrollMode"); -//ThemeMetric SCROLL_SORT_ORDER ("Banner","ScrollSortOrder"); +ThemeMetric SCROLL_MODE ("Banner","ScrollMode"); +ThemeMetric SCROLL_SORT_ORDER ("Banner","ScrollSortOrder"); ThemeMetric SCROLL_SPEED_DIVISOR ("Banner","ScrollSpeedDivisor"); Banner::Banner() @@ -119,7 +119,7 @@ void Banner::LoadFromSong( Song* pSong ) // NULL means no song void Banner::LoadMode() { Load( THEME->GetPathG("Banner","Mode") ); - m_bScrolling = false; + m_bScrolling = (bool)SCROLL_MODE; } void Banner::LoadFromSongGroup( RString sSongGroup ) @@ -229,7 +229,7 @@ void Banner::LoadFromSortOrder( SortOrder so ) if( so != SORT_GROUP && so != SORT_RECENT ) Load( THEME->GetPathG("Banner",ssprintf("%s",SortOrderToString(so).c_str())) ); } - m_bScrolling = false; + m_bScrolling = (bool)SCROLL_SORT_ORDER; } // lua start diff --git a/src/ModIcon.cpp b/src/ModIcon.cpp index 0ef95daeb4..6d359046e7 100644 --- a/src/ModIcon.cpp +++ b/src/ModIcon.cpp @@ -39,12 +39,11 @@ void ModIcon::Load( RString sMetricsGroup ) this->AddChild( &m_text ); CROP_TEXT_TO_WIDTH.Load( sMetricsGroup, "CropTextToWidth" ); + // stop words - /* STOP_WORDS.Load( sMetricsGroup, "StopWords" ); m_vStopWords.empty(); split(STOP_WORDS, ",", m_vStopWords); - */ Set(""); } @@ -53,17 +52,8 @@ void ModIcon::Set( const RString &_sText ) { RString sText = _sText; - // todo: make these metricable -aj - static const RString sStopWords[] = - { - "1X", - "DEFAULT", - "OVERHEAD", - "OFF", - }; - - for( unsigned i=0; i CROP_TEXT_TO_WIDTH; + ThemeMetric STOP_WORDS; + vector m_vStopWords; }; #endif diff --git a/src/ScoreKeeperNormal.cpp b/src/ScoreKeeperNormal.cpp index d1530a9be0..c1422942f9 100644 --- a/src/ScoreKeeperNormal.cpp +++ b/src/ScoreKeeperNormal.cpp @@ -360,14 +360,14 @@ void ScoreKeeperNormal::AddScoreInternal( TapNoteScore score ) } - ASSERT( iScore >= 0 ); + ASSERT_M( iScore >= 0, "iScore < 0 before re-rounding" ); // Undo rounding from the last tap, and re-round. iScore += m_iScoreRemainder; m_iScoreRemainder = (iScore % m_iRoundTo); iScore = iScore - m_iScoreRemainder; - ASSERT( iScore >= 0 ); + ASSERT_M( iScore >= 0, "iScore < 0 after re-rounding" ); // LOG->Trace( "score: %i", iScore ); } diff --git a/src/ScreenEvaluation.cpp b/src/ScreenEvaluation.cpp index 76c40f03a1..de756c34fc 100644 --- a/src/ScreenEvaluation.cpp +++ b/src/ScreenEvaluation.cpp @@ -370,6 +370,11 @@ void ScreenEvaluation::Init() // init bonus area if( SHOW_BONUS_AREA ) { + // In course mode, we need to make sure the bar doesn't overflow. -aj + float fDivider = 1.0f; + if( GAMESTATE->IsCourseMode() ) + fDivider = fDivider / GAMESTATE->m_pCurCourse->m_vEntries.size(); + FOREACH_EnabledPlayer( p ) { m_sprBonusFrame[p].Load( THEME->GetPathG(m_sName,ssprintf("BonusFrame p%d",p+1)) ); @@ -382,7 +387,7 @@ void ScreenEvaluation::Init() for( int r=0; rGetPathG(m_sName,ssprintf("BarPossible p%d",p+1)) ); - m_sprPossibleBar[p][r].SetWidth( m_sprPossibleBar[p][r].GetUnzoomedWidth() * m_pStageStats->m_player[p].m_radarPossible[r] ); + m_sprPossibleBar[p][r].SetWidth( m_sprPossibleBar[p][r].GetUnzoomedWidth() * m_pStageStats->m_player[p].m_radarPossible[r] * fDivider ); m_sprPossibleBar[p][r].SetName( ssprintf("BarPossible%dP%d",r+1,p+1) ); ActorUtil::LoadAllCommands( m_sprPossibleBar[p][r], m_sName ); SET_XY( m_sprPossibleBar[p][r] ); @@ -390,7 +395,7 @@ void ScreenEvaluation::Init() m_sprActualBar[p][r].Load( THEME->GetPathG(m_sName,ssprintf("BarActual p%d",p+1)) ); // should be out of the possible bar, not actual (whatever value that is at) - m_sprActualBar[p][r].SetWidth( m_sprPossibleBar[p][r].GetUnzoomedWidth() * m_pStageStats->m_player[p].m_radarActual[r] ); + m_sprActualBar[p][r].SetWidth( m_sprPossibleBar[p][r].GetUnzoomedWidth() * m_pStageStats->m_player[p].m_radarActual[r] * fDivider ); float value = (float)100 * m_sprActualBar[p][r].GetUnzoomedWidth() / m_sprPossibleBar[p][r].GetUnzoomedWidth(); LOG->Trace("Radar bar %d of 5 - %f percent", r, value); diff --git a/src/ScreenSelectMaster.cpp b/src/ScreenSelectMaster.cpp index 83276d4e33..0e50f5ccbf 100644 --- a/src/ScreenSelectMaster.cpp +++ b/src/ScreenSelectMaster.cpp @@ -812,8 +812,9 @@ void ScreenSelectMaster::MenuStart( const InputEventPlus &input ) mc.ApplyToAllPlayers(); // We want to be able to broadcast a Start message to the theme, in // case a themer wants to handle something. -aj - // TODO: Add a param to differentiate this from the message below. - MESSAGEMAN->Broadcast( (MessageID)(Message_MenuStartP1+pn) ); + Message msg( MessageIDToString((MessageID)(Message_MenuStartP1+pn)) ); + msg.SetParam( "ScreenEmpty", true ); + MESSAGEMAN->Broadcast( msg ); return; } diff --git a/src/ScreenSelectMusic.cpp b/src/ScreenSelectMusic.cpp index 4ecb227b3b..1ee3c116a4 100644 --- a/src/ScreenSelectMusic.cpp +++ b/src/ScreenSelectMusic.cpp @@ -1455,7 +1455,9 @@ void ScreenSelectMusic::MenuBack( const InputEventPlus &input ) // Handle unselect song (ffff) // todo: this isn't right at all. -aj /* - if( m_SelectionState == SelectionState_SelectingSteps && !m_bStepsChosen[input.pn] && input.MenuI == GAME_BUTTON_BACK && input.type == IET_FIRST_PRESS ) + if( m_SelectionState == SelectionState_SelectingSteps && + !m_bStepsChosen[input.pn] && input.MenuI == GAME_BUTTON_BACK && + input.type == IET_FIRST_PRESS ) { // if a player has chosen their steps already, don't unchoose song. FOREACH_HumanPlayer( p ) @@ -1530,7 +1532,6 @@ void ScreenSelectMusic::AfterStepsOrTrailChange( const vector &vpn else { // The numbers shouldn't stay if the current selection is NULL. - // todo: Let themers set the text value instead of just using 0. -aj m_textHighScore[pn].SetText( NULL_SCORE_STRING ); } } diff --git a/src/ScreenWithMenuElements.cpp b/src/ScreenWithMenuElements.cpp index df4f78ca95..8377a5fb75 100644 --- a/src/ScreenWithMenuElements.cpp +++ b/src/ScreenWithMenuElements.cpp @@ -64,10 +64,6 @@ void ScreenWithMenuElements::Init() this->AddChild( m_MenuTimer ); } - /* TODO: Remove overlay and underlay in favor of more flexible decorations */ - // Decorations don't let you use UpdateCommand, so don't ever - // remove underlay and overlay, otherwise good themes break. -aj - m_sprUnderlay.Load( THEME->GetPathB(m_sName,"underlay") ); m_sprUnderlay->SetName("Underlay"); m_sprUnderlay->SetDrawOrder( DRAW_ORDER_UNDERLAY ); diff --git a/src/SongUtil.cpp b/src/SongUtil.cpp index 2641f860f0..3d83420167 100644 --- a/src/SongUtil.cpp +++ b/src/SongUtil.cpp @@ -21,6 +21,8 @@ ThemeMetric SORT_BPM_DIVISION ( "MusicWheel", "SortBPMDivision" ); ThemeMetric SORT_LENGTH_DIVISION ( "MusicWheel", "SortLengthDivision" ); +ThemeMetric SHOW_SECTIONS_IN_BPM_SORT ( "MusicWheel", "ShowSectionsInBPMSort" ); +ThemeMetric SHOW_SECTIONS_IN_LENGTH_SORT ( "MusicWheel", "ShowSectionsInLengthSort" ); bool SongCriteria::Matches( const Song *pSong ) const { @@ -598,20 +600,30 @@ RString SongUtil::GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so return SORT_NOT_AVAILABLE.GetValue(); case SORT_BPM: { - const int iBPMGroupSize = SORT_BPM_DIVISION; - DisplayBpms bpms; - pSong->GetDisplayBpms( bpms ); - int iMaxBPM = (int)bpms.GetMax(); - iMaxBPM += iBPMGroupSize - (iMaxBPM%iBPMGroupSize) - 1; - return ssprintf("%03d-%03d",iMaxBPM-(iBPMGroupSize-1), iMaxBPM); + if( SHOW_SECTIONS_IN_BPM_SORT ) + { + const int iBPMGroupSize = SORT_BPM_DIVISION; + DisplayBpms bpms; + pSong->GetDisplayBpms( bpms ); + int iMaxBPM = (int)bpms.GetMax(); + iMaxBPM += iBPMGroupSize - (iMaxBPM%iBPMGroupSize) - 1; + return ssprintf("%03d-%03d",iMaxBPM-(iBPMGroupSize-1), iMaxBPM); + } + else + return RString(); } case SORT_LENGTH: { - const int iSortLengthSize = SORT_LENGTH_DIVISION; - int iMaxLength = (int)pSong->m_fMusicLengthSeconds; - iMaxLength += (iSortLengthSize - (iMaxLength%iSortLengthSize) - 1); - int iMinLength = iMaxLength - (iSortLengthSize-1); - return ssprintf( "%s-%s", SecondsToMMSS(iMinLength).c_str(), SecondsToMMSS(iMaxLength).c_str() ); + if( SHOW_SECTIONS_IN_LENGTH_SORT ) + { + const int iSortLengthSize = SORT_LENGTH_DIVISION; + int iMaxLength = (int)pSong->m_fMusicLengthSeconds; + iMaxLength += (iSortLengthSize - (iMaxLength%iSortLengthSize) - 1); + int iMinLength = iMaxLength - (iSortLengthSize-1); + return ssprintf( "%s-%s", SecondsToMMSS(iMinLength).c_str(), SecondsToMMSS(iMaxLength).c_str() ); + } + else + return RString(); } case SORT_POPULARITY: case SORT_RECENT: diff --git a/src/StageStats.cpp b/src/StageStats.cpp index df3a500349..d30e7bfe9f 100644 --- a/src/StageStats.cpp +++ b/src/StageStats.cpp @@ -202,7 +202,6 @@ void StageStats::FinalizeScores( bool bSummary ) m_multiPlayer[mp].m_HighScore = FillInHighScore( m_multiPlayer[mp], *GAMESTATE->m_pMultiPlayerState[mp], "", sPlayerGuid ); } - // todo: don't save scores in autoplay -aj FOREACH_HumanPlayer( p ) { const HighScore &hs = m_player[p].m_HighScore; @@ -215,6 +214,10 @@ void StageStats::FinalizeScores( bool bSummary ) if( hs.GetDisqualified() ) continue; + // Don't save autoplay scores + if( m_bUsedAutoplay ) + continue; + if( bSummary ) { // don't save scores if any stage was failed diff --git a/src/StepsDisplay.cpp b/src/StepsDisplay.cpp index a42fb31831..7df5e6b930 100644 --- a/src/StepsDisplay.cpp +++ b/src/StepsDisplay.cpp @@ -59,6 +59,7 @@ void StepsDisplay::Load( const RString &sMetricsGroup, const PlayerState *pPlaye m_bShowAutogen.Load(m_sMetricsGroup,"ShowAutogen"); m_bShowStepsType.Load(m_sMetricsGroup,"ShowStepsType"); m_sZeroMeterString.Load(m_sMetricsGroup,"ZeroMeterString"); + m_sMeterFormatString.Load(m_sMetricsGroup,"MeterFormatString"); m_sprFrame.Load( THEME->GetPathG(m_sMetricsGroup,"frame") ); m_sprFrame->SetName( "Frame" ); @@ -241,8 +242,7 @@ void StepsDisplay::SetInternal( const SetParams ¶ms ) } else { - // todo: allow themer to specify a format string? -aj - const RString sMeter = ssprintf( "%i", params.iMeter ); + const RString sMeter = ssprintf( m_sMeterFormatString.GetValue().c_str(), params.iMeter ); m_textMeter.SetText( sMeter ); m_textMeter.HandleMessage( msg ); } diff --git a/src/StepsDisplay.h b/src/StepsDisplay.h index ee266aace6..c3af3063a9 100644 --- a/src/StepsDisplay.h +++ b/src/StepsDisplay.h @@ -72,6 +72,7 @@ private: ThemeMetric m_bShowAutogen; ThemeMetric m_bShowStepsType; ThemeMetric m_sZeroMeterString; + ThemeMetric m_sMeterFormatString; }; #endif diff --git a/src/archutils/Win32/GraphicsWindow.cpp b/src/archutils/Win32/GraphicsWindow.cpp index 814afa882a..cb2b128d71 100644 --- a/src/archutils/Win32/GraphicsWindow.cpp +++ b/src/archutils/Win32/GraphicsWindow.cpp @@ -136,6 +136,7 @@ static LRESULT CALLBACK GraphicsWindow_WndProc( HWND hWnd, UINT msg, WPARAM wPar case WM_KEYUP: case WM_SYSKEYDOWN: case WM_SYSKEYUP: + case WM_MOUSEWHEEL: // We handle all input ourself, via DirectInput. return 0;