@@ -424,6 +424,14 @@ std::string find_generic(const DirectoryTree::Args& args) {
424424}
425425
426426std::string find_generic_with_fallback (DirectoryTree::Args& args) {
427+ // Searches first in the Save directory (because the game could have written
428+ // files there, then in the Game directory.
429+ // Disable this behaviour when Game and Save are shared as this breaks the
430+ // translation redirection.
431+ if (Player::shared_game_and_save_directory) {
432+ return find_generic (args);
433+ }
434+
427435 std::string found = FileFinder::Save ().FindFile (args);
428436 if (found.empty ()) {
429437 return find_generic (args);
@@ -453,11 +461,6 @@ std::string FileFinder::FindFont(std::string_view name) {
453461 return find_generic (args);
454462}
455463
456- std::string FileFinder::FindText (std::string_view name) {
457- DirectoryTree::Args args = { MakePath (" Text" , name), TEXT_TYPES, 1 , true };
458- return find_generic_with_fallback (args);
459- }
460-
461464Filesystem_Stream::InputStream open_generic (std::string_view dir, std::string_view name, DirectoryTree::Args& args) {
462465 if (!Tr::GetCurrentTranslationId ().empty ()) {
463466 auto tr_fs = Tr::GetCurrentTranslationFilesystem ();
@@ -478,6 +481,14 @@ Filesystem_Stream::InputStream open_generic(std::string_view dir, std::string_vi
478481}
479482
480483Filesystem_Stream::InputStream open_generic_with_fallback (std::string_view dir, std::string_view name, DirectoryTree::Args& args) {
484+ if (!Tr::GetCurrentTranslationId ().empty ()) {
485+ auto tr_fs = Tr::GetCurrentTranslationFilesystem ();
486+ auto is = tr_fs.OpenFile (args);
487+ if (is) {
488+ return is;
489+ }
490+ }
491+
481492 auto is = FileFinder::Save ().OpenFile (args);
482493 if (!is) { is = open_generic (dir, name, args); }
483494 if (!is) {
0 commit comments