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:
Neo
2026-09-10 23:35:08 -05:00
committed by KeatonTheBot
parent 2bb07a4364
commit 1b57022694
@@ -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();
}