From 014e4ad48b195c3498111feb80935ba1450cffe0 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Tue, 19 Dec 2006 01:42:17 +0000 Subject: [PATCH] add HandleTapScoreNone() for letting LifeMeters and ScoreKeepers handle TNS_None steps move sending of "ComboStopped" to SendComboMessages --- stepmania/Themes/default/metrics.ini | 2 +- stepmania/src/Player.cpp | 42 ++++++++++++++++++++++------ 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index e6f66b9e75..5cc8ce7c38 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -2578,6 +2578,7 @@ DrawDistanceBeforeTargetsPixels=400 DrawDistanceAfterTargetsPixels=-60 TapJudgmentsUnderField=false HoldJudgmentsUnderField=false +PenalizeTapScoreNone=false [PlayerShared] Fallback="Player" @@ -4783,7 +4784,6 @@ ShowCoinData=true ShowBoard=false ShowBeatBars=false FadeBeforeTargetsPercent=0 -ComboStoppedCommand= BarMeasureAlpha=1 Bar4thAlpha=1 Bar8thAlpha=1 diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index 48a0edd56d..33791bb653 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -72,6 +72,7 @@ static Preference m_fTimingWindowAdd ( "TimingWindowAdd", 0 ); static Preference1D m_fTimingWindowSeconds( TimingWindowSecondsInit, NUM_TimingWindow ); static Preference m_fTimingWindowJump ( "TimingWindowJump", 0.25 ); Preference g_fTimingWindowHopo ( "TimingWindowHopo", 0.25 ); +ThemeMetric PENALIZE_TAP_SCORE_NONE ( "Player", "PenalizeTapScoreNone" ); @@ -487,11 +488,18 @@ void Player::Load() } if( m_pPlayerStageStats ) - SendComboMessage( m_pPlayerStageStats->m_iCurCombo, m_pPlayerStageStats->m_iCurMissCombo ); + SendComboMessages( m_pPlayerStageStats->m_iCurCombo, m_pPlayerStageStats->m_iCurMissCombo ); } -void Player::SendComboMessage( int iOldCombo, int iOldMissCombo ) +void Player::SendComboMessages( int iOldCombo, int iOldMissCombo ) { + const int iCurCombo = m_pPlayerStageStats ? m_pPlayerStageStats->m_iCurCombo : 0; + if( iOldCombo > 50 && iCurCombo < 50 ) + { + SCREENMAN->PostMessageToTopScreen( SM_ComboStopped, 0 ); + } + + Message msg( "ComboChanged" ); msg.SetParam( "Player", m_pPlayerState->m_PlayerNumber ); msg.SetParam( "OldCombo", iOldCombo ); @@ -1651,6 +1659,28 @@ done_checking_hopo: Message msg( "ScoreNone" ); MESSAGEMAN->Broadcast( msg ); + const int iOldCombo = m_pPlayerStageStats ? m_pPlayerStageStats->m_iCurCombo : 0; + const int iOldMissCombo = m_pPlayerStageStats ? m_pPlayerStageStats->m_iCurMissCombo : 0; + + /* The only real way to tell if a mine has been scored is if it has disappeared + * but this only works for hit mines so update the scores for avoided mines here. */ + if( m_pPrimaryScoreKeeper ) + m_pPrimaryScoreKeeper->HandleTapScoreNone(); + if( m_pSecondaryScoreKeeper ) + m_pSecondaryScoreKeeper->HandleTapScoreNone(); + + SendComboMessages( iOldCombo, iOldMissCombo ); + + + if( m_pLifeMeter ) + m_pLifeMeter->HandleTapScoreNone(); + // TODO: Remove use of PlayerNumber + PlayerNumber pn = PLAYER_INVALID; + if( m_pCombinedLifeMeter ) + m_pCombinedLifeMeter->HandleTapScoreNone( pn ); + + if( PENALIZE_TAP_SCORE_NONE ) + SetJudgment( TNS_Miss, false ); } break; case ButtonType_Hopo: @@ -2030,13 +2060,7 @@ void Player::HandleTapRowScore( unsigned row ) const int iCurCombo = m_pPlayerStageStats ? m_pPlayerStageStats->m_iCurCombo : 0; const int iCurMissCombo = m_pPlayerStageStats ? m_pPlayerStageStats->m_iCurMissCombo : 0; - if( iOldCombo > 50 && iCurCombo < 50 ) - { - SCREENMAN->PostMessageToTopScreen( SM_ComboStopped, 0 ); - } - - SendComboMessage( iOldCombo, iOldMissCombo ); - + SendComboMessages( iOldCombo, iOldMissCombo ); if( m_pPlayerStageStats && m_pCombo ) {