ActorScroller::LoadFromIni -> ActorScroller::LoadFromNode
This commit is contained in:
@@ -39,11 +39,11 @@ void ActorScroller::Load(
|
||||
m_bLoaded = true;
|
||||
}
|
||||
|
||||
void ActorScroller::LoadFromIni( const IniFile &ini, const CString &sKey )
|
||||
void ActorScroller::LoadFromNode( const CString &sFile, const XNode *pNode )
|
||||
{
|
||||
#define REQUIRED_GET_VALUE( szName, valueOut ) \
|
||||
if( !ini.GetValue( sKey, szName, valueOut ) ) \
|
||||
Dialog::OK( ssprintf("File '%s' is missing the value Scroller::%s", ini.GetPath().c_str(), szName) );
|
||||
if( !pNode->GetAttrValue( szName, valueOut ) ) \
|
||||
Dialog::OK( ssprintf("File '%s' is missing the value Scroller::%s", sFile.c_str(), szName) );
|
||||
|
||||
float fSecondsPerItem = 1;
|
||||
float fNumItemsToDraw = 7;
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
|
||||
#include "ActorFrame.h"
|
||||
|
||||
class IniFile;
|
||||
|
||||
struct XNode;
|
||||
class ActorScroller : public ActorFrame
|
||||
{
|
||||
public:
|
||||
@@ -23,7 +22,7 @@ public:
|
||||
virtual void Update( float fDelta );
|
||||
virtual void DrawPrimitives(); // DOES draw
|
||||
|
||||
void LoadFromIni( const IniFile &ini, const CString &sKey );
|
||||
void LoadFromNode( const CString &sFile, const XNode *pNode );
|
||||
void SetDestinationItem( int iItem ) { m_fDestinationItem = float(iItem); }
|
||||
void SetCurrentAndDestinationItem( int iItem ) { m_fCurrentItem = m_fDestinationItem = float(iItem); }
|
||||
|
||||
|
||||
@@ -149,11 +149,9 @@ void BGAnimation::LoadFromAniDir( const CString &_sAniDir )
|
||||
pBGAnimation = &dummy;
|
||||
LoadFromNode( sAniDir, *pBGAnimation );
|
||||
|
||||
bool bUseScroller;
|
||||
if( ini.GetValue( "BGAnimation", "UseScroller", bUseScroller ) && bUseScroller )
|
||||
{
|
||||
ActorScroller::LoadFromIni( ini, "Scroller" );
|
||||
}
|
||||
const XNode* pScrollerNode = ini.GetChild( "Scroller" );
|
||||
if( pScrollerNode != NULL )
|
||||
ActorScroller::LoadFromNode( ini.GetPath(), pScrollerNode );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user