Skip to content

Commit

Permalink
Test ProjectDir for getting the root directory
Browse files Browse the repository at this point in the history
  • Loading branch information
rajat2004 committed Mar 4, 2021
1 parent 8a0a494 commit 6c81440
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Unreal/Plugins/AirSim/Source/SimHUD/SimHUD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ bool ASimHUD::getSettingsText(std::string& settingsText)
||
readSettingsTextFromFile(FString(msr::airlib::Settings::getExecutableFullPath("settings.json").c_str()), settingsText)
||
readSettingsTextFromFile(FString(msr::airlib::Settings::getCurrentDir("settings.json").c_str()), settingsText)
readSettingsTextFromFile(FPaths::Combine(FPaths::ProjectDir(), FString("settings.json")), settingsText)
||
readSettingsTextFromFile(FString(msr::airlib::Settings::Settings::getUserDirectoryFullPath("settings.json").c_str()), settingsText));
}
Expand Down Expand Up @@ -403,9 +403,9 @@ bool ASimHUD::getSettingsTextFromCommandLine(std::string& settingsText)
return found;
}

bool ASimHUD::readSettingsTextFromFile(FString settingsFilepath, std::string& settingsText)
bool ASimHUD::readSettingsTextFromFile(const FString& settingsFilepath, std::string& settingsText)
{

Utils::log(std::string(TCHAR_TO_ANSI(*settingsFilepath)));
bool found = FPaths::FileExists(settingsFilepath);
if (found) {
FString settingsTextFStr;
Expand Down
2 changes: 1 addition & 1 deletion Unreal/Plugins/AirSim/Source/SimHUD/SimHUD.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class AIRSIM_API ASimHUD : public AHUD

bool getSettingsText(std::string& settingsText);
bool getSettingsTextFromCommandLine(std::string& settingsText);
bool readSettingsTextFromFile(FString fileName, std::string& settingsText);
bool readSettingsTextFromFile(const FString& fileName, std::string& settingsText);
std::string getSimModeFromUser();

private:
Expand Down

0 comments on commit 6c81440

Please sign in to comment.