From 1b57022694de13635a60357ce19c3dd690d5f4c0 Mon Sep 17 00:00:00 2001 From: Neo Date: Wed, 2 Sep 2026 03:33:29 +0300 Subject: [PATCH] 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 0381c7157b1024c0e358e548865fced1e4ed605a) --- src/Ryujinx.Common/Utilities/EmbeddedResources.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Ryujinx.Common/Utilities/EmbeddedResources.cs b/src/Ryujinx.Common/Utilities/EmbeddedResources.cs index 45bb7d537..048320e8d 100644 --- a/src/Ryujinx.Common/Utilities/EmbeddedResources.cs +++ b/src/Ryujinx.Common/Utilities/EmbeddedResources.cs @@ -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(); }