Compare commits
4 Commits
f4286faeb1
...
5001be6c90
| Author | SHA1 | Date | |
|---|---|---|---|
| 5001be6c90 | |||
| 69b249f7ca | |||
| 50790280bb | |||
| 73f84c1681 |
@@ -65,8 +65,8 @@ public:
|
||||
if (!UWingComponent::CheckValidComponentClass(ComponentClass, WingOut::Stdout)) return;
|
||||
|
||||
// Find the specified parent component
|
||||
TArray<TStrongObjectPtr<UWingComponentReference>> AllComponents = UWingComponent::GetAll(BP);
|
||||
TStrongObjectPtr<UWingComponentReference> ParentComp = WingUtils::FindOneWithExternalID(Parent, AllComponents, TEXT("Component"), WingOut::Stdout);
|
||||
TArray<TStrongObjectPtr<UWingComponentRef>> AllComponents = UWingComponent::GetAll(BP);
|
||||
TStrongObjectPtr<UWingComponentRef> ParentComp = WingUtils::FindOneWithExternalID(Parent, AllComponents, TEXT("Component"), WingOut::Stdout);
|
||||
if (!ParentComp) return;
|
||||
|
||||
// Create the SCS node
|
||||
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
virtual void Handle() override
|
||||
{
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UWingComponentReference* CompRef = F.Walk(Component).Cast<UWingComponentReference>();
|
||||
UWingComponentRef* CompRef = F.Walk(Component).Cast<UWingComponentRef>();
|
||||
if (!CompRef) return;
|
||||
|
||||
if (!UWingComponent::DeleteComponent(CompRef, WingOut::Stdout)) return;
|
||||
|
||||
@@ -34,13 +34,13 @@ public:
|
||||
virtual void Handle() override
|
||||
{
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UWingComponentReference* CompRef = F.Walk(Component).Cast<UWingComponentReference>();
|
||||
UWingComponentRef* CompRef = F.Walk(Component).Cast<UWingComponentRef>();
|
||||
if (!CompRef) return;
|
||||
|
||||
// Find the new parent among all components (if specified)
|
||||
UBlueprint *BP = CompRef->BP;
|
||||
TArray<TStrongObjectPtr<UWingComponentReference>> AllComponents = UWingComponent::GetAll(BP);
|
||||
TStrongObjectPtr<UWingComponentReference> NewParent = WingUtils::FindOneWithExternalID(Parent, AllComponents, TEXT("Component"), WingOut::Stdout);
|
||||
TArray<TStrongObjectPtr<UWingComponentRef>> AllComponents = UWingComponent::GetAll(BP);
|
||||
TStrongObjectPtr<UWingComponentRef> NewParent = WingUtils::FindOneWithExternalID(Parent, AllComponents, TEXT("Component"), WingOut::Stdout);
|
||||
if (!NewParent) return;
|
||||
|
||||
if (!UWingComponent::ReparentComponent(CompRef, NewParent.Get(), WingOut::Stdout)) return;
|
||||
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
BlueprintVars.Print(WingOut::StdoutBuffer);
|
||||
|
||||
// Components
|
||||
TArray<TStrongObjectPtr<UWingComponentReference>> Components = UWingComponent::GetAll(BP);
|
||||
TArray<TStrongObjectPtr<UWingComponentRef>> Components = UWingComponent::GetAll(BP);
|
||||
if (!Components.IsEmpty()) WingOut::Stdout.Print(TEXT("\nComponents:\n"));
|
||||
UWingComponent::PrintAll(BP, WingOut::Stdout);
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
void HandleK2Entry(const FSetNodeDefaultEntry& Entry, UEdGraph* GraphObj, const UEdGraphSchema_K2* K2Schema)
|
||||
{
|
||||
WingFetcher F(GraphObj, WingOut::Stdout);
|
||||
UWingPinReference* PinRef = F.Node(Entry.Node).Pin(Entry.Name).Cast<UWingPinReference>();
|
||||
UWingGraphPinRef* PinRef = F.Node(Entry.Node).Pin(Entry.Name).Cast<UWingGraphPinRef>();
|
||||
if (!PinRef) return;
|
||||
UEdGraphPin* Pin = WingUtils::CheckGetPin(PinRef->Node, PinRef->PinName, WingOut::Stdout);
|
||||
if (!Pin) return;
|
||||
|
||||
@@ -63,13 +63,13 @@ public:
|
||||
continue;
|
||||
|
||||
WingFetcher FS(G, WingOut::Stdout);
|
||||
UWingPinReference* SourcePinRef = FS.Walk(Entry.SourcePin).Cast<UWingPinReference>();
|
||||
UWingGraphPinRef* SourcePinRef = FS.Walk(Entry.SourcePin).Cast<UWingGraphPinRef>();
|
||||
if (!SourcePinRef) continue;
|
||||
UEdGraphPin* SourcePin = WingUtils::CheckGetPin(SourcePinRef->Node, SourcePinRef->PinName, WingOut::Stdout);
|
||||
if (!SourcePin) continue;
|
||||
|
||||
WingFetcher FT(G, WingOut::Stdout);
|
||||
UWingPinReference* TargetPinRef = FT.Walk(Entry.TargetPin).Cast<UWingPinReference>();
|
||||
UWingGraphPinRef* TargetPinRef = FT.Walk(Entry.TargetPin).Cast<UWingGraphPinRef>();
|
||||
if (!TargetPinRef) continue;
|
||||
UEdGraphPin* TargetPin = WingUtils::CheckGetPin(TargetPinRef->Node, TargetPinRef->PinName, WingOut::Stdout);
|
||||
if (!TargetPin) continue;
|
||||
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
if (!FWingProperty::PopulateFromJson(EntryProps, *DiscVal, false, WingOut::Stdout)) continue;
|
||||
|
||||
WingFetcher FP(G, WingOut::Stdout);
|
||||
UWingPinReference* PinRef = FP.Walk(Entry.Pin).Cast<UWingPinReference>();
|
||||
UWingGraphPinRef* PinRef = FP.Walk(Entry.Pin).Cast<UWingGraphPinRef>();
|
||||
if (!PinRef) continue;
|
||||
UEdGraphPin* Pin = WingUtils::CheckGetPin(PinRef->Node, PinRef->PinName, WingOut::Stdout);
|
||||
if (!Pin) continue;
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
if (!Entry.TargetPin.IsEmpty())
|
||||
{
|
||||
WingFetcher FT(G, WingOut::Stdout);
|
||||
UWingPinReference* TargetRef = FT.Walk(Entry.TargetPin).Cast<UWingPinReference>();
|
||||
UWingGraphPinRef* TargetRef = FT.Walk(Entry.TargetPin).Cast<UWingGraphPinRef>();
|
||||
if (!TargetRef) continue;
|
||||
UEdGraphPin* Target = WingUtils::CheckGetPin(TargetRef->Node, TargetRef->PinName, WingOut::Stdout);
|
||||
if (!Target) continue;
|
||||
|
||||
@@ -136,7 +136,7 @@ void UWingComponent::AddChildNode(UBlueprint *BP, USCS_Node *NewNode, FoundCompo
|
||||
}
|
||||
}
|
||||
|
||||
bool UWingComponent::AddComponent(UBlueprint *BP, UClass *Class, UWingComponentReference *Parent, FName Name, WingOut Errors)
|
||||
bool UWingComponent::AddComponent(UBlueprint *BP, UClass *Class, UWingComponentRef *Parent, FName Name, WingOut Errors)
|
||||
{
|
||||
TSet<FName> Names;
|
||||
FBlueprintEditorUtils::GetClassVariableList(BP, Names);
|
||||
@@ -164,7 +164,7 @@ bool UWingComponent::AddComponent(UBlueprint *BP, UClass *Class, UWingComponentR
|
||||
return true;
|
||||
}
|
||||
|
||||
bool UWingComponent::ReparentComponent(UWingComponentReference *Ref, UWingComponentReference *Parent, WingOut Errors)
|
||||
bool UWingComponent::ReparentComponent(UWingComponentRef *Ref, UWingComponentRef *Parent, WingOut Errors)
|
||||
{
|
||||
FoundComponent ParentComponent = FindComponent(Ref->BP, Parent->VariableName);
|
||||
if (!CheckValidParent(ParentComponent, Errors)) return false;
|
||||
@@ -184,7 +184,7 @@ bool UWingComponent::ReparentComponent(UWingComponentReference *Ref, UWingCompon
|
||||
return true;
|
||||
}
|
||||
|
||||
bool UWingComponent::DeleteComponent(UWingComponentReference *Ref, WingOut Errors)
|
||||
bool UWingComponent::DeleteComponent(UWingComponentRef *Ref, WingOut Errors)
|
||||
{
|
||||
FoundComponent ThisComponent = FindComponent(Ref->BP, Ref->VariableName);
|
||||
if (!CheckExists(ThisComponent, Errors)) return false;
|
||||
@@ -211,7 +211,7 @@ TMap<FName, FName> UWingComponent::CalculateParentNames(USimpleConstructionScrip
|
||||
return ParentNames;
|
||||
}
|
||||
|
||||
UActorComponent* UWingComponent::GetImmutableTemplate(const UWingComponentReference *Ref)
|
||||
UActorComponent* UWingComponent::GetImmutableTemplate(const UWingComponentRef *Ref)
|
||||
{
|
||||
FoundComponent FC = FindComponent(Ref->BP, Ref->VariableName);
|
||||
if (FC.Native) return FC.Native;
|
||||
@@ -229,7 +229,7 @@ UActorComponent* UWingComponent::GetImmutableTemplate(const UWingComponentRefere
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
UActorComponent* UWingComponent::GetMutableTemplate(const UWingComponentReference *Ref)
|
||||
UActorComponent* UWingComponent::GetMutableTemplate(const UWingComponentRef *Ref)
|
||||
{
|
||||
FoundComponent FC = FindComponent(Ref->BP, Ref->VariableName);
|
||||
if (FC.Native) return FC.Native;
|
||||
@@ -244,9 +244,9 @@ UActorComponent* UWingComponent::GetMutableTemplate(const UWingComponentReferenc
|
||||
return Override;
|
||||
}
|
||||
|
||||
TArray<TStrongObjectPtr<UWingComponentReference>> UWingComponent::GetAll(UBlueprint* BP)
|
||||
TArray<TStrongObjectPtr<UWingComponentRef>> UWingComponent::GetAll(UBlueprint* BP)
|
||||
{
|
||||
TArray<TStrongObjectPtr<UWingComponentReference>> Result;
|
||||
TArray<TStrongObjectPtr<UWingComponentRef>> Result;
|
||||
if (!BP) return Result;
|
||||
|
||||
// Find the native ancestor class
|
||||
@@ -261,7 +261,7 @@ TArray<TStrongObjectPtr<UWingComponentReference>> UWingComponent::GetAll(UBluepr
|
||||
CDO->GetComponents(NativeComponents);
|
||||
for (UActorComponent* Comp : NativeComponents)
|
||||
{
|
||||
UWingComponentReference* Ref = NewObject<UWingComponentReference>();
|
||||
UWingComponentRef* Ref = NewObject<UWingComponentRef>();
|
||||
Ref->BP = BP;
|
||||
Ref->VariableName = Comp->GetFName();
|
||||
Result.Emplace(Ref);
|
||||
@@ -275,7 +275,7 @@ TArray<TStrongObjectPtr<UWingComponentReference>> UWingComponent::GetAll(UBluepr
|
||||
if (WalkBP->SimpleConstructionScript == nullptr) continue;
|
||||
for (USCS_Node* Node : WalkBP->SimpleConstructionScript->GetAllNodes())
|
||||
{
|
||||
UWingComponentReference* Ref = NewObject<UWingComponentReference>();
|
||||
UWingComponentRef* Ref = NewObject<UWingComponentRef>();
|
||||
Ref->BP = BP;
|
||||
Ref->VariableName = Node->GetVariableName();
|
||||
Result.Emplace(Ref);
|
||||
|
||||
@@ -266,7 +266,7 @@ WingFetcher& WingFetcher::Pin(const FString& Value)
|
||||
}
|
||||
return SetError();
|
||||
}
|
||||
UWingPinReference* Ref = NewObject<UWingPinReference>();
|
||||
UWingGraphPinRef* Ref = NewObject<UWingGraphPinRef>();
|
||||
Ref->Node = N;
|
||||
Ref->PinName = Found->GetFName();
|
||||
SetObj(Ref);
|
||||
@@ -284,12 +284,12 @@ WingFetcher& WingFetcher::Component(const FString& Value)
|
||||
return SetError();
|
||||
}
|
||||
|
||||
TArray<TStrongObjectPtr<UWingComponentReference>> AllComponents = UWingComponent::GetAll(BP);
|
||||
TStrongObjectPtr<UWingComponentReference> Found = WingUtils::FindOneWithExternalID(Value, AllComponents, TEXT("component"), Errors);
|
||||
TArray<TStrongObjectPtr<UWingComponentRef>> AllComponents = UWingComponent::GetAll(BP);
|
||||
TStrongObjectPtr<UWingComponentRef> Found = WingUtils::FindOneWithExternalID(Value, AllComponents, TEXT("component"), Errors);
|
||||
if (!Found)
|
||||
{
|
||||
Errors.Printf(TEXT("Components that exist in the blueprint:\n"));
|
||||
for (const TStrongObjectPtr<UWingComponentReference>& C : AllComponents)
|
||||
for (const TStrongObjectPtr<UWingComponentRef>& C : AllComponents)
|
||||
{
|
||||
Errors.Printf(TEXT(" %s\n"), *WingUtils::FormatName(C.Get()));
|
||||
}
|
||||
@@ -376,9 +376,9 @@ WingFetcher& WingFetcher::StructProp(const FString& Value)
|
||||
UStruct *HostType = Obj.Get()->GetClass();
|
||||
bool HostEditable = true;
|
||||
|
||||
// If we are *already* inside a UWingStructPointer, update the host
|
||||
// If we are *already* inside a UWingStructRef, update the host
|
||||
// fields, to make it possible to navigate even further inside.
|
||||
if (UWingStructPointer *SPtr = ::Cast<UWingStructPointer>(Obj.Get()))
|
||||
if (UWingStructRef *SPtr = ::Cast<UWingStructRef>(Obj.Get()))
|
||||
{
|
||||
HostObject = SPtr->Object;
|
||||
HostBase = SPtr->StructBase;
|
||||
@@ -393,7 +393,7 @@ WingFetcher& WingFetcher::StructProp(const FString& Value)
|
||||
return SetError();
|
||||
}
|
||||
|
||||
UWingStructPointer* Ptr = NewObject<UWingStructPointer>();
|
||||
UWingStructRef* Ptr = NewObject<UWingStructRef>();
|
||||
Ptr->Object = HostObject;
|
||||
Ptr->StructType = StructProp->Struct;
|
||||
Ptr->StructBase = StructProp->ContainerPtrToValuePtr<void>(HostBase);
|
||||
|
||||
@@ -427,9 +427,9 @@ TArray<FWingProperty> FWingProperty::GetDetails(UObject* Obj, bool Mutable)
|
||||
{
|
||||
if (!Obj) return {};
|
||||
|
||||
// If it's a UWingStructPointer, return the properties
|
||||
// If it's a UWingStructRef, return the properties
|
||||
// of the struct instead. Propagate editability of the host.
|
||||
if (UWingStructPointer *SP = Cast<UWingStructPointer>(Obj))
|
||||
if (UWingStructRef *SP = Cast<UWingStructRef>(Obj))
|
||||
{
|
||||
TArray<FWingProperty> Result =
|
||||
GetVisible(FWingStructAndUStruct(SP->StructBase, SP->StructType));
|
||||
@@ -450,7 +450,7 @@ TArray<FWingProperty> FWingProperty::GetDetails(UObject* Obj, bool Mutable)
|
||||
}
|
||||
|
||||
// Component references: get the proper template.
|
||||
if (UWingComponentReference* Ref = ::Cast<UWingComponentReference>(Obj))
|
||||
if (UWingComponentRef* Ref = ::Cast<UWingComponentRef>(Obj))
|
||||
{
|
||||
Obj = Mutable ? UWingComponent::GetMutableTemplate(Ref) : UWingComponent::GetImmutableTemplate(Ref);
|
||||
if (!Obj)
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "UObject/StrongObjectPtr.h"
|
||||
#include "AssetRegistry/AssetRegistryModule.h"
|
||||
#include "AssetRegistry/IAssetRegistry.h"
|
||||
#include "Misc/OutputDeviceRedirector.h"
|
||||
#include "Serialization/JsonReader.h"
|
||||
#include "Serialization/JsonSerializer.h"
|
||||
#include "SocketSubsystem.h"
|
||||
@@ -57,7 +58,7 @@ void UWingServer::Initialize(FSubsystemCollectionBase& Collection)
|
||||
BuildWingHandlerRegistry();
|
||||
ModulesChangedHandle = FModuleManager::Get().OnModulesChanged().AddUObject(this, &UWingServer::OnModulesChanged);
|
||||
LogCapture.bEnabled = false;
|
||||
LogCapture.Install();
|
||||
GLog->AddOutputDevice(&LogCapture);
|
||||
bRunning = true;
|
||||
UE_LOG(LogTemp, Display, TEXT("UEWingman: MCP server listening on tcp://localhost:%d"), Port);
|
||||
}
|
||||
@@ -113,7 +114,7 @@ void UWingServer::Deinitialize()
|
||||
ListenSocket = nullptr;
|
||||
}
|
||||
|
||||
LogCapture.Uninstall();
|
||||
GLog->RemoveOutputDevice(&LogCapture);
|
||||
bRunning = false;
|
||||
bShuttingDown = false;
|
||||
GWingServer = nullptr;
|
||||
|
||||
@@ -245,7 +245,7 @@ FString WingUtils::FormatName(const FBPInterfaceDescription &IFace)
|
||||
return FormatName(IFace.Interface);
|
||||
}
|
||||
|
||||
FString WingUtils::FormatName(const UWingComponentReference *Ref)
|
||||
FString WingUtils::FormatName(const UWingComponentRef *Ref)
|
||||
{
|
||||
return ExternalizeID(Ref->VariableName);
|
||||
}
|
||||
|
||||
@@ -257,15 +257,15 @@ void WingVariables::Print(WingOut Out)
|
||||
void WingVariables::Load(WingOut Errors)
|
||||
{
|
||||
Empty();
|
||||
if (Blueprint != nullptr) return LoadBlueprint();
|
||||
if (Graph != nullptr) return LoadGraph();
|
||||
if (CustomEvent != nullptr) return LoadCustomEvent();
|
||||
if (Blueprint) return LoadBlueprint();
|
||||
if (Graph) return LoadGraph();
|
||||
if (CustomEvent) return LoadCustomEvent();
|
||||
ErrorNoBackingStore(Errors);
|
||||
}
|
||||
|
||||
void WingVariables::LoadBlueprint()
|
||||
{
|
||||
UObject *CDO = WingUtils::GetGeneratedCDO(Blueprint);
|
||||
UObject *CDO = WingUtils::GetGeneratedCDO(Blueprint.Get());
|
||||
|
||||
for (FBPVariableDescription& Desc : Blueprint->NewVariables)
|
||||
{
|
||||
@@ -281,7 +281,7 @@ void WingVariables::LoadGraph()
|
||||
{
|
||||
TWeakObjectPtr<UK2Node_EditablePinBase> EntryNode;
|
||||
TWeakObjectPtr<UK2Node_EditablePinBase> ResultNode;
|
||||
FBlueprintEditorUtils::GetEntryAndResultNodes(Graph, EntryNode, ResultNode);
|
||||
FBlueprintEditorUtils::GetEntryAndResultNodes(Graph.Get(), EntryNode, ResultNode);
|
||||
if (EntryNode.IsValid()) LoadEditablePinBase(EntryNode.Get(), InputVariables);
|
||||
if (ResultNode.IsValid()) LoadEditablePinBase(ResultNode.Get(), OutputVariables);
|
||||
LoadLocalVariables(EntryNode.Get());
|
||||
@@ -359,7 +359,7 @@ void WingVariables::LoadEditablePinBase(UK2Node_EditablePinBase* Node, WingVaria
|
||||
|
||||
void WingVariables::LoadCustomEvent()
|
||||
{
|
||||
LoadEditablePinBase(CustomEvent, InputVariables);
|
||||
LoadEditablePinBase(CustomEvent.Get(), InputVariables);
|
||||
}
|
||||
|
||||
bool WingVariables::Check(WingOut Errors)
|
||||
@@ -382,7 +382,7 @@ bool WingVariables::CheckBlueprint(WingOut Errors)
|
||||
|
||||
bool WingVariables::CheckGraph(WingOut Errors)
|
||||
{
|
||||
EGraphType T = Graph->GetSchema()->GetGraphType(Graph);
|
||||
EGraphType T = Graph->GetSchema()->GetGraphType(Graph.Get());
|
||||
bool AllowLocal = (T == EGraphType::GT_Function);
|
||||
bool AllowInput = (T == EGraphType::GT_Function) || (T == EGraphType::GT_Macro);
|
||||
bool AllowOutput = (T == EGraphType::GT_Function) || (T == EGraphType::GT_Macro);
|
||||
@@ -421,7 +421,7 @@ bool WingVariables::Modify(WingOut Errors)
|
||||
bool WingVariables::ModifyBlueprint(WingOut Errors)
|
||||
{
|
||||
if (!CheckBlueprint(Errors)) return false;
|
||||
if (LinkBlueprintVariables(Errors)) return false;
|
||||
if (!LinkBlueprintVariables(Errors)) return false;
|
||||
for (Var &V : BlueprintVariables.Variables)
|
||||
{
|
||||
V.BPVar->VarType = V.Type;
|
||||
@@ -481,8 +481,8 @@ bool WingVariables::ModifyBlueprintDefaults(WingOut Errors)
|
||||
if (Input.DefaultSpecified) AnySpecified = true;
|
||||
if (!AnySpecified) return true;
|
||||
|
||||
FKismetEditorUtilities::CompileBlueprint(Blueprint);
|
||||
UObject *CDO = WingUtils::GetGeneratedCDO(Blueprint);
|
||||
FKismetEditorUtilities::CompileBlueprint(Blueprint.Get());
|
||||
UObject *CDO = WingUtils::GetGeneratedCDO(Blueprint.Get());
|
||||
if (!CDO)
|
||||
{
|
||||
Errors.Printf(TEXT("Blueprint didn't compile, cannot store default values"));
|
||||
@@ -535,7 +535,7 @@ bool WingVariables::ModifyCustomEvent(WingOut Errors)
|
||||
{
|
||||
if (!CheckCustomEvent(Errors)) return false;
|
||||
ClearLinks();
|
||||
if (!ModifyEditablePinBase(InputVariables, CustomEvent, Errors)) return false;
|
||||
if (!ModifyEditablePinBase(InputVariables, CustomEvent.Get(), Errors)) return false;
|
||||
CustomEvent->ReconstructNode();
|
||||
return true;
|
||||
}
|
||||
@@ -567,7 +567,7 @@ bool WingVariables::GetGraphNodes(
|
||||
LocalNode = nullptr;
|
||||
|
||||
TWeakObjectPtr<UK2Node_EditablePinBase> Inputs, Outputs;
|
||||
FBlueprintEditorUtils::GetEntryAndResultNodes(Graph, Inputs, Outputs);
|
||||
FBlueprintEditorUtils::GetEntryAndResultNodes(Graph.Get(), Inputs, Outputs);
|
||||
if (!Inputs.IsValid())
|
||||
{
|
||||
Errors.Printf(TEXT("ERROR: no function entry node for graph."));
|
||||
@@ -609,13 +609,13 @@ bool WingVariables::CreateBlueprint(WingOut Errors)
|
||||
|
||||
// Check for name collisions against existing variables, components, and the like.
|
||||
TSet<FName> Names;
|
||||
FBlueprintEditorUtils::GetClassVariableList(Blueprint, Names);
|
||||
FBlueprintEditorUtils::GetClassVariableList(Blueprint.Get(), Names);
|
||||
if (!WingUtils::FindNoDuplicateNames(Names, BlueprintVariables.Variables, TEXT("variable or component"), Errors)) return false;
|
||||
|
||||
// Create the variables.
|
||||
for (const WingVariables::Var& V : BlueprintVariables.Variables)
|
||||
{
|
||||
if (!FBlueprintEditorUtils::AddMemberVariable(Blueprint, V.Name, V.Type))
|
||||
if (!FBlueprintEditorUtils::AddMemberVariable(Blueprint.Get(), V.Name, V.Type))
|
||||
{
|
||||
Errors.Printf(TEXT("ERROR: Failed to add variable '%s'\n"),
|
||||
*WingUtils::ExternalizeID(V.Name));
|
||||
@@ -623,10 +623,10 @@ bool WingVariables::CreateBlueprint(WingOut Errors)
|
||||
}
|
||||
}
|
||||
|
||||
if (LinkBlueprintVariables(Errors)) return false;
|
||||
if (!LinkBlueprintVariables(Errors)) return false;
|
||||
for (Var &V : BlueprintVariables.Variables) ModifyBlueprintVariableFlags(V);
|
||||
if (!ModifyBlueprintDefaults(Errors)) return false;
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WingVariables::CreateGraph(WingOut Errors)
|
||||
@@ -663,10 +663,10 @@ bool WingVariables::CreateGraph(WingOut Errors)
|
||||
AddUserPinInfo(V, EGPD_Input, OutputNode);
|
||||
|
||||
// Create local variables via the proper API.
|
||||
UBlueprint* BP = FBlueprintEditorUtils::FindBlueprintForGraph(Graph);
|
||||
UBlueprint* BP = FBlueprintEditorUtils::FindBlueprintForGraph(Graph.Get());
|
||||
for (const Var& V : LocalVariables.Variables)
|
||||
{
|
||||
if (!FBlueprintEditorUtils::AddLocalVariable(BP, Graph, V.Name, V.Type, V.DefaultValue))
|
||||
if (!FBlueprintEditorUtils::AddLocalVariable(BP, Graph.Get(), V.Name, V.Type, V.DefaultValue))
|
||||
{
|
||||
Errors.Printf(TEXT("ERROR: Failed to create local variable '%s'\n"),
|
||||
*WingUtils::ExternalizeID(V.Name));
|
||||
@@ -692,7 +692,7 @@ bool WingVariables::CreateCustomEvent(WingOut Errors)
|
||||
Names, InputVariables.Variables, TEXT("event parameter"), Errors)) return false;
|
||||
|
||||
for (const Var& V : InputVariables.Variables)
|
||||
AddUserPinInfo(V, EGPD_Output, CustomEvent);
|
||||
AddUserPinInfo(V, EGPD_Output, CustomEvent.Get());
|
||||
|
||||
CustomEvent->ReconstructNode();
|
||||
return true;
|
||||
@@ -729,7 +729,7 @@ bool WingVariables::RemoveBlueprint(WingOut Errors)
|
||||
}
|
||||
|
||||
// Remove them.
|
||||
FBlueprintEditorUtils::BulkRemoveMemberVariables(Blueprint, Names);
|
||||
FBlueprintEditorUtils::BulkRemoveMemberVariables(Blueprint.Get(), Names);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -766,12 +766,12 @@ bool WingVariables::RemoveGraph(WingOut Errors)
|
||||
OutputNode->RemoveUserDefinedPinByName(V.Name);
|
||||
|
||||
// Remove local variables.
|
||||
UBlueprint* BP = FBlueprintEditorUtils::FindBlueprintForGraph(Graph);
|
||||
UBlueprint* BP = FBlueprintEditorUtils::FindBlueprintForGraph(Graph.Get());
|
||||
for (const Var& V : LocalVariables.Variables)
|
||||
{
|
||||
LocalNode->LocalVariables.RemoveAll(
|
||||
[&](const FBPVariableDescription& Desc) { return Desc.VarName == V.Name; });
|
||||
FBlueprintEditorUtils::RemoveVariableNodes(BP, V.Name, true, Graph);
|
||||
FBlueprintEditorUtils::RemoveVariableNodes(BP, V.Name, true, Graph.Get());
|
||||
}
|
||||
|
||||
if (InputNode) InputNode->ReconstructNode();
|
||||
@@ -798,22 +798,22 @@ bool WingVariables::RemoveCustomEvent(WingOut Errors)
|
||||
|
||||
bool WingVariables::SetBackingStore(UObject *Obj, WingOut Errors)
|
||||
{
|
||||
Blueprint = nullptr;
|
||||
Graph = nullptr;
|
||||
CustomEvent = nullptr;
|
||||
Blueprint.Reset();
|
||||
Graph.Reset();
|
||||
CustomEvent.Reset();
|
||||
if (UBlueprint *BP = Cast<UBlueprint>(Obj))
|
||||
{
|
||||
Blueprint = BP;
|
||||
Blueprint.Reset(BP);
|
||||
return true;
|
||||
}
|
||||
if (UEdGraph *G = Cast<UEdGraph>(Obj))
|
||||
{
|
||||
Graph = G;
|
||||
Graph.Reset(G);
|
||||
return true;
|
||||
}
|
||||
if (UK2Node_CustomEvent *E = Cast<UK2Node_CustomEvent>(Obj))
|
||||
{
|
||||
CustomEvent = E;
|
||||
CustomEvent.Reset(E);
|
||||
return true;
|
||||
}
|
||||
Errors.Printf(TEXT(
|
||||
|
||||
@@ -187,7 +187,7 @@ struct FWingStructAndUStruct
|
||||
|
||||
// Pin Ref: A pointer to a graph node, plus a pin name.
|
||||
UCLASS()
|
||||
class UWingPinReference : public UObject
|
||||
class UWingGraphPinRef : public UObject
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -202,7 +202,7 @@ public:
|
||||
// name. The component can be an inherited component, as
|
||||
// opposed to one that is defined in the blueprint itself.
|
||||
UCLASS()
|
||||
class UWingComponentReference : public UObject
|
||||
class UWingComponentRef : public UObject
|
||||
{
|
||||
GENERATED_BODY()
|
||||
public:
|
||||
@@ -218,7 +218,7 @@ public:
|
||||
// struct is marked CPF_Edit. If not, then the intent is
|
||||
// that this struct is for viewing only.
|
||||
UCLASS()
|
||||
class UWingStructPointer : public UObject
|
||||
class UWingStructRef : public UObject
|
||||
{
|
||||
GENERATED_BODY()
|
||||
public:
|
||||
|
||||
@@ -8,22 +8,22 @@ class USCS_Node;
|
||||
class UActorComponent;
|
||||
class USimpleConstructionScript;
|
||||
class UClass;
|
||||
class UWingComponentReference;
|
||||
class UWingComponentRef;
|
||||
class WingOut;
|
||||
|
||||
|
||||
struct UWingComponent
|
||||
{
|
||||
public:
|
||||
static UActorComponent* GetImmutableTemplate(const UWingComponentReference *Ref);
|
||||
static UActorComponent* GetMutableTemplate(const UWingComponentReference *Ref);
|
||||
static UActorComponent* GetImmutableTemplate(const UWingComponentRef *Ref);
|
||||
static UActorComponent* GetMutableTemplate(const UWingComponentRef *Ref);
|
||||
|
||||
static bool ReparentComponent(UWingComponentReference *Ref, UWingComponentReference *Parent, WingOut Errors);
|
||||
static bool DeleteComponent(UWingComponentReference *Ref, WingOut Errors);
|
||||
static bool ReparentComponent(UWingComponentRef *Ref, UWingComponentRef *Parent, WingOut Errors);
|
||||
static bool DeleteComponent(UWingComponentRef *Ref, WingOut Errors);
|
||||
static bool AddComponent(UBlueprint *BP, UClass *Class,
|
||||
UWingComponentReference *Parent, FName Name, WingOut Errors);
|
||||
UWingComponentRef *Parent, FName Name, WingOut Errors);
|
||||
|
||||
static TArray<TStrongObjectPtr<UWingComponentReference>> GetAll(UBlueprint* BP);
|
||||
static TArray<TStrongObjectPtr<UWingComponentRef>> GetAll(UBlueprint* BP);
|
||||
static void PrintAll(UBlueprint* BP, WingOut Out);
|
||||
|
||||
static bool CheckValidComponentClass(UClass *Class, WingOut Errors);
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Misc/OutputDeviceRedirector.h"
|
||||
#include "Misc/OutputDevice.h"
|
||||
|
||||
class FLogCaptureOutputDevice : public FOutputDevice
|
||||
{
|
||||
public:
|
||||
TArray<FString> CapturedErrors;
|
||||
bool bEnabled = true;
|
||||
|
||||
void Install() { GLog->AddOutputDevice(this); }
|
||||
void Uninstall() { GLog->RemoveOutputDevice(this); }
|
||||
bool bEnabled = false;
|
||||
|
||||
// If the device is marked 'CanBeUsedOnMultipleThreads,'
|
||||
// then UE_LOG will call Serialize from the current
|
||||
|
||||
@@ -18,7 +18,7 @@ class FSocket;
|
||||
*
|
||||
* Clients connect via TCP and exchange null-delimited JSON messages.
|
||||
* Request format: {"command": "tool_name", "param1": "value1", ...}
|
||||
* Response format: raw JSON result from the handler.
|
||||
* Response format: Text.
|
||||
*
|
||||
* Each connected client gets its own thread for blocking I/O;
|
||||
* tool calls are dispatched on the game thread.
|
||||
|
||||
@@ -63,8 +63,8 @@ public:
|
||||
static FName GetFName(const FWingProperty &Prop);
|
||||
static FName GetFName(const FUserPinInfo &Pin) { return Pin.PinName; }
|
||||
static FName GetFName(const TSharedPtr<FUserPinInfo> &Pin) { return Pin->PinName; }
|
||||
static FName GetFName(const UWingComponentReference *Ref) { return Ref->VariableName; }
|
||||
static FName GetFName(const TStrongObjectPtr<UWingComponentReference> &Ref) { return Ref->VariableName; }
|
||||
static FName GetFName(const UWingComponentRef *Ref) { return Ref->VariableName; }
|
||||
static FName GetFName(const TStrongObjectPtr<UWingComponentRef> &Ref) { return Ref->VariableName; }
|
||||
static FName GetFName(const UWidget *Widget) { return Widget->GetFName(); }
|
||||
static FName GetFName(const WingVariables::Var &Var) { return Var.Name; }
|
||||
|
||||
@@ -190,7 +190,7 @@ public:
|
||||
static FString FormatName(const TSharedPtr<IPropertyHandle> &Handle);
|
||||
static FString FormatName(const FUserPinInfo &Pin);
|
||||
static FString FormatName(const FBPInterfaceDescription &IFace);
|
||||
static FString FormatName(const UWingComponentReference *Ref);
|
||||
static FString FormatName(const UWingComponentRef *Ref);
|
||||
static FString FormatName(const UWidget *Widget);
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "EdGraph/EdGraphPin.h"
|
||||
#include "Engine/Blueprint.h"
|
||||
#include "K2Node_CustomEvent.h"
|
||||
#include "UObject/StrongObjectPtr.h"
|
||||
#include "WingBasics.h"
|
||||
|
||||
struct FBPVariableDescription;
|
||||
struct WingTokenizer;
|
||||
class UObject;
|
||||
class UBlueprint;
|
||||
class UEdGraph;
|
||||
class UK2Node_CustomEvent;
|
||||
class UK2Node_EditablePinBase;
|
||||
class UK2Node_FunctionEntry;
|
||||
struct FUserPinInfo;
|
||||
@@ -92,9 +92,9 @@ public:
|
||||
|
||||
// The backing store. Only one of these should be set.
|
||||
|
||||
UBlueprint *Blueprint = nullptr;
|
||||
UEdGraph *Graph = nullptr;
|
||||
UK2Node_CustomEvent *CustomEvent = nullptr;
|
||||
TStrongObjectPtr<UBlueprint> Blueprint;
|
||||
TStrongObjectPtr<UEdGraph> Graph;
|
||||
TStrongObjectPtr<UK2Node_CustomEvent> CustomEvent;
|
||||
|
||||
// The Workspace. At any given time, these may or may not contain
|
||||
// the same data as the backing store.
|
||||
|
||||
Reference in New Issue
Block a user