removed unused methods(BeginPlay, Tick) and added rider plugin
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using UnrealBuildTool;
|
||||
|
||||
public class RiderShaderInfo : ModuleRules
|
||||
{
|
||||
public RiderShaderInfo(ReadOnlyTargetRules Target) : base(Target)
|
||||
{
|
||||
#if UE_4_22_OR_LATER
|
||||
PCHUsage = PCHUsageMode.NoPCHs;
|
||||
#else
|
||||
PCHUsage = PCHUsageMode.NoSharedPCHs;
|
||||
#endif
|
||||
|
||||
#if UE_5_2_OR_LATER
|
||||
bDisableStaticAnalysis = true;
|
||||
#endif
|
||||
|
||||
PrivateDependencyModuleNames.AddRange(new string[] { "Core", "Projects", "RenderCore" });
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
#include "RiderShaderInfo.h"
|
||||
|
||||
#include "HAL/FileManager.h"
|
||||
#include "Interfaces/IPluginManager.h"
|
||||
#include "Misc/FileHelper.h"
|
||||
#include "Modules/ModuleManager.h"
|
||||
#include "ShaderCore.h"
|
||||
|
||||
IMPLEMENT_MODULE(FRiderShaderInfoModule, RiderShaderInfo);
|
||||
|
||||
void FRiderShaderInfoModule::StartupModule()
|
||||
{
|
||||
const TSharedPtr<IPlugin> Plugin = IPluginManager::Get().FindPlugin(TEXT("RiderLink"));
|
||||
if(!Plugin.IsValid()) return;
|
||||
|
||||
const FString MappingFile = FPaths::Combine(Plugin->GetBaseDir(), TEXT("Intermediate"), TEXT("FileSystemMappings.ini"));
|
||||
const FString TmpMappingFile = FPaths::Combine(Plugin->GetBaseDir(), TEXT("Intermediate"), TEXT("~FileSystemMappings.ini"));
|
||||
|
||||
const TMap<FString, FString> ShaderMappings = AllShaderSourceDirectoryMappings();
|
||||
const TArray<FString> Mappings = [&ShaderMappings]()->TArray<FString>
|
||||
{
|
||||
TArray<FString> Result;
|
||||
for(const TTuple<FString, FString>& Pair : ShaderMappings)
|
||||
{
|
||||
Result.Add(FString::Printf(TEXT("%s=%s"), *Pair.Key, *FPaths::ConvertRelativePathToFull(Pair.Value)));
|
||||
}
|
||||
return Result;
|
||||
}();
|
||||
if(IFileManager::Get().FileExists(*MappingFile))
|
||||
{
|
||||
TArray<FString> Result;
|
||||
FFileHelper::LoadFileToStringArray(Result, *MappingFile);
|
||||
if(Mappings == Result) return;
|
||||
}
|
||||
FFileHelper::SaveStringArrayToFile(Mappings, *TmpMappingFile);
|
||||
IFileManager::Get().Move(*MappingFile, *TmpMappingFile, true, true);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "Modules/ModuleInterface.h"
|
||||
|
||||
class RIDERSHADERINFO_API FRiderShaderInfoModule : public IModuleInterface
|
||||
{
|
||||
public:
|
||||
virtual void StartupModule() override;
|
||||
};
|
||||
Reference in New Issue
Block a user