11using System ;
22using System . Collections . Generic ;
3- using System . Runtime . InteropServices ;
43using System . Threading ;
54using AET . ModVerify . Reporting ;
65using AET . ModVerify . Settings ;
1716using PG . StarWarsGame . Files . ALO . Files . Particles ;
1817using PG . StarWarsGame . Files . Binary ;
1918
20- #if NETSTANDARD2_0 || NETFRAMEWORK
21- using AnakinRaW . CommonUtilities . FileSystem ;
22- #endif
23-
2419namespace AET . ModVerify . Verifiers . Commons ;
2520
2621public sealed class SingleModelVerifier : GameVerifierBase
@@ -230,9 +225,11 @@ private void VerifyModelClass(ModelClass modelClass, IReadOnlyCollection<string>
230225
231226 private void VerifyParticle ( IAloParticleFile file , IReadOnlyCollection < string > contextInfo )
232227 {
228+ IReadOnlyList < string > particleContext = [ .. contextInfo , NormalizeFileName ( file . FileName ) ] ;
229+
233230 foreach ( var texture in file . Content . Textures )
234231 {
235- GuardedVerify ( ( ) => VerifyTextureExists ( file , texture , contextInfo ) ,
232+ GuardedVerify ( ( ) => VerifyTextureExists ( texture , particleContext ) ,
236233 e => e is ArgumentException ,
237234 _ =>
238235 {
@@ -241,7 +238,7 @@ private void VerifyParticle(IAloParticleFile file, IReadOnlyCollection<string> c
241238 VerifierErrorCodes . InvalidFilePath ,
242239 $ "Invalid texture file name '{ texture } ' in particle '{ file . FileName } '",
243240 VerificationSeverity . Error ,
244- [ NormalizeFileName ( file . FileName ) ] ,
241+ particleContext ,
245242 texture ) ) ;
246243 } ) ;
247244 }
@@ -256,7 +253,7 @@ private void VerifyParticle(IAloParticleFile file, IReadOnlyCollection<string> c
256253 VerifierErrorCodes . InvalidParticleName ,
257254 $ "The particle name '{ file . Content . Name } ' does not match file name '{ file . FileName } '",
258255 VerificationSeverity . Error ,
259- [ NormalizeFileName ( file . FileName ) ] ,
256+ particleContext ,
260257 file . Content . Name ) ) ;
261258 }
262259
@@ -268,7 +265,7 @@ private void VerifyModel(IAloModelFile file, AnimationCollection animations, IRe
268265
269266 foreach ( var texture in file . Content . Textures )
270267 {
271- GuardedVerify ( ( ) => VerifyTextureExists ( file , texture , modelContext ) ,
268+ GuardedVerify ( ( ) => VerifyTextureExists ( texture , modelContext ) ,
272269 e => e is ArgumentException ,
273270 _ =>
274271 {
@@ -330,11 +327,11 @@ private void VerifyAnimation(IAloAnimationFile file, IReadOnlyCollection<string>
330327 // Is there actually anything to verify for animation without looking at the model?
331328 }
332329
333- private void VerifyTextureExists ( IPetroglyphFileHolder model , string texture , IReadOnlyCollection < string > contextInfo )
330+ private void VerifyTextureExists ( string texture , IReadOnlyCollection < string > contextInfo )
334331 {
335332 if ( texture == "None" )
336333 return ;
337- _textureVerifier . Verify ( texture , [ ..contextInfo , NormalizeFileName ( model . FileName ) ] , CancellationToken . None ) ;
334+ _textureVerifier . Verify ( texture , [ ..contextInfo ] , CancellationToken . None ) ;
338335 }
339336
340337 private void VerifyProxyExists ( IPetroglyphFileHolder model , string proxy , IReadOnlyCollection < string > contextInfo , CancellationToken token )
0 commit comments