private static string GetLayerPath(ConfigLayer Layer, string PlatformExtensionName, string IniPlatformName, DirectoryReference ProjectDir, string BaseIniName, out bool bHasPlatformTag, out bool bHasProjectTag, out bool bHasExpansionTag) { // cache some platform extension information that can be used inside the loops string PlatformExtensionEngineConfigDir = DirectoryReference.Combine(UnrealBuildTool.EnginePlatformExtensionsDirectory, PlatformExtensionName).FullName; string PlatformExtensionProjectConfigDir = ProjectDir != null?DirectoryReference.Combine(UnrealBuildTool.ProjectPlatformExtensionsDirectory(ProjectDir), PlatformExtensionName).FullName : null; bool bHasPlatformExtensionEngineConfigDir = Directory.Exists(PlatformExtensionEngineConfigDir); bool bHasPlatformExtensionProjectConfigDir = PlatformExtensionProjectConfigDir != null && Directory.Exists(PlatformExtensionProjectConfigDir); bHasPlatformTag = Layer.Path.Contains("{PLATFORM}"); bHasProjectTag = Layer.Path.Contains("{PROJECT}"); bHasExpansionTag = Layer.Path.Contains("{ED}") || Layer.Path.Contains("{EF}"); bool bHasUserTag = Layer.Path.Contains("{USER}"); // skip platform layers if we are "platform-less", or user layers without a user dir if ((bHasPlatformTag && IniPlatformName == "None") || (bHasProjectTag && ProjectDir == null) || (bHasUserTag && GetUserDir() == null)) { return(null); } // basic replacements string LayerPath; // you can only have PROJECT or ENGINE, not both if (bHasProjectTag) { if (bHasPlatformTag && bHasPlatformExtensionProjectConfigDir) { LayerPath = Layer.ExtProjectPath.Replace("{EXTPROJECT}", PlatformExtensionProjectConfigDir); } else { LayerPath = Layer.Path.Replace("{PROJECT}", ProjectDir.FullName); } } else { if (bHasPlatformTag && bHasPlatformExtensionEngineConfigDir) { LayerPath = Layer.ExtEnginePath.Replace("{EXTENGINE}", PlatformExtensionEngineConfigDir); } else { LayerPath = Layer.Path.Replace("{ENGINE}", UnrealBuildTool.EngineDirectory.FullName); } } LayerPath = LayerPath.Replace("{TYPE}", BaseIniName); LayerPath = LayerPath.Replace("{USERSETTINGS}", Utils.GetUserSettingDirectory().FullName); LayerPath = LayerPath.Replace("{USER}", GetUserDir()); return(LayerPath); }