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 "Game.h"
|
||||||
#include "PlayerState.h"
|
#include "PlayerState.h"
|
||||||
#include "Style.h"
|
#include "Style.h"
|
||||||
|
#include "ActorUtil.h"
|
||||||
|
|
||||||
|
|
||||||
GhostArrowRow::GhostArrowRow()
|
GhostArrowRow::GhostArrowRow()
|
||||||
@@ -30,17 +31,12 @@ void GhostArrowRow::Load( const PlayerState* pPlayerState, float fYReverseOffset
|
|||||||
{
|
{
|
||||||
const CString &sButton = GAMESTATE->GetCurrentGame()->ColToButtonName( c );
|
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_HoldGhost.push_back( new HoldGhostArrow );
|
||||||
|
|
||||||
m_GhostDim[c]->SetName( "GhostArrowDim" );
|
|
||||||
m_GhostBright[c]->SetName( "GhostArrowBright" );
|
|
||||||
m_HoldGhost[c]->SetName( "HoldGhostArrow" );
|
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_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 )
|
for( int i = 0; i < m_iNumCols; ++i )
|
||||||
{
|
{
|
||||||
delete m_GhostDim[i];
|
delete m_Ghost[i];
|
||||||
delete m_GhostBright[i];
|
|
||||||
delete m_HoldGhost[i];
|
delete m_HoldGhost[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -59,29 +54,24 @@ void GhostArrowRow::Update( float fDeltaTime )
|
|||||||
{
|
{
|
||||||
for( int c=0; c<m_iNumCols; c++ )
|
for( int c=0; c<m_iNumCols; c++ )
|
||||||
{
|
{
|
||||||
m_GhostDim[c]->Update( fDeltaTime );
|
m_Ghost[c]->Update( fDeltaTime );
|
||||||
m_GhostBright[c]->Update( fDeltaTime );
|
|
||||||
m_HoldGhost[c]->Update( fDeltaTime );
|
m_HoldGhost[c]->Update( fDeltaTime );
|
||||||
|
|
||||||
const float fX = ArrowEffects::GetXPos( m_pPlayerState, c, 0 );
|
const float fX = ArrowEffects::GetXPos( m_pPlayerState, c, 0 );
|
||||||
const float fY = ArrowEffects::GetYPos( m_pPlayerState, c, 0, m_fYReverseOffsetPixels );
|
const float fY = ArrowEffects::GetYPos( m_pPlayerState, c, 0, m_fYReverseOffsetPixels );
|
||||||
const float fZ = ArrowEffects::GetZPos( m_pPlayerState, c, 0 );
|
const float fZ = ArrowEffects::GetZPos( m_pPlayerState, c, 0 );
|
||||||
|
|
||||||
m_GhostDim[c]->SetX( fX );
|
m_Ghost[c]->SetX( fX );
|
||||||
m_GhostBright[c]->SetX( fX );
|
|
||||||
m_HoldGhost[c]->SetX( fX );
|
m_HoldGhost[c]->SetX( fX );
|
||||||
|
|
||||||
m_GhostDim[c]->SetY( fY );
|
m_Ghost[c]->SetY( fY );
|
||||||
m_GhostBright[c]->SetY( fY );
|
|
||||||
m_HoldGhost[c]->SetY( fY );
|
m_HoldGhost[c]->SetY( fY );
|
||||||
|
|
||||||
m_GhostDim[c]->SetZ( fZ );
|
m_Ghost[c]->SetZ( fZ );
|
||||||
m_GhostBright[c]->SetZ( fZ );
|
|
||||||
m_HoldGhost[c]->SetZ( fZ );
|
m_HoldGhost[c]->SetZ( fZ );
|
||||||
|
|
||||||
const float fZoom = ArrowEffects::GetZoom( m_pPlayerState );
|
const float fZoom = ArrowEffects::GetZoom( m_pPlayerState );
|
||||||
m_GhostDim[c]->SetZoom( fZoom );
|
m_Ghost[c]->SetZoom( fZoom );
|
||||||
m_GhostBright[c]->SetZoom( fZoom );
|
|
||||||
m_HoldGhost[c]->SetZoom( fZoom );
|
m_HoldGhost[c]->SetZoom( fZoom );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -95,8 +85,7 @@ void GhostArrowRow::DrawPrimitives()
|
|||||||
|
|
||||||
NoteFieldMode::BeginDrawTrack( pn, c );
|
NoteFieldMode::BeginDrawTrack( pn, c );
|
||||||
|
|
||||||
m_GhostDim[c]->Draw();
|
m_Ghost[c]->Draw();
|
||||||
m_GhostBright[c]->Draw();
|
|
||||||
m_HoldGhost[c]->Draw();
|
m_HoldGhost[c]->Draw();
|
||||||
|
|
||||||
NoteFieldMode::EndDrawTrack( c );
|
NoteFieldMode::EndDrawTrack( c );
|
||||||
@@ -107,19 +96,26 @@ void GhostArrowRow::DrawPrimitives()
|
|||||||
void GhostArrowRow::DidTapNote( int iCol, TapNoteScore tns, bool bBright )
|
void GhostArrowRow::DidTapNote( int iCol, TapNoteScore tns, bool bBright )
|
||||||
{
|
{
|
||||||
ASSERT( iCol >= 0 && iCol < m_iNumCols );
|
ASSERT( iCol >= 0 && iCol < m_iNumCols );
|
||||||
|
|
||||||
|
m_Ghost[iCol]->PlayCommand( "Judgment" );
|
||||||
if( bBright )
|
if( bBright )
|
||||||
m_GhostBright[iCol]->StepTap( tns );
|
m_Ghost[iCol]->PlayCommand( "Bright" );
|
||||||
else
|
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 )
|
void GhostArrowRow::DidHoldNote( int iCol, HoldNoteScore hns, bool bBright )
|
||||||
{
|
{
|
||||||
ASSERT( iCol >= 0 && iCol < m_iNumCols );
|
ASSERT( iCol >= 0 && iCol < m_iNumCols );
|
||||||
|
m_Ghost[iCol]->PlayCommand( "Judgment" );
|
||||||
if( bBright )
|
if( bBright )
|
||||||
m_GhostBright[iCol]->StepHold( hns );
|
m_Ghost[iCol]->PlayCommand( "Bright" );
|
||||||
else
|
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 )
|
void GhostArrowRow::SetHoldIsActive( int iCol )
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
#define GHOSTARROWROW_H
|
#define GHOSTARROWROW_H
|
||||||
|
|
||||||
#include "ActorFrame.h"
|
#include "ActorFrame.h"
|
||||||
#include "GhostArrow.h"
|
|
||||||
#include "HoldGhostArrow.h"
|
#include "HoldGhostArrow.h"
|
||||||
#include "GameConstantsAndTypes.h"
|
#include "GameConstantsAndTypes.h"
|
||||||
|
|
||||||
@@ -29,8 +28,7 @@ protected:
|
|||||||
float m_fYReverseOffsetPixels;
|
float m_fYReverseOffsetPixels;
|
||||||
const PlayerState* m_pPlayerState;
|
const PlayerState* m_pPlayerState;
|
||||||
|
|
||||||
vector<GhostArrow *> m_GhostDim;
|
vector<Actor *> m_Ghost;
|
||||||
vector<GhostArrow *> m_GhostBright;
|
|
||||||
vector<HoldGhostArrow *> m_HoldGhost;
|
vector<HoldGhostArrow *> m_HoldGhost;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user