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