mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-10-07 15:58:56 +02:00
Fix: GetAllAvailableResources Filtering by Resource Path
Fix EmbeddedResources.GetAllAvailableResources to respect the specified resource path when enumerating embedded resources. Previously, resources were filtered only by file extension. Adding locale-named JSON files under anywhere else caused them to be included when querying Assets/Locales, resulting in duplicate entries in the language menu.
This commit is contained in:
@@ -126,8 +126,13 @@ namespace Ryujinx.Common
|
|||||||
|
|
||||||
public static string[] GetAllAvailableResources(string path, string ext = "")
|
public static string[] GetAllAvailableResources(string path, string ext = "")
|
||||||
{
|
{
|
||||||
return ResolveManifestPath(path).Item1.GetManifestResourceNames()
|
(Assembly assembly, string resourcePath) = ResolveManifestPath(path);
|
||||||
.Where(r => r.EndsWith(ext))
|
|
||||||
|
string manifestPath = assembly.GetName().Name + "." + resourcePath.Replace('/', '.');
|
||||||
|
|
||||||
|
return assembly.GetManifestResourceNames()
|
||||||
|
.Where(r => r.StartsWith(manifestPath + ".", StringComparison.Ordinal))
|
||||||
|
.Where(r => r.EndsWith(ext, StringComparison.Ordinal))
|
||||||
.ToArray();
|
.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user