File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -413,25 +413,12 @@ else
413413
414414 private string GetEntryIcon (ArchiveEntry entry )
415415 {
416- // Use cached resource info if available, otherwise use path-based detection
417- if (entry .ResourceInfo != null )
418- return entry .ResourceInfo .IconClass ;
419-
420- if (entry .IsTextResource )
421- return " fa-file-lines text-info" ;
422-
423- // Heuristic based on path
424- var path = entry .Path .ToLowerInvariant ();
425- if (path .Contains (" tex" ) || path .EndsWith (" .png" ) || path .EndsWith (" .jpg" ))
426- return " fa-image text-success" ;
427- if (path .Contains (" anim" ))
428- return " fa-person-running text-primary" ;
429- if (path .Contains (" audio" ) || path .Contains (" sound" ) || path .Contains (" music" ))
430- return " fa-music text-warning" ;
431- if (path .Contains (" skel" ))
432- return " fa-bone text-secondary" ;
433-
434- return " fa-file" ;
416+ // Use cached resource info if available, otherwise analyze metadata
417+ if (entry .ResourceInfo == null )
418+ {
419+ entry .ResourceInfo = ArchiveExplorer .AnalyzeMetadata (entry .Path );
420+ }
421+ return entry .ResourceInfo ? .IconClass ?? " fa-file" ;
435422 }
436423
437424 private void OpenInTextEditor (ArchiveEntry entry )
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ public sealed record ArchiveEntry(
2222 long Size ,
2323 bool IsDirectory ) {
2424 /// <summary>Resource info (populated after analysis).</summary>
25- public ResourceInfo ? ResourceInfo { get ; init ; }
25+ public ResourceInfo ? ResourceInfo { get ; set ; }
2626
2727 /// <summary>Checks if this is a text resource.</summary>
2828 public bool IsTextResource => ResourceInfo ? . Type == ResourceType . Text ;
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ public sealed record ResourceInfo(
4646 /// <summary>Gets a Font Awesome icon class for the resource type.</summary>
4747 public string IconClass => Type switch {
4848 ResourceType . Texture or ResourceType . Background => "fa-image" ,
49- ResourceType . Text => "fa-file-lines " ,
49+ ResourceType . Text => "fa-file-text " ,
5050 ResourceType . Animation or ResourceType . PlayerAnimation => "fa-person-running" ,
5151 ResourceType . Audio or ResourceType . AudioSample or ResourceType . AudioSoundFont or ResourceType . AudioSequence => "fa-music" ,
5252 ResourceType . Skeleton or ResourceType . SkeletonLimb => "fa-bone" ,
You can’t perform that action at this time.
0 commit comments