More work on MCP core infrastructure
This commit is contained in:
@@ -39,12 +39,26 @@ void MCPFetcher::PrintDocs()
|
||||
}
|
||||
|
||||
|
||||
void MCPFetcher::SetObj(UObject* InObj) { UMCPServer::AddTouchedObject(InObj); Obj = InObj; ResultPin = nullptr; }
|
||||
void MCPFetcher::SetPin(UEdGraphPin* InPin) { ResultPin = InPin; Obj = nullptr; }
|
||||
void MCPFetcher::SetObj(UObject* InObj)
|
||||
{
|
||||
UMCPServer::AddTouchedObject(InObj);
|
||||
Obj = InObj;
|
||||
ResultPin = nullptr;
|
||||
}
|
||||
|
||||
void MCPFetcher::SetPin(UEdGraphPin* InPin)
|
||||
{
|
||||
ResultPin = InPin;
|
||||
Obj = nullptr;
|
||||
}
|
||||
|
||||
MCPFetcher& MCPFetcher::SetError()
|
||||
{
|
||||
bError = true;
|
||||
Obj = nullptr;
|
||||
ResultPin = nullptr;
|
||||
OriginalAsset = nullptr;
|
||||
Editor = nullptr;
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -60,8 +74,6 @@ MCPFetcher& MCPFetcher::TypeMismatch(const TCHAR* Walker, const TCHAR* Expected)
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
MCPFetcher& MCPFetcher::Walk(const FString& Path)
|
||||
{
|
||||
if (bError) return *this;
|
||||
@@ -102,6 +114,8 @@ MCPFetcher& MCPFetcher::Walk(const FString& Path)
|
||||
|
||||
MCPFetcher& MCPFetcher::Asset(const FString& PackagePath)
|
||||
{
|
||||
if (bError) return *this;
|
||||
|
||||
SetObj(LoadObject<UObject>(nullptr, *PackagePath));
|
||||
if (!Obj)
|
||||
{
|
||||
@@ -118,7 +132,6 @@ MCPFetcher& MCPFetcher::Asset(const FString& PackagePath)
|
||||
UMCPServer::Printf(TEXT("ERROR: Could not open editor for '%s'\n"), *PackagePath);
|
||||
return SetError();
|
||||
}
|
||||
|
||||
Editor = Sub->FindEditorForAsset(OriginalAsset, false);
|
||||
if (!Editor)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user