Skip to content

Commit 5519163

Browse files
committed
fix reporting of missing texutres
1 parent abce4b1 commit 5519163

1 file changed

Lines changed: 8 additions & 11 deletions

File tree

src/ModVerify/Verifiers/Commons/SingleModelVerifier.cs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using System.Collections.Generic;
3-
using System.Runtime.InteropServices;
43
using System.Threading;
54
using AET.ModVerify.Reporting;
65
using AET.ModVerify.Settings;
@@ -17,10 +16,6 @@
1716
using PG.StarWarsGame.Files.ALO.Files.Particles;
1817
using PG.StarWarsGame.Files.Binary;
1918

20-
#if NETSTANDARD2_0 || NETFRAMEWORK
21-
using AnakinRaW.CommonUtilities.FileSystem;
22-
#endif
23-
2419
namespace AET.ModVerify.Verifiers.Commons;
2520

2621
public 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

Comments
 (0)