This commit is contained in:
2026-04-08 03:40:59 -04:00
parent f4286faeb1
commit 73f84c1681
15 changed files with 46 additions and 46 deletions

View File

@@ -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

View File

@@ -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;

View File

@@ -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;

View File

@@ -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);

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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);

View File

@@ -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);

View File

@@ -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)

View File

@@ -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);
}

View File

@@ -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:

View File

@@ -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);

View File

@@ -7,7 +7,7 @@ class FLogCaptureOutputDevice : public FOutputDevice
{
public:
TArray<FString> CapturedErrors;
bool bEnabled = true;
bool bEnabled = false;
void Install() { GLog->AddOutputDevice(this); }
void Uninstall() { GLog->RemoveOutputDevice(this); }

View File

@@ -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);
////////////////////////////////////////////////////////