experimental: load 'decorations' BGAnimation and make decorations children of the Screen so that their draworder relative to other children of the Screen can be controlled
This commit is contained in:
@@ -121,7 +121,7 @@ void ActorFrame::LoadChildrenFromNode( const XNode* pNode )
|
|||||||
SortByDrawOrder();
|
SortByDrawOrder();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActorFrame::AddChild( Actor* pActor )
|
void ActorFrame::AddChild( Actor *pActor )
|
||||||
{
|
{
|
||||||
#if _DEBUG
|
#if _DEBUG
|
||||||
// check that this Actor isn't already added.
|
// check that this Actor isn't already added.
|
||||||
@@ -137,13 +137,20 @@ void ActorFrame::AddChild( Actor* pActor )
|
|||||||
pActor->SetParent( this );
|
pActor->SetParent( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActorFrame::RemoveChild( Actor* pActor )
|
void ActorFrame::RemoveChild( Actor *pActor )
|
||||||
{
|
{
|
||||||
vector<Actor*>::iterator iter = find( m_SubActors.begin(), m_SubActors.end(), pActor );
|
vector<Actor*>::iterator iter = find( m_SubActors.begin(), m_SubActors.end(), pActor );
|
||||||
if( iter != m_SubActors.end() )
|
if( iter != m_SubActors.end() )
|
||||||
m_SubActors.erase( iter );
|
m_SubActors.erase( iter );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ActorFrame::TransferChildren( ActorFrame *pTo )
|
||||||
|
{
|
||||||
|
FOREACH( Actor*, m_SubActors, i )
|
||||||
|
pTo->AddChild( *i );
|
||||||
|
RemoveAllChildren();
|
||||||
|
}
|
||||||
|
|
||||||
Actor* ActorFrame::GetChild( const RString &sName )
|
Actor* ActorFrame::GetChild( const RString &sName )
|
||||||
{
|
{
|
||||||
FOREACH( Actor*, m_SubActors, a )
|
FOREACH( Actor*, m_SubActors, a )
|
||||||
|
|||||||
@@ -16,8 +16,9 @@ public:
|
|||||||
void LoadFromNode( const XNode* pNode );
|
void LoadFromNode( const XNode* pNode );
|
||||||
virtual ActorFrame *Copy() const;
|
virtual ActorFrame *Copy() const;
|
||||||
|
|
||||||
virtual void AddChild( Actor* pActor );
|
virtual void AddChild( Actor *pActor );
|
||||||
virtual void RemoveChild( Actor* pActor );
|
virtual void RemoveChild( Actor *pActor );
|
||||||
|
void TransferChildren( ActorFrame *pTo );
|
||||||
Actor* GetChild( const RString &sName );
|
Actor* GetChild( const RString &sName );
|
||||||
int GetNumChildren() const { return m_SubActors.size(); }
|
int GetNumChildren() const { return m_SubActors.size(); }
|
||||||
|
|
||||||
|
|||||||
@@ -93,6 +93,15 @@ void ScreenWithMenuElements::Init()
|
|||||||
this->AddChild( m_sprOverlay );
|
this->AddChild( m_sprOverlay );
|
||||||
LOAD_ALL_COMMANDS( m_sprOverlay );
|
LOAD_ALL_COMMANDS( m_sprOverlay );
|
||||||
|
|
||||||
|
/* Experimental: Load "decorations" and make them children of the screen. */
|
||||||
|
{
|
||||||
|
AutoActor decorations;
|
||||||
|
decorations.Load( THEME->GetPathB(m_sName,"decorations") );
|
||||||
|
ActorFrame *pFrame = dynamic_cast<ActorFrame*>((Actor*)decorations);
|
||||||
|
if( pFrame )
|
||||||
|
pFrame->TransferChildren( this );
|
||||||
|
}
|
||||||
|
|
||||||
m_In.SetName( "In" );
|
m_In.SetName( "In" );
|
||||||
m_In.Load( THEME->GetPathB(m_sName,"in") );
|
m_In.Load( THEME->GetPathB(m_sName,"in") );
|
||||||
m_In.SetDrawOrder( DRAW_ORDER_TRANSITIONS );
|
m_In.SetDrawOrder( DRAW_ORDER_TRANSITIONS );
|
||||||
|
|||||||
Reference in New Issue
Block a user