Skip to content

Commit

Permalink
Merge branch 'master' into ue_4_21
Browse files Browse the repository at this point in the history
  • Loading branch information
DecoyRS committed May 6, 2020
2 parents d5469e2 + 4c1070d commit 58d51f6
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 18 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,5 @@ Intermediate/*
Plugins/*/Intermediate/*

# Cache files for the editor to use
DerivedDataCache/*
DerivedDataCache/*
Config/*
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,37 @@
How to add RiderSourceCodeAccess to your project
# Description
RiderSourceCodeAccess is a plugin for Unreal Engine, available through [Marketplace page](https://www.unrealengine.com/marketplace/en-US/product/rider-source-code-access) that will add an option to select ["Rider for Unreal Engine"](https://www.jetbrains.com/rider/unreal/) as your source code editor in Unreal Editor.

## Functionality
* Adds the option to select "Rider for Unreal Engine" as your IDE of choice in Unreal Editor.
* You can select a specific version of Rider (e.g. Rider xxx.xx.xx) or,
* Use the latest version of Rider that’s available on your workstation.
![Example of dropdown box with Rider for Unreal Engine](https://cdn1.epicgames.com/ue/product/Screenshot/RiderSourceCodeAccesss-1920x1080-32507ce3de2846e20de0ef72904f707a.png)

# How to add this plugin manually (not recommened)
## How to add to Game project
1. Go to ["Releases" page](https://github.com/JetBrains/RiderSourceCodeAccess/releases) and download version of plugin for your version of Unreal Engine;
2. Unzip `RiderSourceCodeAccess.zip` to `RiderSourceCodeAccess` folder;
3. Copy `RiderSourceCodeAccess` folder to `{UnrealProjectRoot}/Plugins/Developer`;
a. If `{UnrealProjectRoot}/Plugins/Developer` does not exist, create it;
3. Copy `RiderSourceCodeAccess` folder to `{GameProjectRoot}/Plugins/Developer`;
a. If `{GameProjectRoot}/Plugins/Developer` does not exist, create it;
4. Re-generate solution files - uproject file > context menu > Generate Visual Studio project files;
5. Build UE project using Rider or Visual Studio;
6. Start Unreal Editor;
7. Edit > Editor Preferences ... > General > Source Code > Source Code Editor;
8. Select Rider from drop down list. NB: only Rider with C++ plugins will be available from drop down list.

## How to add to Engine project
### Project is built from source code
### Unreal Engine is built from source code
1. Go to ["Releases" page](https://github.com/JetBrains/RiderSourceCodeAccess/releases) and download version of plugin for your version of Unreal Engine;
2. Unzip `RiderSourceCodeAccess.zip` to `RiderSourceCodeAccess` folder;
3. Copy `RiderSourceCodeAccess` folder to `{UnrealEngineRoot}/Engine/Plugins/Developer`;
a. If `{UnrealProjectRoot}/Plugins/Developer` does not exist, create it;
a. If `{UnrealEngineRoot}/Engine/Plugins/Developer` does not exist, create it;
4. Re-generate solution files - uproject file > context menu > Generate Visual Studio project files;
5. Build UE project using Rider or Visual Studio;
6. Start Unreal Editor;
7. Edit > Editor Preferences ... > General > Source Code > Source Code Editor;
8. Select Rider from drop down list. NB: only Rider with C++ plugins will be available from drop down list.

### Project is downloaded from Epic Games Store
### Unreal Engine is downloaded from Epic Games Store
1. Go to ["Releases" page](https://github.com/JetBrains/RiderSourceCodeAccess/releases) and download version of plugin for your version of Unreal Engine;
2. Unzip `RiderSourceCodeAccess.zip` to `RiderSourceCodeAccess` folder;
3. Copy `RiderSourceCodeAccess` folder to `{UnrealProjectRoot}/Plugins/Developer`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

namespace FRiderPathLocator
{
static TArray<FInstallInfo> CollectPathsFromToolbox()
static TArray<FInstallInfo> CollectPathsFromToolbox(const Windows::HKEY RootKey)
{
FString ToolboxBinPath;

if (!FWindowsPlatformMisc::QueryRegKey(HKEY_CURRENT_USER, TEXT("Software\\JetBrains\\Toolbox\\"), TEXT(""), ToolboxBinPath)) return {};
if (!FWindowsPlatformMisc::QueryRegKey(RootKey, TEXT("Software\\JetBrains\\Toolbox\\"), TEXT(""), ToolboxBinPath)) return {};

FPaths::NormalizeDirectoryName(ToolboxBinPath);
const FString PatternString(TEXT("(.*)/bin"));
Expand Down Expand Up @@ -154,11 +154,11 @@ namespace FRiderPathLocator
return Result;
}

static TArray<FInstallInfo> CollectPathsFromRegistry(const FString& RegistryKey)
static TArray<FInstallInfo> CollectPathsFromRegistry( const Windows::HKEY RootKey, const FString& RegistryKey)
{
TArray<FInstallInfo> InstallInfos;
HKEY Key;
const LONG Result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, *RegistryKey, 0, KEY_READ, &Key);
const LONG Result = RegOpenKeyEx(RootKey, *RegistryKey, 0, KEY_READ, &Key);
if (Result == ERROR_SUCCESS)
{
TArray<FString> Keys;
Expand Down Expand Up @@ -199,12 +199,15 @@ namespace FRiderPathLocator
return InstallInfos;
}

TArray<FInstallInfo> CollectAllPaths()
TSet<FInstallInfo> CollectAllPaths()
{
TArray<FInstallInfo> InstallInfos;
InstallInfos.Append(CollectPathsFromToolbox());
InstallInfos.Append(CollectPathsFromRegistry(TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall")));
InstallInfos.Append(CollectPathsFromRegistry(TEXT("SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall")));
TSet<FInstallInfo> InstallInfos;
InstallInfos.Append(CollectPathsFromToolbox(HKEY_CURRENT_USER));
InstallInfos.Append(CollectPathsFromToolbox(HKEY_LOCAL_MACHINE));
InstallInfos.Append(CollectPathsFromRegistry(HKEY_CURRENT_USER, TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall")));
InstallInfos.Append(CollectPathsFromRegistry(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall")));
InstallInfos.Append(CollectPathsFromRegistry(HKEY_CURRENT_USER, TEXT("SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall")));
InstallInfos.Append(CollectPathsFromRegistry(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall")));
return InstallInfos;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ namespace FRiderPathLocator
{
return Version < rhs.Version;
}

bool operator==(const FInstallInfo& rhs) const
{
return !(*this < rhs) && !(rhs < *this);
}
};
TArray<FInstallInfo> CollectAllPaths();

TSet<FInstallInfo> CollectAllPaths();
}

FORCEINLINE uint32 GetTypeHash(const FRiderPathLocator::FInstallInfo& InstallInfo)
{
return GetTypeHash(InstallInfo.Path);
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void FRiderSourceCodeAccessModule::ShutdownModule()

void FRiderSourceCodeAccessModule::StartupModule()
{
TArray<FRiderPathLocator::FInstallInfo> InstallInfos = FRiderPathLocator::CollectAllPaths();
TArray<FRiderPathLocator::FInstallInfo> InstallInfos = FRiderPathLocator::CollectAllPaths().Array();
InstallInfos.Sort();
for (const FRiderPathLocator::FInstallInfo & InstallInfo : InstallInfos)
{
Expand Down

0 comments on commit 58d51f6

Please sign in to comment.