use ActorUtil::GetWhere

This commit is contained in:
Glenn Maynard
2006-10-09 08:08:59 +00:00
parent 8e8a10f56c
commit f1ca420069
11 changed files with 27 additions and 28 deletions
+4 -4
View File
@@ -218,7 +218,7 @@ void Actor::LoadFromNode( const RString& sDir, const XNode* pNode )
/* If parameters are specified here, save their values to the actor. */
RString sName;
if( !pChild->GetAttrValue( "Name", sName ) )
RageException::Throw( "Input node in \"%s\" is missing the attribute \"Name\".", sDir.c_str() );
RageException::Throw( "%s: Input: missing the attribute \"Name\"", ActorUtil::GetWhere(pNode).c_str() );
bool bOptional = false;
pChild->GetAttrValue( "Optional", bOptional );
@@ -228,7 +228,7 @@ void Actor::LoadFromNode( const RString& sDir, const XNode* pNode )
ActorUtil::GetParam( L, sName );
if( lua_isnil(L, -1) && !bOptional )
RageException::Throw( "Actor in \"%s\" requires parameter \"%s\" that is not set.", sDir.c_str(), sName.c_str() );
RageException::Throw( "%s: Actor requires parameter \"%s\" that is not set", ActorUtil::GetWhere(pNode).c_str(), sName.c_str() );
lua_settable( L, -3 );
lua_pop( L, 1 );
@@ -238,13 +238,13 @@ void Actor::LoadFromNode( const RString& sDir, const XNode* pNode )
{
RString sName;
if( !pChild->GetAttrValue( "Name", sName ) )
Dialog::OK( ssprintf("Context node in '%s' is missing the attribute \"Name\"", sDir.c_str()), "MISSING_ATTRIBUTE" );
Dialog::OK( ssprintf("Context node in '%s' is missing the attribute \"Name\"", ActorUtil::GetWhere(pNode).c_str()), "MISSING_ATTRIBUTE" );
this->PushContext(L);
lua_pushstring( L, sName );
if( !pChild->PushAttrValue( L, "Value" ) )
Dialog::OK( ssprintf("Context node in '%s' is missing the attribute \"Value\"", sDir.c_str()), "MISSING_ATTRIBUTE" );
Dialog::OK( ssprintf("Context node in '%s' is missing the attribute \"Value\"", ActorUtil::GetWhere(pNode).c_str()), "MISSING_ATTRIBUTE" );
lua_settable( L, -3 );
lua_pop( L, 1 );
+2 -2
View File
@@ -111,8 +111,8 @@ void BitmapText::LoadFromNode( const RString& sDir, const XNode* pNode )
pNode->GetAttrValue( "File", sFont ); // accept "File" for backward compatibility
if( sFont == "" )
RageException::Throw( "An object \"%s\" in \"%s\" is missing the Font attribute.",
pNode->GetName().c_str(), sDir.c_str() );
RageException::Throw( "%s: BitmapText: missing the Font attribute",
ActorUtil::GetWhere(pNode).c_str() );
LoadFromFont( THEME->GetPathF( "", sFont ) );
SetText( sText, sAltText );
+4 -4
View File
@@ -25,17 +25,17 @@ void ComboGraph::LoadFromNode( const RString& sDir, const XNode* pNode )
m_pMaxComboText = (BitmapText *) this->GetChild( "MaxComboText" );
if( m_pMaxComboText == NULL )
RageException::Throw( "ComboGraph in \"%s\" must have a child named \"MaxComboText\".", sDir.c_str() );
RageException::Throw( "%s: ComboGraph: must have a child named \"MaxComboText\"", ActorUtil::GetWhere(pNode).c_str() );
if( !m_pMaxComboText->IsType("BitmapText") )
RageException::Throw( "ComboGraph in \"%s\" has a child named \"MaxComboText\" that is not a BitmapText.", sDir.c_str() );
RageException::Throw( "%s: ComboGraph: \"MaxComboText\" child is not a BitmapText", ActorUtil::GetWhere(pNode).c_str() );
m_pNormalCombo = this->GetChild( "NormalCombo" );
if( m_pNormalCombo == NULL )
RageException::Throw( "ComboGraph in \"%s\" must have a child named \"NormalCombo\".", sDir.c_str() );
RageException::Throw( "%s: ComboGraph: must have a child named \"NormalCombo\"", ActorUtil::GetWhere(pNode).c_str() );
m_pMaxCombo = this->GetChild( "MaxCombo" );
if( m_pMaxCombo == NULL )
RageException::Throw( "ComboGraph in \"%s\" must have a child named \"MaxCombo\".", sDir.c_str() );
RageException::Throw( "%s: ComboGraph: must have a child named \"MaxCombo\"", ActorUtil::GetWhere(pNode).c_str() );
}
void ComboGraph::Load( const StageStats &s, const PlayerStageStats &pss )
+1 -1
View File
@@ -45,7 +45,7 @@ void DifficultyIcon::LoadFromNode( const RString& sDir, const XNode* pNode )
{
RString sFile;
if( !ActorUtil::GetAttrPath(pNode, "File", sFile) )
RageException::Throw( "MeterDisplay in \"%s\" missing \"File\" attribute.", sDir.c_str() );
RageException::Throw( "%s: DifficultyIcon: missing the \"File\" attribute.", ActorUtil::GetWhere(pNode).c_str() );
ActorUtil::ResolvePath( sFile, sDir );
+2 -2
View File
@@ -44,7 +44,7 @@ void DifficultyList::LoadFromNode( const RString& sDir, const XNode* pNode )
{
const XNode *pChild = pNode->GetChild( ssprintf("CursorP%i",pn+1) );
if( pChild == NULL )
RageException::Throw( "ComboGraph in \"%s\" is missing the node \"CursorP%d\".", sDir.c_str(), pn+1 );
RageException::Throw( "%s: ComboGraph: missing the node \"CursorP%d\"", ActorUtil::GetWhere(pNode).c_str(), pn+1 );
m_Cursors[pn].LoadFromNode( sDir, pChild );
/* Hack: we need to tween cursors both up to down (cursor motion) and visible to
@@ -55,7 +55,7 @@ void DifficultyList::LoadFromNode( const RString& sDir, const XNode* pNode )
* colors; I think we do need a diffuse color stack ... */
pChild = pNode->GetChild( ssprintf("CursorP%iFrame",pn+1) );
if( pChild == NULL )
RageException::Throw( "ComboGraph in \"%s\" is missing the node \"CursorP%dFrame\".", sDir.c_str(), pn+1 );
RageException::Throw( "%s: ComboGraph: missing the node \"CursorP%dFrame\"", ActorUtil::GetWhere(pNode).c_str(), pn+1 );
m_CursorFrames[pn].LoadFromNode( sDir, pChild );
m_CursorFrames[pn].AddChild( m_Cursors[pn] );
this->AddChild( &m_CursorFrames[pn] );
+1 -1
View File
@@ -19,7 +19,7 @@ void DynamicActorScroller::LoadFromNode( const RString &sDir, const XNode *pNode
* Make one extra copy if masking is enabled.
*/
if( m_SubActors.size() != 1 )
RageException::Throw( "DynamicActorScroller in \"%s\" loaded %i nodes; require exactly one.", sDir.c_str(), (int)m_SubActors.size() );
RageException::Throw( "%s: DynamicActorScroller: loaded %i nodes; require exactly one", ActorUtil::GetWhere(pNode).c_str(), (int)m_SubActors.size() );
int iNumCopies = (int) m_fNumItemsToDraw;
if( !m_quadMask.GetHidden() )
+5 -5
View File
@@ -157,13 +157,13 @@ void GraphDisplay::LoadFromNode( const RString& sDir, const XNode* pNode )
const XNode *pChild = pNode->GetChild( "Body" );
if( pChild == NULL )
RageException::Throw( "ComboGraph in \"%s\" is missing the node \"Body\".", sDir.c_str() );
RageException::Throw( "%s: ComboGraph: missing the node \"Body\"", ActorUtil::GetWhere(pNode).c_str() );
m_pGraphBody->LoadFromNode( sDir, pChild );
this->AddChild( m_pGraphBody );
pChild = pNode->GetChild( "Texture" );
if( pChild == NULL )
RageException::Throw( "ComboGraph in \"%s\" is missing the node \"Texture\".", sDir.c_str() );
RageException::Throw( "%s: ComboGraph: missing the node \"Texture\"", ActorUtil::GetWhere(pNode).c_str() );
m_sprTexture.LoadFromNode( sDir, pChild );
m_size.x = m_sprTexture->GetUnzoomedWidth();
m_size.y = m_sprTexture->GetUnzoomedHeight();
@@ -171,18 +171,18 @@ void GraphDisplay::LoadFromNode( const RString& sDir, const XNode* pNode )
pChild = pNode->GetChild( "Line" );
if( pChild == NULL )
RageException::Throw( "ComboGraph in \"%s\" is missing the node \"Line\".", sDir.c_str() );
RageException::Throw( "%s: ComboGraph: missing the node \"Line\"", ActorUtil::GetWhere(pNode).c_str() );
m_pGraphLine->LoadFromNode( sDir, pChild );
this->AddChild( m_pGraphLine );
pChild = pNode->GetChild( "SongBoundary" );
if( pChild == NULL )
RageException::Throw( "ComboGraph in \"%s\" is missing the node \"SongBoundary\".", sDir.c_str() );
RageException::Throw( "%s: ComboGraph: missing the node \"SongBoundary\"", ActorUtil::GetWhere(pNode).c_str() );
m_sprSongBoundary.LoadFromNode( sDir, pChild );
pChild = pNode->GetChild( "Barely" );
if( pChild == NULL )
RageException::Throw( "ComboGraph in \"%s\" is missing the node \"Barely\".", sDir.c_str() );
RageException::Throw( "%s: ComboGraph: missing the node \"Barely\"", ActorUtil::GetWhere(pNode).c_str() );
m_sprJustBarely.LoadFromNode( sDir, pChild );
}
+1 -1
View File
@@ -29,7 +29,7 @@ void HoldJudgment::LoadFromNode( const RString& sDir, const XNode* pNode )
{
RString sFile;
if( ActorUtil::GetAttrPath(pNode, "File", sFile) )
RageException::Throw( "HoldJudgment node in \"%s\" is missing the attribute \"File\"", sDir.c_str() );
RageException::Throw( "%s: HoldJudgment: missing the attribute \"File\"", ActorUtil::GetWhere(pNode).c_str() );
CollapsePath( sFile );
+3 -4
View File
@@ -31,17 +31,16 @@ void MeterDisplay::Load( RString sStreamPath, float fStreamWidth, RString sTipPa
void MeterDisplay::LoadFromNode( const RString& sDir, const XNode* pNode )
{
LOG->Trace( "MeterDisplay::LoadFromNode(%s,node)", sDir.c_str() );
LOG->Trace( "MeterDisplay::LoadFromNode(%s,node)", ActorUtil::GetWhere(pNode).c_str() );
RString sExpr;
if( !pNode->GetAttrValue( "StreamWidth", sExpr ) )
RageException::Throw( "MeterDisplay in \"%s\" is missing the \"StreamWidth\" attribute.", sDir.c_str() );
m_fStreamWidth = LuaHelpers::RunExpressionF( sExpr );
RageException::Throw( "%s: MeterDisplay: missing the \"StreamWidth\" attribute", ActorUtil::GetWhere(pNode).c_str() );
{
RString sStreamPath;
if( !ActorUtil::GetAttrPath(pNode, "StreamPath", sStreamPath) )
RageException::Throw( "MeterDisplay in \"%s\" is missing the \"StreamPath\" attribute.", sDir.c_str() );
RageException::Throw( "%s: MeterDisplay: missing the \"StreamPath\" attribute", ActorUtil::GetWhere(pNode).c_str() );
ActorUtil::ResolvePath( sStreamPath, sDir );
+2 -2
View File
@@ -38,7 +38,7 @@ void PercentageDisplay::LoadFromNode( const RString& sDir, const XNode* pNode )
const XNode *pChild = pNode->GetChild( "Percent" );
if( pChild == NULL )
RageException::Throw( "PercentageDisplay in \"%s\" is missing the node \"Percent\".", sDir.c_str() );
RageException::Throw( "%s: PercentageDisplay: missing the node \"Percent\"", ActorUtil::GetWhere(pNode).c_str() );
m_textPercent.LoadFromNode( sDir, pChild );
this->AddChild( &m_textPercent );
@@ -46,7 +46,7 @@ void PercentageDisplay::LoadFromNode( const RString& sDir, const XNode* pNode )
{
const XNode *pChild = pNode->GetChild( "PercentRemainder" );
if( pChild == NULL )
RageException::Throw( "ComboGraph in \"%s\" is missing the node \"PercentRemainder\".", sDir.c_str() );
RageException::Throw( "%s: ComboGraph: missing the node \"PercentRemainder\"", ActorUtil::GetWhere(pNode).c_str() );
m_textPercentRemainder.LoadFromNode( sDir, pChild );
this->AddChild( &m_textPercentRemainder );
}
+2 -2
View File
@@ -133,8 +133,8 @@ void Sprite::LoadFromNode( const RString& sDir, const XNode* pNode )
if( !pNode->GetAttrValue(sFrameKey, newState.iFrameIndex) )
break;
if( newState.iFrameIndex >= m_pTexture->GetNumFrames() )
RageException::Throw( "In \"%s\", %s is %d, but the texture \"%s\" only has %d frames.",
sDir.c_str(), sFrameKey.c_str(), newState.iFrameIndex, sPath.c_str(), m_pTexture->GetNumFrames() );
RageException::Throw( "%s: %s is %d, but the texture \"%s\" only has %d frames",
ActorUtil::GetWhere(pNode).c_str(), sFrameKey.c_str(), newState.iFrameIndex, sPath.c_str(), m_pTexture->GetNumFrames() );
if( !pNode->GetAttrValue(sDelayKey, newState.fDelay) )
break;