* Find the path to the game manual file. * * @param filename The filename to find. * @return std::string The path to the filename if found. */
| 45 | * @return std::string The path to the filename if found. |
| 46 | */ |
| 47 | static std::optional<std::string> FindGameManualFilePath(std::string_view filename, Subdirectory subdir) |
| 48 | { |
| 49 | static const Searchpath searchpaths[] = { |
| 50 | SP_APPLICATION_BUNDLE_DIR, SP_INSTALLATION_DIR, SP_SHARED_DIR, SP_BINARY_DIR, SP_WORKING_DIR |
| 51 | }; |
| 52 | |
| 53 | for (Searchpath sp : searchpaths) { |
| 54 | std::string file_path = FioGetDirectory(sp, subdir); |
| 55 | file_path.append(filename); |
| 56 | if (FioCheckFileExists(file_path, NO_DIRECTORY)) return file_path; |
| 57 | } |
| 58 | |
| 59 | return {}; |
| 60 | } |
| 61 | |
| 62 | /** Window class displaying the game manual textfile viewer. */ |
| 63 | struct GameManualTextfileWindow : public TextfileWindow { |
no test coverage detected