Remove GhostArrow, and do them with XML. This is simpler and reduces bloat
in note skins. - skins with only one ghost flash can simply override "Common Tap Explosion Bright" and "Dim" - don't need to have tons of files to redirect each type of ghost flash - still supports overriding ghost commands in NoteSkin metrics.ini - fixes obscure bug: the first bright ghost flash wouldn't hide the last dim ghost flash
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include "Game.h"
|
||||
#include "PlayerState.h"
|
||||
#include "Style.h"
|
||||
#include "ActorUtil.h"
|
||||
|
||||
|
||||
GhostArrowRow::GhostArrowRow()
|
||||
@@ -30,17 +31,12 @@ void GhostArrowRow::Load( const PlayerState* pPlayerState, float fYReverseOffset
|
||||
{
|
||||
const CString &sButton = GAMESTATE->GetCurrentGame()->ColToButtonName( c );
|
||||
|
||||
m_GhostDim.push_back( new GhostArrow );
|
||||
m_GhostBright.push_back( new GhostArrow );
|
||||
m_HoldGhost.push_back( new HoldGhostArrow );
|
||||
|
||||
m_GhostDim[c]->SetName( "GhostArrowDim" );
|
||||
m_GhostBright[c]->SetName( "GhostArrowBright" );
|
||||
m_HoldGhost[c]->SetName( "HoldGhostArrow" );
|
||||
|
||||
m_GhostDim[c]->Load( sButton, "tap explosion dim" );
|
||||
m_GhostBright[c]->Load( sButton, "tap explosion bright" );
|
||||
m_HoldGhost[c]->Load( sButton, "hold explosion" );
|
||||
|
||||
m_Ghost.push_back( ActorUtil::MakeActor( NOTESKIN->GetPath(sButton, "tap explosion") ) );
|
||||
m_Ghost[c]->SetName( "GhostArrow" );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,8 +44,7 @@ GhostArrowRow::~GhostArrowRow()
|
||||
{
|
||||
for( int i = 0; i < m_iNumCols; ++i )
|
||||
{
|
||||
delete m_GhostDim[i];
|
||||
delete m_GhostBright[i];
|
||||
delete m_Ghost[i];
|
||||
delete m_HoldGhost[i];
|
||||
}
|
||||
}
|
||||
@@ -59,29 +54,24 @@ void GhostArrowRow::Update( float fDeltaTime )
|
||||
{
|
||||
for( int c=0; c<m_iNumCols; c++ )
|
||||
{
|
||||
m_GhostDim[c]->Update( fDeltaTime );
|
||||
m_GhostBright[c]->Update( fDeltaTime );
|
||||
m_Ghost[c]->Update( fDeltaTime );
|
||||
m_HoldGhost[c]->Update( fDeltaTime );
|
||||
|
||||
const float fX = ArrowEffects::GetXPos( m_pPlayerState, c, 0 );
|
||||
const float fY = ArrowEffects::GetYPos( m_pPlayerState, c, 0, m_fYReverseOffsetPixels );
|
||||
const float fZ = ArrowEffects::GetZPos( m_pPlayerState, c, 0 );
|
||||
|
||||
m_GhostDim[c]->SetX( fX );
|
||||
m_GhostBright[c]->SetX( fX );
|
||||
m_Ghost[c]->SetX( fX );
|
||||
m_HoldGhost[c]->SetX( fX );
|
||||
|
||||
m_GhostDim[c]->SetY( fY );
|
||||
m_GhostBright[c]->SetY( fY );
|
||||
m_Ghost[c]->SetY( fY );
|
||||
m_HoldGhost[c]->SetY( fY );
|
||||
|
||||
m_GhostDim[c]->SetZ( fZ );
|
||||
m_GhostBright[c]->SetZ( fZ );
|
||||
m_Ghost[c]->SetZ( fZ );
|
||||
m_HoldGhost[c]->SetZ( fZ );
|
||||
|
||||
const float fZoom = ArrowEffects::GetZoom( m_pPlayerState );
|
||||
m_GhostDim[c]->SetZoom( fZoom );
|
||||
m_GhostBright[c]->SetZoom( fZoom );
|
||||
m_Ghost[c]->SetZoom( fZoom );
|
||||
m_HoldGhost[c]->SetZoom( fZoom );
|
||||
}
|
||||
}
|
||||
@@ -95,8 +85,7 @@ void GhostArrowRow::DrawPrimitives()
|
||||
|
||||
NoteFieldMode::BeginDrawTrack( pn, c );
|
||||
|
||||
m_GhostDim[c]->Draw();
|
||||
m_GhostBright[c]->Draw();
|
||||
m_Ghost[c]->Draw();
|
||||
m_HoldGhost[c]->Draw();
|
||||
|
||||
NoteFieldMode::EndDrawTrack( c );
|
||||
@@ -107,19 +96,26 @@ void GhostArrowRow::DrawPrimitives()
|
||||
void GhostArrowRow::DidTapNote( int iCol, TapNoteScore tns, bool bBright )
|
||||
{
|
||||
ASSERT( iCol >= 0 && iCol < m_iNumCols );
|
||||
|
||||
m_Ghost[iCol]->PlayCommand( "Judgment" );
|
||||
if( bBright )
|
||||
m_GhostBright[iCol]->StepTap( tns );
|
||||
m_Ghost[iCol]->PlayCommand( "Bright" );
|
||||
else
|
||||
m_GhostDim[iCol]->StepTap( tns );
|
||||
m_Ghost[iCol]->PlayCommand( "Dim" );
|
||||
CString sJudge = TapNoteScoreToString( tns );
|
||||
m_Ghost[iCol]->PlayCommand( Capitalize(sJudge) );
|
||||
}
|
||||
|
||||
void GhostArrowRow::DidHoldNote( int iCol, HoldNoteScore hns, bool bBright )
|
||||
{
|
||||
ASSERT( iCol >= 0 && iCol < m_iNumCols );
|
||||
m_Ghost[iCol]->PlayCommand( "Judgment" );
|
||||
if( bBright )
|
||||
m_GhostBright[iCol]->StepHold( hns );
|
||||
m_Ghost[iCol]->PlayCommand( "Bright" );
|
||||
else
|
||||
m_GhostDim[iCol]->StepHold( hns );
|
||||
m_Ghost[iCol]->PlayCommand( "Dim" );
|
||||
CString sJudge = HoldNoteScoreToString( hns );
|
||||
m_Ghost[iCol]->PlayCommand( Capitalize(sJudge) );
|
||||
}
|
||||
|
||||
void GhostArrowRow::SetHoldIsActive( int iCol )
|
||||
|
||||
Reference in New Issue
Block a user