MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / GetOrPromptRCT2Path

Method GetOrPromptRCT2Path

src/openrct2/Context.cpp:965–991  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

963 }
964
965 std::string GetOrPromptRCT2Path()
966 {
967 auto result = std::string();
968 if (gCustomRCT2DataPath.empty())
969 {
970 // Check install directory
971 if (Config::Get().general.rct2Path.empty() || !Platform::OriginalGameDataExists(Config::Get().general.rct2Path))
972 {
973 LOG_VERBOSE(
974 "install directory does not exist or invalid directory selected, %s",
975 Config::Get().general.rct2Path.c_str());
976 if (!Config::FindOrBrowseInstallDirectory())
977 {
978 auto path = Config::GetDefaultPath();
979 Console::Error::WriteLine(
980 "An RCT2 install directory must be specified! Please edit \"game_path\" in %s.\n", path.c_str());
981 return std::string();
982 }
983 }
984 result = Config::Get().general.rct2Path;
985 }
986 else
987 {
988 result = gCustomRCT2DataPath;
989 }
990 return result;
991 }
992
993 // TODO: move function elsewhere?
994 bool LoadBaseGraphics()

Callers

nothing calls this directly

Calls 5

OriginalGameDataExistsFunction · 0.85
GetDefaultPathFunction · 0.85
WriteLineFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected