diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index e168f51f7e..014b50fca4 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -1971,8 +1971,8 @@ ComboYReverse=210 AttackDisplayXOffsetOneSideP1=0 AttackDisplayXOffsetOneSideP2=0 AttackDisplayXOffsetBothSides=0 -AttackDisplayY=190 -AttackDisplayYReverse=290 +AttackDisplayY=170 +AttackDisplayYReverse=310 HoldJudgmentYStandard=150 HoldJudgmentYReverse=330 BrightGhostComboThreshold=100 @@ -3345,3 +3345,7 @@ MeterP1OnCommand=rotationz,-90 MeterP2OnCommand=rotationz,-90 LevelP1OnCommand=addy,-140 LevelP2OnCommand=addy,-140 + +[AttackDisplay] +TextP1OnCommand=diffusealpha,0;linear,0.5;diffusealpha,1;sleep,2;linear,0.5;diffusealpha,0 +TextP2OnCommand=diffusealpha,0;linear,0.5;diffusealpha,1;sleep,2;linear,0.5;diffusealpha,0 \ No newline at end of file diff --git a/stepmania/src/AttackDisplay.cpp b/stepmania/src/AttackDisplay.cpp index 090f333a95..0078bce4e3 100644 --- a/stepmania/src/AttackDisplay.cpp +++ b/stepmania/src/AttackDisplay.cpp @@ -14,6 +14,8 @@ #include "ThemeManager.h" #include "GameState.h" +#define TEXT_ON_COMMAND( p ) THEME->GetMetric("AttackDisplay",ssprintf("TextP%dOnCommand",p+1)) + AttackDisplay::AttackDisplay() { @@ -27,13 +29,30 @@ void AttackDisplay::Update( float fDelta ) ActorFrame::Update( fDelta ); // FIXME: Make GAMESTATE->m_ActiveAttacks a vector - if( !GAMESTATE->m_ActiveAttacks[m_PlayerNumber][0].IsBlank() ) + if( GAMESTATE->m_bAttackBeganThisUpdate[m_PlayerNumber] ) { + // don't handle this again + GAMESTATE->m_bAttackBeganThisUpdate[m_PlayerNumber] = false; + + int s; + for( s=0; sm_ActiveAttacks[m_PlayerNumber][s].fStartSecond >= 0 ) + continue; /* hasn't started yet */ + + if( GAMESTATE->m_ActiveAttacks[m_PlayerNumber][s].fSecsRemaining <= 0 ) + continue; /* ended already */ + + if( GAMESTATE->m_ActiveAttacks[m_PlayerNumber][s].IsBlank() ) + continue; + + break; + } + + CString sText = GAMESTATE->m_ActiveAttacks[m_PlayerNumber][s].sModifier; + m_textAttack.SetDiffuseAlpha( 1 ); - m_textAttack.SetText( GAMESTATE->m_ActiveAttacks[m_PlayerNumber][0].sModifier ); - } - else - { - m_textAttack.SetDiffuseAlpha( 0 ); + m_textAttack.SetText( sText ); + m_textAttack.Command( TEXT_ON_COMMAND(m_PlayerNumber) ); } } \ No newline at end of file diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index f00f9a179e..e7236d0c7c 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -171,7 +171,7 @@ void GameState::Update( float fDelta ) } /* See if any attacks are ending. */ - m_bActiveAttackEndedThisUpdate[p] = false; + m_bAttackEndedThisUpdate[p] = false; for( s=0; sTrace( "Launch attack '%s' against P%d at %f", a.sModifier.c_str(), target+1, a.fStartSecond ); + m_bAttackBeganThisUpdate[target] = true; + // search for an open slot for( int s=0; sm_bActiveAttackEndedThisUpdate[m_PlayerNumber] ) + if( GAMESTATE->m_bAttackEndedThisUpdate[m_PlayerNumber] ) m_soundItemEnding.Play(); PlayerNumber pn = m_PlayerNumber; diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index 807acb2171..27c8081a0d 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -232,7 +232,7 @@ void PlayerMinus::Update( float fDeltaTime ) if( GAMESTATE->m_pCurSong==NULL ) return; - if( GAMESTATE->m_bActiveAttackEndedThisUpdate[m_PlayerNumber] ) + if( GAMESTATE->m_bAttackEndedThisUpdate[m_PlayerNumber] ) m_soundAttackEnding.Play(); diff --git a/stepmania/src/ScoreKeeperRave.cpp b/stepmania/src/ScoreKeeperRave.cpp index 1e01ed2850..4ade99d694 100644 --- a/stepmania/src/ScoreKeeperRave.cpp +++ b/stepmania/src/ScoreKeeperRave.cpp @@ -71,7 +71,7 @@ void ScoreKeeperRave::HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tap void ScoreKeeperRave::Update( float fDelta ) { - if( GAMESTATE->m_bActiveAttackEndedThisUpdate[m_PlayerNumber] ) + if( GAMESTATE->m_bAttackEndedThisUpdate[m_PlayerNumber] ) m_soundAttackEnding.Play(); }