// get our Citizen save game directory static std::wstring GetCitizenSavePath() { PWSTR saveBasePath; // get the 'Saved Games' shell directory if (SUCCEEDED(SHGetKnownFolderPath(FOLDERID_SavedGames, 0, nullptr, &saveBasePath))) { // create a STL string and free the used memory std::wstring savePath(saveBasePath); CoTaskMemFree(saveBasePath); // append our path components AppendPathComponent(savePath, L"\\CitizenFX"); AppendPathComponent(savePath, L"\\GTA4"); // append a final separator savePath += L"\\"; // and return the path return savePath; } return GetOriginalSavePath(); }
// get a xliveless-compatible save game directory static std::wstring GetOriginalSavePath() { PWSTR documentsPath; // get the Documents folder if (SUCCEEDED(SHGetKnownFolderPath(FOLDERID_Documents, 0, nullptr, &documentsPath))) { // put it into a string and free it std::wstring savePath(documentsPath); CoTaskMemFree(documentsPath); // append the R* bits AppendPathComponent(savePath, L"\\Rockstar Games"); AppendPathComponent(savePath, L"\\GTA IV"); AppendPathComponent(savePath, L"\\savegames"); // append a final separator savePath += L"\\"; // and return the path return savePath; } // if not working, panic FatalError("Could not get Documents folder path for save games."); }
wxString wxStandardPathsBase::AppendAppInfo(const wxString& dir) const { wxString subdir(dir); if ( UsesAppInfo(AppInfo_VendorName) ) { subdir = AppendPathComponent(subdir, wxTheApp->GetVendorName()); } if ( UsesAppInfo(AppInfo_AppName) ) { subdir = AppendPathComponent(subdir, wxTheApp->GetAppName()); } return subdir; }