From 934b176bda24240963b28e42af0a41bfe1a88045 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 31 May 2005 07:29:58 +0000 Subject: [PATCH] don't use m_sID hackery --- stepmania/src/PaneDisplay.cpp | 18 +++++++++--------- stepmania/src/PaneDisplay.h | 2 +- stepmania/src/ScreenSelectMusic.cpp | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/stepmania/src/PaneDisplay.cpp b/stepmania/src/PaneDisplay.cpp index 926c2b3260..de539d8c55 100644 --- a/stepmania/src/PaneDisplay.cpp +++ b/stepmania/src/PaneDisplay.cpp @@ -14,10 +14,10 @@ #include "Foreach.h" #include "PercentageDisplay.h" -#define SHIFT_X(p) THEME->GetMetricF(m_sName, ssprintf("ShiftP%iX", p+1)) -#define SHIFT_Y(p) THEME->GetMetricF(m_sName, ssprintf("ShiftP%iY", p+1)) -#define NUM_ITEM_COLORS(s) THEME->GetMetricI(m_sName, ssprintf("%sNumLevels",s)) -#define ITEM_COLOR(s,n) THEME->GetMetric (m_sName, ssprintf("%sLevel%i",s,n+1)) +#define SHIFT_X(p) THEME->GetMetricF(sType, ssprintf("ShiftP%iX", p+1)) +#define SHIFT_Y(p) THEME->GetMetricF(sType, ssprintf("ShiftP%iY", p+1)) +#define NUM_ITEM_COLORS(s) THEME->GetMetricI(sType, ssprintf("%sNumLevels",s)) +#define ITEM_COLOR(s,n) THEME->GetMetric (sType, ssprintf("%sLevel%i",s,n+1)) enum { NEED_NOTES=1, NEED_COURSE=2, NEED_PROFILE=4 }; struct Content_t @@ -77,13 +77,13 @@ PaneDisplay::PaneDisplay() m_CurPane = PANE_INVALID; } -void PaneDisplay::Load( PlayerNumber pn ) +void PaneDisplay::Load( const CString &sType, PlayerNumber pn ) { m_PlayerNumber = pn; m_sprPaneUnder.Load( THEME->GetPathG("PaneDisplay",ssprintf("under p%i",pn+1)) ); m_sprPaneUnder->SetName( "Under" ); - ON_COMMAND( m_sprPaneUnder ); + ActorUtil::OnCommand( m_sprPaneUnder, sType ); this->AddChild( m_sprPaneUnder ); FOREACH_PaneContents(p) @@ -127,12 +127,12 @@ void PaneDisplay::Load( PlayerNumber pn ) m_textContents[p].LoadFromFont( THEME->GetPathF("PaneDisplay","text") ); m_textContents[p].SetName( ssprintf("%sText", g_Contents[p].name) ); - SET_XY_AND_ON_COMMAND( m_textContents[p] ); + ActorUtil::SetXYAndOnCommand( m_textContents[p], sType ); m_ContentsFrame.AddChild( &m_textContents[p] ); m_Labels[p].Load( THEME->GetPathG("PaneDisplay",CString(g_Contents[p].name)+" label") ); m_Labels[p]->SetName( ssprintf("%sLabel", g_Contents[p].name) ); - SET_XY_AND_ON_COMMAND( m_Labels[p] ); + ActorUtil::SetXYAndOnCommand( m_Labels[p], sType ); m_ContentsFrame.AddChild( m_Labels[p] ); } @@ -141,7 +141,7 @@ void PaneDisplay::Load( PlayerNumber pn ) m_sprPaneOver.Load( THEME->GetPathG("PaneDisplay",ssprintf("over p%i", pn+1)) ); m_sprPaneOver->SetName( "Over" ); - ON_COMMAND( m_sprPaneOver ); + ActorUtil::OnCommand( m_sprPaneOver, sType ); this->AddChild( m_sprPaneOver ); for( unsigned i = 0; i < NUM_PANE_CONTENTS; ++i ) diff --git a/stepmania/src/PaneDisplay.h b/stepmania/src/PaneDisplay.h index 996948a12b..3069dbe17c 100644 --- a/stepmania/src/PaneDisplay.h +++ b/stepmania/src/PaneDisplay.h @@ -63,7 +63,7 @@ class PaneDisplay: public ActorFrame public: PaneDisplay(); - void Load( PlayerNumber pn ); + void Load( const CString &sClass, PlayerNumber pn ); void SetFromGameState( SortOrder so ); void Update( float fDeltaTime ); diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index 0507ebe537..9a6a52100b 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -276,8 +276,8 @@ void ScreenSelectMusic::Init() if( SHOW_PANES ) { - m_PaneDisplay[p].SetName( "PaneDisplay", ssprintf("PaneDisplayP%d",p+1) ); - m_PaneDisplay[p].Load( p ); + m_PaneDisplay[p].SetName( ssprintf("PaneDisplayP%d",p+1) ); + m_PaneDisplay[p].Load( "PaneDisplay", p ); SET_XY( m_PaneDisplay[p] ); this->AddChild( &m_PaneDisplay[p] ); }