diff --git a/stepmania/src/ActorFrame.h b/stepmania/src/ActorFrame.h index 69f4a8a25e..33eb630092 100644 --- a/stepmania/src/ActorFrame.h +++ b/stepmania/src/ActorFrame.h @@ -20,6 +20,7 @@ public: virtual void RemoveChild( Actor *pActor ); void TransferChildren( ActorFrame *pTo ); Actor* GetChild( const RString &sName ); + vector GetChildren() { return m_SubActors; } int GetNumChildren() const { return m_SubActors.size(); } void RemoveAllChildren(); diff --git a/stepmania/src/ScreenWithMenuElements.cpp b/stepmania/src/ScreenWithMenuElements.cpp index 3137987e4f..69b758d390 100644 --- a/stepmania/src/ScreenWithMenuElements.cpp +++ b/stepmania/src/ScreenWithMenuElements.cpp @@ -78,11 +78,18 @@ void ScreenWithMenuElements::Init() /* Experimental: Load "decorations" and make them children of the screen. */ { - AutoActor decorations; - decorations.LoadB( m_sName, "decorations" ); - ActorFrame *pFrame = dynamic_cast((Actor*)decorations); + m_Decorations.LoadB( m_sName, "decorations" ); + ActorFrame *pFrame = dynamic_cast(static_cast(m_Decorations)); + vector children = pFrame->GetChildren(); if( pFrame ) - pFrame->TransferChildren( this ); + { + FOREACH( Actor*, children, child ) + this->AddChild( *child ); + } + else + { + m_Decorations.Unload(); + } } m_In.SetName( "In" ); diff --git a/stepmania/src/ScreenWithMenuElements.h b/stepmania/src/ScreenWithMenuElements.h index 5e9c4a082c..fc58be45a9 100644 --- a/stepmania/src/ScreenWithMenuElements.h +++ b/stepmania/src/ScreenWithMenuElements.h @@ -43,6 +43,7 @@ protected: MemoryCardDisplay *m_MemoryCardDisplay[NUM_PLAYERS]; MenuTimer *m_MenuTimer; AutoActor m_sprOverlay; + AutoActor m_Decorations; Transition m_In; Transition m_Out;