mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-09-20 09:41:14 +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.
(cherry picked from commit 0381c7157b)
This commit is contained in:
@@ -126,8 +126,13 @@ namespace Ryujinx.Common
|
||||
|
||||
public static string[] GetAllAvailableResources(string path, string ext = "")
|
||||
{
|
||||
return ResolveManifestPath(path).Item1.GetManifestResourceNames()
|
||||
.Where(r => r.EndsWith(ext))
|
||||
(Assembly assembly, string resourcePath) = ResolveManifestPath(path);
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user