From 05fb09323e6dc324976bb565fc8afd6a8be6ca63 Mon Sep 17 00:00:00 2001 From: Kyzentun Date: Wed, 4 Mar 2015 21:24:33 -0700 Subject: [PATCH] Changed decorations layer back to being a frame that is stripped of its actors. According to ancient commit logs, it was like that to allow controlling the draworder of decorations relative to other screen children. --- src/ScreenWithMenuElements.cpp | 17 +++++++++++------ src/ScreenWithMenuElements.h | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/ScreenWithMenuElements.cpp b/src/ScreenWithMenuElements.cpp index 88dd8f88f6..e935cd31ef 100644 --- a/src/ScreenWithMenuElements.cpp +++ b/src/ScreenWithMenuElements.cpp @@ -79,14 +79,17 @@ void ScreenWithMenuElements::Init() // decorations { - m_Decorations.LoadB( m_sName, "decorations" ); - m_Decorations->SetName("Decorations"); - m_Decorations->SetDrawOrder( DRAW_ORDER_DECORATIONS ); - ActorFrame *pFrame = dynamic_cast(static_cast(m_Decorations)); + AutoActor decorations; + decorations.LoadB( m_sName, "decorations" ); + decorations->SetName("Decorations"); + decorations->SetDrawOrder( DRAW_ORDER_DECORATIONS ); + ActorFrame *pFrame = dynamic_cast(static_cast(decorations)); if( pFrame ) { - this->AddChild(m_Decorations); - LOAD_ALL_COMMANDS(m_Decorations); + m_vDecorations = pFrame->GetChildren(); + FOREACH( Actor*, m_vDecorations, child ) + this->AddChild( *child ); + pFrame->RemoveAllChildren(); } } @@ -164,6 +167,8 @@ ScreenWithMenuElements::~ScreenWithMenuElements() if( m_MemoryCardDisplay[p] != NULL ) SAFE_DELETE( m_MemoryCardDisplay[p] ); } + FOREACH( Actor*, m_vDecorations, actor ) + delete *actor; } void ScreenWithMenuElements::SetHelpText( RString s ) diff --git a/src/ScreenWithMenuElements.h b/src/ScreenWithMenuElements.h index f424d35bbd..3b5497e49e 100644 --- a/src/ScreenWithMenuElements.h +++ b/src/ScreenWithMenuElements.h @@ -45,7 +45,7 @@ protected: MemoryCardDisplay *m_MemoryCardDisplay[NUM_PLAYERS]; MenuTimer *m_MenuTimer; AutoActor m_sprOverlay; - AutoActor m_Decorations; + vector m_vDecorations; Transition m_In; Transition m_Out;