From ca877a00c520f453b6a6f47453c460bdcef0b8bb Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 3 May 2007 23:26:22 +0000 Subject: [PATCH] GradesShowMachine metric --- stepmania/Themes/default/metrics.ini | 1 + stepmania/src/MusicWheelItem.cpp | 18 ++++++++++++------ stepmania/src/MusicWheelItem.h | 3 +++ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index d89705cbe0..9e3ef95ff6 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -1711,6 +1711,7 @@ GradeP1X=90 GradeP1Y=0 GradeP2X=110 GradeP2Y=0 +GradesShowMachine=true [WheelNotifyIcon] ShowTraining=true diff --git a/stepmania/src/MusicWheelItem.cpp b/stepmania/src/MusicWheelItem.cpp index 121fc7c75b..0948d29f34 100644 --- a/stepmania/src/MusicWheelItem.cpp +++ b/stepmania/src/MusicWheelItem.cpp @@ -26,6 +26,8 @@ WheelItemData::WheelItemData( WheelItemType wit, Song* pSong, RString sSectionNa MusicWheelItem::MusicWheelItem( RString sType ): WheelItemBase( sType ) { + GRADES_SHOW_MACHINE.Load( sType, "GradesShowMachine" ); + data = NULL; m_sprSongBar.Load( THEME->GetPathG(sType,"song") ); @@ -100,6 +102,7 @@ MusicWheelItem::MusicWheelItem( RString sType ): MusicWheelItem::MusicWheelItem( const MusicWheelItem &cpy ): WheelItemBase( cpy ), + GRADES_SHOW_MACHINE( cpy.GRADES_SHOW_MACHINE ), m_sprSongBar( cpy.m_sprSongBar ), m_sprSectionBar( cpy.m_sprSectionBar ), m_sprExpandedBar( cpy.m_sprExpandedBar ), @@ -286,12 +289,10 @@ void MusicWheelItem::RefreshGrades() return; // LoadFromWheelItemData() hasn't been called yet. FOREACH_HumanPlayer( p ) { - if( data->m_pSong == NULL ) - { - m_pGradeDisplay[p]->SetVisible( false ); + m_pGradeDisplay[p]->SetVisible( false ); + + if( data->m_pSong == NULL && data->m_pCourse == NULL ) continue; - } - m_pGradeDisplay[p]->SetVisible( true ); Difficulty dc; if( GAMESTATE->m_pCurSteps[p] ) @@ -301,10 +302,15 @@ void MusicWheelItem::RefreshGrades() else dc = GAMESTATE->m_PreferredDifficulty[p]; - ProfileSlot ps = ProfileSlot_Machine; + ProfileSlot ps; if( PROFILEMAN->IsPersistentProfile(p) ) ps = (ProfileSlot)p; + else if( GRADES_SHOW_MACHINE ) + ps = ProfileSlot_Machine; + else + continue; + m_pGradeDisplay[p]->SetVisible( true ); Grade g = PROFILEMAN->GetGradeForSteps( data->m_pSong, GAMESTATE->GetCurrentStyle(), ps, dc ); Message msg("SetGrade"); msg.SetParam( "PlayerNumber", p ); diff --git a/stepmania/src/MusicWheelItem.h b/stepmania/src/MusicWheelItem.h index da0e2667d8..e04e0cbcc2 100644 --- a/stepmania/src/MusicWheelItem.h +++ b/stepmania/src/MusicWheelItem.h @@ -11,6 +11,7 @@ #include "GameCommand.h" #include "WheelItemBase.h" #include "AutoActor.h" +#include "ThemeMetric.h" class Course; class Song; @@ -32,6 +33,8 @@ public: const WheelItemData *data; private: + ThemeMetric GRADES_SHOW_MACHINE; + AutoActor m_sprSongBar; AutoActor m_sprSectionBar; AutoActor m_sprExpandedBar;