MCPcopy Create free account
hub / github.com/EasyRPG/Player / open_generic_with_fallback

Function open_generic_with_fallback

src/filefinder.cpp:483–499  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

481}
482
483Filesystem_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
492 auto is = FileFinder::Save().OpenFile(args);
493 if (!is) { is = open_generic(dir, name, args); }
494 if (!is) {
495 Output::Debug("Unable to open in either Game or Save: {}/{}", dir, name);
496 }
497
498 return is;
499}
500
501Filesystem_Stream::InputStream FileFinder::OpenImage(std::string_view dir, std::string_view name) {
502 DirectoryTree::Args args = { MakePath(dir, name), IMG_TYPES, 1, false };

Callers 1

OpenTextMethod · 0.85

Calls 3

open_genericFunction · 0.85
OpenFileMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected