A small refactor in UEWingman, for readability
This commit is contained in:
@@ -19,7 +19,7 @@ class UWing_ActorComponent_Remove : public UWingHandler
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Path to the component (e.g. '/Game/MyBP,component:MyComp')"))
|
||||
FString Component;
|
||||
FString ComponentPath;
|
||||
|
||||
virtual void Register() override
|
||||
{
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
virtual void Handle() override
|
||||
{
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UWingComponentRef* CompRef = F.Walk(Component).Cast<UWingComponentRef>();
|
||||
UWingComponentRef* CompRef = F.Walk(ComponentPath).Cast<UWingComponentRef>();
|
||||
if (!CompRef) return;
|
||||
|
||||
if (!UWingComponent::DeleteComponent(CompRef, WingOut::Stdout)) return;
|
||||
|
||||
@@ -21,7 +21,7 @@ class UWing_ActorComponent_Reparent : public UWingHandler
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Path to the component (e.g. '/Game/MyBP,component:MyComp')"))
|
||||
FString Component;
|
||||
FString ComponentPath;
|
||||
|
||||
UPROPERTY(EditAnywhere, meta=(Description="New parent component name."))
|
||||
FString Parent;
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
virtual void Handle() override
|
||||
{
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UWingComponentRef* CompRef = F.Walk(Component).Cast<UWingComponentRef>();
|
||||
UWingComponentRef* CompRef = F.Walk(ComponentPath).Cast<UWingComponentRef>();
|
||||
if (!CompRef) return;
|
||||
|
||||
// Find the new parent among all components (if specified)
|
||||
|
||||
@@ -24,7 +24,7 @@ class UWing_BlueprintGraph_Add : public UWingHandler
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Blueprint name or package path"))
|
||||
FString Blueprint;
|
||||
FString BlueprintPath;
|
||||
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Name for the new graph"))
|
||||
FString Graph;
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
}
|
||||
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UBlueprint* BP = F.Walk(Blueprint).Cast<UBlueprint>();
|
||||
UBlueprint* BP = F.Walk(BlueprintPath).Cast<UBlueprint>();
|
||||
if (!BP) return;
|
||||
|
||||
// Check that this graph type is valid for this blueprint type
|
||||
|
||||
@@ -22,7 +22,7 @@ class UWing_BlueprintGraph_Remove : public UWingHandler
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Path to the graph, e.g. /Game/MyBP,graph:MyFunction"))
|
||||
FString Graph;
|
||||
FString GraphPath;
|
||||
|
||||
virtual void Register() override
|
||||
{
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
virtual void Handle() override
|
||||
{
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UEdGraph* FoundGraph = F.Walk(Graph).Cast<UEdGraph>();
|
||||
UEdGraph* FoundGraph = F.Walk(GraphPath).Cast<UEdGraph>();
|
||||
if (!FoundGraph) return;
|
||||
|
||||
UBlueprint* BP = FBlueprintEditorUtils::FindBlueprintForGraph(FoundGraph);
|
||||
|
||||
@@ -22,7 +22,7 @@ class UWing_BlueprintOverride_Add : public UWingHandler
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Blueprint path"))
|
||||
FString Blueprint;
|
||||
FString BlueprintPath;
|
||||
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Function to override, in Class|Function format"))
|
||||
FString Function;
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
virtual void Handle() override
|
||||
{
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UBlueprint* BP = F.Walk(Blueprint).Cast<UBlueprint>();
|
||||
UBlueprint* BP = F.Walk(BlueprintPath).Cast<UBlueprint>();
|
||||
if (!BP) return;
|
||||
|
||||
// Find the function by matching against the menu string format (Class|Function)
|
||||
|
||||
@@ -21,7 +21,7 @@ class UWing_BlueprintOverride_ShowMenu : public UWingHandler
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Blueprint path"))
|
||||
FString Blueprint;
|
||||
FString BlueprintPath;
|
||||
|
||||
virtual void Register() override
|
||||
{
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
virtual void Handle() override
|
||||
{
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UBlueprint* BP = F.Walk(Blueprint).Cast<UBlueprint>();
|
||||
UBlueprint* BP = F.Walk(BlueprintPath).Cast<UBlueprint>();
|
||||
if (!BP) return;
|
||||
|
||||
TArray<UFunction*> Results = WingUtils::GetOverridableFunctions(BP);
|
||||
|
||||
@@ -30,7 +30,7 @@ class UWing_Blueprint_Dump : public UWingHandler
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Blueprint path"))
|
||||
FString Blueprint;
|
||||
FString BlueprintPath;
|
||||
|
||||
virtual void Register() override
|
||||
{
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
virtual void Handle() override
|
||||
{
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UBlueprint* BP = F.Walk(Blueprint).Cast<UBlueprint>();
|
||||
UBlueprint* BP = F.Walk(BlueprintPath).Cast<UBlueprint>();
|
||||
if (!BP) return;
|
||||
|
||||
// Header
|
||||
|
||||
@@ -14,7 +14,7 @@ class UWing_Details_Dump : public UWingHandler
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Target object"))
|
||||
FString Object;
|
||||
FString ObjectPath;
|
||||
|
||||
virtual void Register() override
|
||||
{
|
||||
@@ -25,7 +25,7 @@ public:
|
||||
virtual void Handle() override
|
||||
{
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UObject* Target = F.Walk(Object).Cast<UObject>();
|
||||
UObject* Target = F.Walk(ObjectPath).Cast<UObject>();
|
||||
if (!Target) return;
|
||||
|
||||
TArray<FWingProperty> Props = FWingProperty::GetDetails(Target, false);
|
||||
|
||||
@@ -15,7 +15,7 @@ class UWing_Details_Get : public UWingHandler
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Target object"))
|
||||
FString Object;
|
||||
FString ObjectPath;
|
||||
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Property name"))
|
||||
FString Property;
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
virtual void Handle() override
|
||||
{
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UObject* Obj = F.Walk(Object).Cast<UObject>();
|
||||
UObject* Obj = F.Walk(ObjectPath).Cast<UObject>();
|
||||
if (!Obj) return;
|
||||
|
||||
TArray<FWingProperty> Props = FWingProperty::GetDetails(Obj, false);
|
||||
|
||||
@@ -15,7 +15,7 @@ class UWing_Details_Set : public UWingHandler
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Target object"))
|
||||
FString Object;
|
||||
FString ObjectPath;
|
||||
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Property name"))
|
||||
FString Property;
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
virtual void Handle() override
|
||||
{
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UObject* Obj = F.Walk(Object).Cast<UObject>();
|
||||
UObject* Obj = F.Walk(ObjectPath).Cast<UObject>();
|
||||
if (!Obj) return;
|
||||
|
||||
TArray<FWingProperty> Props = FWingProperty::GetDetails(Obj, true);
|
||||
|
||||
@@ -20,7 +20,7 @@ class UWing_Editor_OpenAsset : public UWingHandler
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Asset to open"))
|
||||
FString Asset;
|
||||
FString AssetPath;
|
||||
|
||||
virtual void Register() override
|
||||
{
|
||||
@@ -30,7 +30,7 @@ public:
|
||||
virtual void Handle() override
|
||||
{
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UObject* Obj = F.Walk(Asset).Cast<UObject>();
|
||||
UObject* Obj = F.Walk(AssetPath).Cast<UObject>();
|
||||
if (!Obj) return;
|
||||
|
||||
UAssetEditorSubsystem* Sub = GEditor->GetEditorSubsystem<UAssetEditorSubsystem>();
|
||||
|
||||
@@ -23,7 +23,7 @@ class UWing_EventDispatcher_Add : public UWingHandler
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Blueprint name or package path"))
|
||||
FString Blueprint;
|
||||
FString BlueprintPath;
|
||||
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Name of the new event dispatcher"))
|
||||
FString Dispatcher;
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
virtual void Handle() override
|
||||
{
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UBlueprint* BP = F.Walk(Blueprint).Cast<UBlueprint>();
|
||||
UBlueprint* BP = F.Walk(BlueprintPath).Cast<UBlueprint>();
|
||||
if (!BP) return;
|
||||
|
||||
// Check for valid proposed name
|
||||
|
||||
@@ -21,7 +21,7 @@ class UWing_EventDispatcher_Remove : public UWingHandler
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Blueprint name or package path"))
|
||||
FString Blueprint;
|
||||
FString BlueprintPath;
|
||||
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Name of the event dispatcher to delete"))
|
||||
FString Dispatcher;
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
virtual void Handle() override
|
||||
{
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UBlueprint* BP = F.Walk(Blueprint).Cast<UBlueprint>();
|
||||
UBlueprint* BP = F.Walk(BlueprintPath).Cast<UBlueprint>();
|
||||
if (!BP) return;
|
||||
|
||||
FBPVariableDescription* Var = WingUtils::FindOneWithExternalID(Dispatcher, BP->NewVariables, TEXT("Dispatcher"), WingOut::Stdout);
|
||||
|
||||
@@ -22,7 +22,7 @@ class UWing_GraphNode_Add : public UWingHandler
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Target graph"))
|
||||
FString Graph;
|
||||
FString GraphPath;
|
||||
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Node type, from GraphNode_SearchTypes"))
|
||||
FString Type;
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
virtual void Handle() override
|
||||
{
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UEdGraph* TargetGraph = F.Walk(Graph).Cast<UEdGraph>();
|
||||
UEdGraph* TargetGraph = F.Walk(GraphPath).Cast<UEdGraph>();
|
||||
if (!TargetGraph) return;
|
||||
|
||||
FWingGraphActions GraphActions(TargetGraph);
|
||||
|
||||
@@ -20,7 +20,7 @@ class UWing_GraphNode_ChooseMenu : public UWingHandler
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Target node"))
|
||||
FString Node;
|
||||
FString NodePath;
|
||||
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Menu item as shown by GraphNode_ShowMenu"))
|
||||
FString Item;
|
||||
@@ -36,7 +36,7 @@ private:
|
||||
virtual void Handle() override
|
||||
{
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UEdGraphNode* NodeObj = F.Walk(Node).Cast<UEdGraphNode>();
|
||||
UEdGraphNode* NodeObj = F.Walk(NodePath).Cast<UEdGraphNode>();
|
||||
if (!NodeObj) return;
|
||||
|
||||
FToolMenuContext Context;
|
||||
|
||||
@@ -19,7 +19,7 @@ class UWing_GraphNode_Dump : public UWingHandler
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Target node"))
|
||||
FString Node;
|
||||
FString NodePath;
|
||||
|
||||
UPROPERTY(EditAnywhere, meta=(Description="True to show minor node properties"))
|
||||
bool Details = false;
|
||||
@@ -33,7 +33,7 @@ private:
|
||||
virtual void Handle() override
|
||||
{
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UEdGraphNode* NodeObj = F.Walk(Node).Cast<UEdGraphNode>();
|
||||
UEdGraphNode* NodeObj = F.Walk(NodePath).Cast<UEdGraphNode>();
|
||||
if (!NodeObj) return;
|
||||
|
||||
WingGraphExport Exporter(NodeObj, false, Details);
|
||||
|
||||
@@ -20,7 +20,7 @@ class UWing_GraphNode_GetComment : public UWingHandler
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Target node"))
|
||||
FString Node;
|
||||
FString NodePath;
|
||||
|
||||
virtual void Register() override
|
||||
{
|
||||
@@ -30,7 +30,7 @@ public:
|
||||
virtual void Handle() override
|
||||
{
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UEdGraphNode* FoundNode = F.Walk(Node).Cast<UEdGraphNode>();
|
||||
UEdGraphNode* FoundNode = F.Walk(NodePath).Cast<UEdGraphNode>();
|
||||
if (!FoundNode) return;
|
||||
|
||||
WingOut::Stdout.Printf(TEXT("Node: %s\n"), *WingUtils::FormatName(FoundNode));
|
||||
|
||||
@@ -24,7 +24,7 @@ class UWing_GraphNode_Remove : public UWingHandler
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Node to delete"))
|
||||
FString Node;
|
||||
FString NodePath;
|
||||
|
||||
virtual void Register() override
|
||||
{
|
||||
@@ -35,7 +35,7 @@ public:
|
||||
virtual void Handle() override
|
||||
{
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UEdGraphNode* FoundNode = F.Walk(Node).Cast<UEdGraphNode>();
|
||||
UEdGraphNode* FoundNode = F.Walk(NodePath).Cast<UEdGraphNode>();
|
||||
if (!FoundNode) return;
|
||||
|
||||
UEdGraph* Graph = FoundNode->GetGraph();
|
||||
|
||||
@@ -20,7 +20,7 @@ class UWing_GraphNode_Rename : public UWingHandler
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Target node"))
|
||||
FString Node;
|
||||
FString NodePath;
|
||||
|
||||
UPROPERTY(EditAnywhere, meta=(Description="New name for the node"))
|
||||
FString Name;
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
virtual void Handle() override
|
||||
{
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UEdGraphNode* FoundNode = F.Walk(Node).Cast<UEdGraphNode>();
|
||||
UEdGraphNode* FoundNode = F.Walk(NodePath).Cast<UEdGraphNode>();
|
||||
if (!FoundNode) return;
|
||||
|
||||
if (!WingUtils::CheckCanRename(FoundNode, Name, WingOut::Stdout)) return;
|
||||
|
||||
@@ -20,7 +20,7 @@ class UWing_GraphNode_SearchTypes : public UWingHandler
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Target graph"))
|
||||
FString Graph;
|
||||
FString GraphPath;
|
||||
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Maximum number of results per query"))
|
||||
int32 MaxResults = 50;
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
virtual void Handle() override
|
||||
{
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UEdGraph* TargetGraph = F.Walk(Graph).Cast<UEdGraph>();
|
||||
UEdGraph* TargetGraph = F.Walk(GraphPath).Cast<UEdGraph>();
|
||||
if (!TargetGraph) return;
|
||||
|
||||
FWingGraphActions GraphActions(TargetGraph);
|
||||
|
||||
@@ -20,7 +20,7 @@ class UWing_GraphNode_SetComment : public UWingHandler
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Target node"))
|
||||
FString Node;
|
||||
FString NodePath;
|
||||
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Comment text to set"))
|
||||
FString Comment;
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
virtual void Handle() override
|
||||
{
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UEdGraphNode* FoundNode = F.Walk(Node).Cast<UEdGraphNode>();
|
||||
UEdGraphNode* FoundNode = F.Walk(NodePath).Cast<UEdGraphNode>();
|
||||
if (!FoundNode) return;
|
||||
|
||||
FoundNode->NodeComment = Comment;
|
||||
|
||||
@@ -17,11 +17,8 @@ class UWing_GraphNode_SetDefault : public UWingHandler
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Target graph"))
|
||||
FString Graph;
|
||||
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Target node"))
|
||||
FString Node;
|
||||
FString NodePath;
|
||||
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Pin or property name"))
|
||||
FString Name;
|
||||
@@ -38,16 +35,11 @@ public:
|
||||
// K2 graphs: set pin default values.
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
void HandleK2(UEdGraph* GraphObj, const UEdGraphSchema_K2* K2Schema)
|
||||
void HandleK2(UEdGraphNode* FoundNode, const UEdGraphSchema_K2* K2Schema)
|
||||
{
|
||||
WingFetcher F(GraphObj, WingOut::Stdout);
|
||||
UWingGraphPinRef* PinRef = F.Node(Node).Pin(Name).Cast<UWingGraphPinRef>();
|
||||
if (!PinRef) return;
|
||||
UEdGraphPin* Pin = WingUtils::CheckGetPin(PinRef->Node, PinRef->PinName, WingOut::Stdout);
|
||||
UEdGraphPin* Pin = WingUtils::CheckGetPin(FoundNode, FName(*Name), WingOut::Stdout);
|
||||
if (!Pin) return;
|
||||
|
||||
UEdGraphNode* FoundNode = Pin->GetOwningNode();
|
||||
|
||||
if (Pin->Direction != EGPD_Input)
|
||||
{
|
||||
WingOut::Stdout.Printf(TEXT("error: %s is an output pin\n"), *WingUtils::FormatName(Pin));
|
||||
@@ -72,12 +64,8 @@ public:
|
||||
// Material graphs: set material expression properties.
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
void HandleMaterial(UEdGraph* GraphObj)
|
||||
void HandleMaterial(UEdGraphNode* FoundNode)
|
||||
{
|
||||
WingFetcher F(GraphObj, WingOut::Stdout);
|
||||
UEdGraphNode* FoundNode = F.Node(Node).Cast<UEdGraphNode>();
|
||||
if (!FoundNode) return;
|
||||
|
||||
TArray<FWingProperty> All = FWingProperty::GetDetails(FoundNode, true);
|
||||
FWingProperty *P = WingUtils::FindOneWithExternalID(Name, All, TEXT("Property"), WingOut::Stdout);
|
||||
if (!P) return;
|
||||
@@ -92,12 +80,11 @@ public:
|
||||
|
||||
virtual void Handle() override
|
||||
{
|
||||
// Fetch the graph once.
|
||||
WingFetcher GraphFetcher(WingOut::Stdout);
|
||||
UEdGraph* GraphObj = GraphFetcher.Walk(Graph).Cast<UEdGraph>();
|
||||
if (!GraphObj) return;
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UEdGraphNode* FoundNode = F.Walk(NodePath).Cast<UEdGraphNode>();
|
||||
if (!FoundNode) return;
|
||||
|
||||
const UEdGraphSchema* Schema = GraphObj->GetSchema();
|
||||
const UEdGraphSchema* Schema = FoundNode->GetGraph()->GetSchema();
|
||||
const UEdGraphSchema_K2* K2Schema = Cast<UEdGraphSchema_K2>(Schema);
|
||||
const UMaterialGraphSchema* MGSchema = Cast<UMaterialGraphSchema>(Schema);
|
||||
|
||||
@@ -107,8 +94,8 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
if (K2Schema) HandleK2(GraphObj, K2Schema);
|
||||
else if (MGSchema) HandleMaterial(GraphObj);
|
||||
if (K2Schema) HandleK2(FoundNode, K2Schema);
|
||||
else if (MGSchema) HandleMaterial(FoundNode);
|
||||
|
||||
WingOut::Stdout.Printf(TEXT("Done.\n"));
|
||||
}
|
||||
|
||||
@@ -15,11 +15,8 @@ class UWing_GraphNode_SetPosition : public UWingHandler
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Target graph"))
|
||||
FString Graph;
|
||||
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Target node"))
|
||||
FString Node;
|
||||
FString NodePath;
|
||||
|
||||
UPROPERTY(EditAnywhere, meta=(Description="New X position"))
|
||||
int32 X = 0;
|
||||
@@ -35,11 +32,7 @@ public:
|
||||
virtual void Handle() override
|
||||
{
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UEdGraph* TargetGraph = F.Walk(Graph).Cast<UEdGraph>();
|
||||
if (!TargetGraph) return;
|
||||
|
||||
WingFetcher FN(TargetGraph, WingOut::Stdout);
|
||||
UEdGraphNode* FoundNode = FN.Node(Node).Cast<UEdGraphNode>();
|
||||
UEdGraphNode* FoundNode = F.Walk(NodePath).Cast<UEdGraphNode>();
|
||||
if (!FoundNode) return;
|
||||
|
||||
FoundNode->NodePosX = X;
|
||||
|
||||
@@ -21,7 +21,7 @@ class UWing_GraphNode_ShowMenu : public UWingHandler
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Target node"))
|
||||
FString Node;
|
||||
FString NodePath;
|
||||
|
||||
virtual void Register() override
|
||||
{
|
||||
@@ -32,7 +32,7 @@ private:
|
||||
virtual void Handle() override
|
||||
{
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UEdGraphNode* NodeObj = F.Walk(Node).Cast<UEdGraphNode>();
|
||||
UEdGraphNode* NodeObj = F.Walk(NodePath).Cast<UEdGraphNode>();
|
||||
if (!NodeObj) return;
|
||||
|
||||
if (Cast<UMaterialGraphNode>(NodeObj))
|
||||
|
||||
@@ -18,7 +18,7 @@ class UWing_GraphPin_Connect : public UWingHandler
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Target graph"))
|
||||
FString Graph;
|
||||
FString GraphPath;
|
||||
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Alternating source pin / target pin strings"))
|
||||
FWingRestOfArgv SourcePin_TargetPin;
|
||||
@@ -33,7 +33,7 @@ public:
|
||||
virtual void Handle() override
|
||||
{
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UEdGraph* G = F.Walk(Graph).Cast<UEdGraph>();
|
||||
UEdGraph* G = F.Walk(GraphPath).Cast<UEdGraph>();
|
||||
if (!G) return;
|
||||
|
||||
if ((SourcePin_TargetPin.Argv.Num() % 2) != 0)
|
||||
|
||||
@@ -21,7 +21,7 @@ class UWing_GraphPin_Disconnect : public UWingHandler
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Target graph"))
|
||||
FString Graph;
|
||||
FString GraphPath;
|
||||
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Pin ID strings"))
|
||||
FWingRestOfArgv Pins;
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
virtual void Handle() override
|
||||
{
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UEdGraph* G = F.Walk(Graph).Cast<UEdGraph>();
|
||||
UEdGraph* G = F.Walk(GraphPath).Cast<UEdGraph>();
|
||||
if (!G) return;
|
||||
|
||||
int32 SuccessCount = 0;
|
||||
|
||||
@@ -20,7 +20,7 @@ class UWing_Graph_Dump : public UWingHandler
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Path to graph"))
|
||||
FString Graph;
|
||||
FString GraphPath;
|
||||
|
||||
UPROPERTY(EditAnywhere, meta=(Description="True to show minor node properties"))
|
||||
bool Details = false;
|
||||
@@ -33,7 +33,7 @@ public:
|
||||
virtual void Handle() override
|
||||
{
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UEdGraph *G = F.Walk(Graph).Cast<UEdGraph>();
|
||||
UEdGraph *G = F.Walk(GraphPath).Cast<UEdGraph>();
|
||||
if (!G) return;
|
||||
|
||||
WingGraphExport Exporter(G, true, Details);
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "WingServer.h"
|
||||
#include "WingBasics.h"
|
||||
#include "Containers/BitArray.h"
|
||||
#include "Containers/SparseArray.h"
|
||||
#include "Test_TMaps.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS()
|
||||
class UWing_Test_TMaps : public UWingHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
virtual void Register() override
|
||||
{
|
||||
UWingServer::AddHandler(this,
|
||||
TEXT("Constructs a small TMap, TBitArray, and TSparseArray so that "
|
||||
"a developer can set a breakpoint and inspect them with the "
|
||||
"lldb data formatters."));
|
||||
}
|
||||
|
||||
virtual void Handle() override
|
||||
{
|
||||
TMap<int32, FString> Map;
|
||||
Map.Add(1, TEXT("one"));
|
||||
Map.Add(2, TEXT("two"));
|
||||
Map.Add(3, TEXT("three"));
|
||||
Map.Add(42, TEXT("forty-two"));
|
||||
|
||||
TBitArray<> Bits;
|
||||
Bits.Add(true);
|
||||
Bits.Add(false);
|
||||
Bits.Add(true);
|
||||
Bits.Add(true);
|
||||
Bits.Add(false);
|
||||
|
||||
// Add a few entries, then remove a middle one so the live set is
|
||||
// non-contiguous. Exercises the sparse-array formatter against a hole.
|
||||
TSparseArray<FString> Sparse;
|
||||
Sparse.Add(TEXT("alpha"));
|
||||
int32 BetaIdx = Sparse.Add(TEXT("beta"));
|
||||
Sparse.Add(TEXT("gamma"));
|
||||
Sparse.Add(TEXT("delta"));
|
||||
Sparse.RemoveAt(BetaIdx);
|
||||
|
||||
TTuple<int32, FString, float, bool, FName> Tuple(1, TEXT("hello"), 3.14f, true, FName("world"));
|
||||
|
||||
// Set a breakpoint on the following line to inspect Map, Bits, and Sparse.
|
||||
WingOut::Stdout.Printf(TEXT("Test_TMaps: Map has %d entries, Bits has %d bits, Sparse has %d entries.\n"),
|
||||
Map.Num(), Bits.Num(), Sparse.Num());
|
||||
}
|
||||
};
|
||||
@@ -19,7 +19,7 @@ class UWing_Variables_Add : public UWingHandler
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Path to a blueprint, graph, or custom event node"))
|
||||
FString Object;
|
||||
FString ObjectPath;
|
||||
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Variable descriptions"))
|
||||
FWingRestOfArgv Variables;
|
||||
@@ -35,7 +35,7 @@ public:
|
||||
virtual void Handle() override
|
||||
{
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UObject* Obj = F.Walk(Object).Cast<UObject>();
|
||||
UObject* Obj = F.Walk(ObjectPath).Cast<UObject>();
|
||||
if (!Obj) return;
|
||||
|
||||
WingVariables Vars;
|
||||
|
||||
@@ -19,7 +19,7 @@ class UWing_Variables_Dump : public UWingHandler
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Path to a blueprint, graph, or custom event node"))
|
||||
FString Object;
|
||||
FString ObjectPath;
|
||||
|
||||
virtual void Register() override
|
||||
{
|
||||
@@ -30,7 +30,7 @@ public:
|
||||
virtual void Handle() override
|
||||
{
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UObject* Obj = F.Walk(Object).Cast<UObject>();
|
||||
UObject* Obj = F.Walk(ObjectPath).Cast<UObject>();
|
||||
if (!Obj) return;
|
||||
|
||||
WingVariables Vars;
|
||||
|
||||
@@ -19,7 +19,7 @@ class UWing_Variables_Modify : public UWingHandler
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Path to a blueprint, graph, or custom event node"))
|
||||
FString Object;
|
||||
FString ObjectPath;
|
||||
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Variable descriptions"))
|
||||
FWingRestOfArgv Variables;
|
||||
@@ -35,7 +35,7 @@ public:
|
||||
virtual void Handle() override
|
||||
{
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UObject* Obj = F.Walk(Object).Cast<UObject>();
|
||||
UObject* Obj = F.Walk(ObjectPath).Cast<UObject>();
|
||||
if (!Obj) return;
|
||||
|
||||
WingVariables Vars;
|
||||
|
||||
@@ -19,7 +19,7 @@ class UWing_Variables_Remove : public UWingHandler
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Path to a blueprint, graph, or custom event node"))
|
||||
FString Object;
|
||||
FString ObjectPath;
|
||||
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Variable descriptions"))
|
||||
FWingRestOfArgv Variables;
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
virtual void Handle() override
|
||||
{
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UObject* Obj = F.Walk(Object).Cast<UObject>();
|
||||
UObject* Obj = F.Walk(ObjectPath).Cast<UObject>();
|
||||
if (!Obj) return;
|
||||
|
||||
WingVariables Vars;
|
||||
|
||||
@@ -25,7 +25,7 @@ class UWing_Widget_Add : public UWingHandler
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Widget blueprint to add the widget to"))
|
||||
FString Blueprint;
|
||||
FString BlueprintPath;
|
||||
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Widget type, from Widget_SearchTypes"))
|
||||
FString Type;
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
{
|
||||
// Fetch the widget blueprint.
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UWidgetBlueprint* BP = F.Walk(Blueprint).Cast<UWidgetBlueprint>();
|
||||
UWidgetBlueprint* BP = F.Walk(BlueprintPath).Cast<UWidgetBlueprint>();
|
||||
if (!BP) return;
|
||||
|
||||
// Resolve the widget type.
|
||||
|
||||
@@ -23,7 +23,7 @@ class UWing_Widget_Remove : public UWingHandler
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Path to the widget, eg /Game/Widgets/WB_Test,widget:MyButton"))
|
||||
FString Widget;
|
||||
FString WidgetPath;
|
||||
|
||||
virtual void Register() override
|
||||
{
|
||||
@@ -35,7 +35,7 @@ public:
|
||||
{
|
||||
// Walk to the widget.
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UWidget* TargetWidget = F.Walk(Widget).Cast<UWidget>();
|
||||
UWidget* TargetWidget = F.Walk(WidgetPath).Cast<UWidget>();
|
||||
if (!TargetWidget) return;
|
||||
|
||||
// Get the widget blueprint and tree from the widget's outer chain.
|
||||
|
||||
@@ -23,7 +23,7 @@ class UWing_Widget_Reparent : public UWingHandler
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Path to the widget, eg /Game/Widgets/WB_Test,widget:MyButton"))
|
||||
FString Widget;
|
||||
FString WidgetPath;
|
||||
|
||||
UPROPERTY(EditAnywhere, meta=(Description="Name of the new parent widget. Must be a panel."))
|
||||
FString Parent;
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
{
|
||||
// Walk to the widget.
|
||||
WingFetcher F(WingOut::Stdout);
|
||||
UWidget* TargetWidget = F.Walk(Widget).Cast<UWidget>();
|
||||
UWidget* TargetWidget = F.Walk(WidgetPath).Cast<UWidget>();
|
||||
if (!TargetWidget) return;
|
||||
|
||||
// Get the widget blueprint from the widget's outer chain.
|
||||
|
||||
Reference in New Issue
Block a user