diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index fb8f6a3dbd..d99794ac59 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -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 ); diff --git a/stepmania/src/BitmapText.cpp b/stepmania/src/BitmapText.cpp index 3d5f3946ac..93ebafb7e6 100644 --- a/stepmania/src/BitmapText.cpp +++ b/stepmania/src/BitmapText.cpp @@ -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 ); diff --git a/stepmania/src/ComboGraph.cpp b/stepmania/src/ComboGraph.cpp index b2cbe0bdef..4ef8c60f8f 100644 --- a/stepmania/src/ComboGraph.cpp +++ b/stepmania/src/ComboGraph.cpp @@ -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 ) diff --git a/stepmania/src/DifficultyIcon.cpp b/stepmania/src/DifficultyIcon.cpp index 36b4592a05..6cc3d0166b 100644 --- a/stepmania/src/DifficultyIcon.cpp +++ b/stepmania/src/DifficultyIcon.cpp @@ -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 ); diff --git a/stepmania/src/DifficultyList.cpp b/stepmania/src/DifficultyList.cpp index 1d4c1cd9fd..e4597b22b1 100644 --- a/stepmania/src/DifficultyList.cpp +++ b/stepmania/src/DifficultyList.cpp @@ -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] ); diff --git a/stepmania/src/DynamicActorScroller.cpp b/stepmania/src/DynamicActorScroller.cpp index a189522e5e..b691cbad25 100644 --- a/stepmania/src/DynamicActorScroller.cpp +++ b/stepmania/src/DynamicActorScroller.cpp @@ -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() ) diff --git a/stepmania/src/GraphDisplay.cpp b/stepmania/src/GraphDisplay.cpp index 30d022aed1..f6481489c7 100644 --- a/stepmania/src/GraphDisplay.cpp +++ b/stepmania/src/GraphDisplay.cpp @@ -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 ); } diff --git a/stepmania/src/HoldJudgment.cpp b/stepmania/src/HoldJudgment.cpp index 9835311e10..d611db0333 100644 --- a/stepmania/src/HoldJudgment.cpp +++ b/stepmania/src/HoldJudgment.cpp @@ -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 ); diff --git a/stepmania/src/MeterDisplay.cpp b/stepmania/src/MeterDisplay.cpp index ecc79b3cdf..d9c81102c0 100644 --- a/stepmania/src/MeterDisplay.cpp +++ b/stepmania/src/MeterDisplay.cpp @@ -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 ); diff --git a/stepmania/src/PercentageDisplay.cpp b/stepmania/src/PercentageDisplay.cpp index ac0568404c..3afc421ff4 100644 --- a/stepmania/src/PercentageDisplay.cpp +++ b/stepmania/src/PercentageDisplay.cpp @@ -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 ); } diff --git a/stepmania/src/Sprite.cpp b/stepmania/src/Sprite.cpp index 68d72a8d3c..c56588b322 100644 --- a/stepmania/src/Sprite.cpp +++ b/stepmania/src/Sprite.cpp @@ -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;