From d1c2e3ad02727073fb1e54ff602532f584f403ac Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Fri, 6 Jul 2012 13:09:18 -0500 Subject: [PATCH] [ScoreDisplayRave] Add FrameBase and FrameOver to the metrics. --- Docs/Changelog_sm5.txt | 4 + Themes/_fallback/metrics.ini | 18 ++++ src/ScoreDisplayRave.cpp | 186 ++++++++++++++++++----------------- 3 files changed, 117 insertions(+), 91 deletions(-) diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index 9d4b07e5bf..f733ebb2d8 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -8,6 +8,10 @@ ________________________________________________________________________________ StepMania 5.0 ???? ?? | 20120??? -------------------------------------------------------------------------------- +2012/07/06 +---------- +* [ScoreDisplayRave] Add FrameBase and FrameOver to the metrics. [AJ] + 2012/07/05 ---------- * [ScreenRanking] Added "NextPage" command. "SwitchPage" command is diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index 8522a7f214..ff96f720be 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -1322,6 +1322,24 @@ LevelP2Y= LevelP2OnCommand= LevelP2OffCommand= +FrameBaseP1X= +FrameBaseP1Y= +FrameBaseP1OnCommand= +FrameBaseP1OffCommand= +FrameBaseP2X= +FrameBaseP2Y= +FrameBaseP2OnCommand= +FrameBaseP2OffCommand= + +FrameOverP1X= +FrameOverP1Y= +FrameOverP1OnCommand= +FrameOverP1OffCommand= +FrameOverP2X= +FrameOverP2Y= +FrameOverP2OnCommand= +FrameOverP2OffCommand= + [ScoreKeeperRave] AttackDurationSeconds=3.0 diff --git a/src/ScoreDisplayRave.cpp b/src/ScoreDisplayRave.cpp index 6efb893474..7154a1dc9b 100644 --- a/src/ScoreDisplayRave.cpp +++ b/src/ScoreDisplayRave.cpp @@ -1,91 +1,95 @@ -#include "global.h" -#include "ScoreDisplayRave.h" -#include "RageUtil.h" -#include "RageLog.h" -#include "ThemeManager.h" -#include "ActorUtil.h" -#include "PlayerState.h" - - -ScoreDisplayRave::ScoreDisplayRave() -{ - LOG->Trace( "ScoreDisplayRave::ScoreDisplayRave()" ); - - m_lastLevelSeen = ATTACK_LEVEL_1; - - for( int i=0; iGetPathG("ScoreDisplayRave",ssprintf("stream level%d",i+1)) ); - m_sprMeter[i].SetCropRight( 1.f ); - } - - m_textLevel.LoadFromFont( THEME->GetPathF("ScoreDisplayRave","level") ); - m_textLevel.SetText( "1" ); -} - -void ScoreDisplayRave::Init( const PlayerState* pPlayerState, const PlayerStageStats* pPlayerStageStats ) -{ - ScoreDisplay::Init( pPlayerState, pPlayerStageStats ); - - PlayerNumber pn = pPlayerState->m_PlayerNumber; - - m_sprFrameBase.Load( THEME->GetPathG("ScoreDisplayRave",ssprintf("frame base p%d",pn+1)) ); - this->AddChild( m_sprFrameBase ); - - for( int i=0; iAddChild( &m_sprMeter[i] ); - } - - m_textLevel.SetName( ssprintf("LevelP%d",pn+1) ); - LOAD_ALL_COMMANDS_AND_SET_XY( m_textLevel ); - this->AddChild( &m_textLevel ); - - m_sprFrameOverlay.Load( THEME->GetPathG("ScoreDisplayRave",ssprintf("frame overlay p%d",pn+1)) ); - this->AddChild( m_sprFrameOverlay ); -} - -void ScoreDisplayRave::Update( float fDelta ) -{ - ScoreDisplay::Update( fDelta ); - - float fLevel = m_pPlayerState->m_fSuperMeter; - AttackLevel level = (AttackLevel)(int)fLevel; - - if( level != m_lastLevelSeen ) - { - m_sprMeter[m_lastLevelSeen].SetCropRight( 1.f ); - m_lastLevelSeen = level; - m_textLevel.SetText( ssprintf("%d",level+1) ); - } - - float fPercent = fLevel - level; - m_sprMeter[level].SetCropRight( 1-fPercent ); -} - -/* - * (c) 2003 Chris Danford - * All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, and/or sell copies of the Software, and to permit persons to - * whom the Software is furnished to do so, provided that the above - * copyright notice(s) and this permission notice appear in all copies of - * the Software and that both the above copyright notice(s) and this - * permission notice appear in supporting documentation. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF - * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS - * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT - * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS - * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ +#include "global.h" +#include "ScoreDisplayRave.h" +#include "RageUtil.h" +#include "RageLog.h" +#include "ThemeManager.h" +#include "ActorUtil.h" +#include "PlayerState.h" + + +ScoreDisplayRave::ScoreDisplayRave() +{ + LOG->Trace( "ScoreDisplayRave::ScoreDisplayRave()" ); + + m_lastLevelSeen = ATTACK_LEVEL_1; + + for( int i=0; iGetPathG("ScoreDisplayRave",ssprintf("stream level%d",i+1)) ); + m_sprMeter[i].SetCropRight( 1.f ); + } + + m_textLevel.LoadFromFont( THEME->GetPathF("ScoreDisplayRave","level") ); + m_textLevel.SetText( "1" ); +} + +void ScoreDisplayRave::Init( const PlayerState* pPlayerState, const PlayerStageStats* pPlayerStageStats ) +{ + ScoreDisplay::Init( pPlayerState, pPlayerStageStats ); + + PlayerNumber pn = pPlayerState->m_PlayerNumber; + + m_sprFrameBase.Load( THEME->GetPathG("ScoreDisplayRave",ssprintf("frame base p%d",pn+1)) ); + m_sprFrameBase->SetName( ssprintf("FrameBaseP%d",pn+1) ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprFrameBase ); + this->AddChild( m_sprFrameBase ); + + for( int i=0; iAddChild( &m_sprMeter[i] ); + } + + m_textLevel.SetName( ssprintf("LevelP%d",pn+1) ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_textLevel ); + this->AddChild( &m_textLevel ); + + m_sprFrameOverlay.Load( THEME->GetPathG("ScoreDisplayRave",ssprintf("frame overlay p%d",pn+1)) ); + m_sprFrameOverlay->SetName( ssprintf("FrameOverP%d",pn+1) ); + LOAD_ALL_COMMANDS_AND_SET_XY( m_sprFrameOverlay ); + this->AddChild( m_sprFrameOverlay ); +} + +void ScoreDisplayRave::Update( float fDelta ) +{ + ScoreDisplay::Update( fDelta ); + + float fLevel = m_pPlayerState->m_fSuperMeter; + AttackLevel level = (AttackLevel)(int)fLevel; + + if( level != m_lastLevelSeen ) + { + m_sprMeter[m_lastLevelSeen].SetCropRight( 1.f ); + m_lastLevelSeen = level; + m_textLevel.SetText( ssprintf("%d",level+1) ); + } + + float fPercent = fLevel - level; + m_sprMeter[level].SetCropRight( 1-fPercent ); +} + +/* + * (c) 2003 Chris Danford + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, and/or sell copies of the Software, and to permit persons to + * whom the Software is furnished to do so, provided that the above + * copyright notice(s) and this permission notice appear in all copies of + * the Software and that both the above copyright notice(s) and this + * permission notice appear in supporting documentation. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF + * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS + * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT + * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */