57 lines
1.9 KiB
C++
57 lines
1.9 KiB
C++
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "WingServer.h"
|
|
#include "WingBasics.h"
|
|
#include "WingFetcher.h"
|
|
#include "WingVariables.h"
|
|
#include "Variables_Remove.generated.h"
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// ---------------------------------------------------------------------------
|
|
// ---------------------------------------------------------------------------
|
|
|
|
UCLASS()
|
|
class UWing_Variables_Remove : public UWingHandler
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
UPROPERTY(EditAnywhere, meta=(Description="Path to a blueprint, graph, or custom event node"))
|
|
FString Object;
|
|
|
|
UPROPERTY(EditAnywhere, meta=(Optional, Description="Blueprint variable names to remove, comma-separated"))
|
|
FString BlueprintVariables;
|
|
|
|
UPROPERTY(EditAnywhere, meta=(Optional, Description="Input variable names to remove, comma-separated"))
|
|
FString InputVariables;
|
|
|
|
UPROPERTY(EditAnywhere, meta=(Optional, Description="Output variable names to remove, comma-separated"))
|
|
FString OutputVariables;
|
|
|
|
UPROPERTY(EditAnywhere, meta=(Optional, Description="Local variable names to remove, comma-separated"))
|
|
FString LocalVariables;
|
|
|
|
virtual void Register() override
|
|
{
|
|
UWingServer::AddHandler(this,
|
|
TEXT("Remove variables from a blueprint, graph, or custom event node."));
|
|
}
|
|
virtual void Handle() override
|
|
{
|
|
WingFetcher F(WingOut::Stdout);
|
|
UObject* Obj = F.Walk(Object).Cast<UObject>();
|
|
if (!Obj) return;
|
|
|
|
WingVariables Vars;
|
|
if (!Vars.SetBackingStore(Obj, WingOut::Stdout)) return;
|
|
if (!Vars.BlueprintVariables.ParseNamesString(BlueprintVariables, WingOut::Stdout)) return;
|
|
if (!Vars.InputVariables.ParseNamesString(InputVariables, WingOut::Stdout)) return;
|
|
if (!Vars.OutputVariables.ParseNamesString(OutputVariables, WingOut::Stdout)) return;
|
|
if (!Vars.LocalVariables.ParseNamesString(LocalVariables, WingOut::Stdout)) return;
|
|
if (!Vars.Remove(WingOut::Stdout)) return;
|
|
WingOut::Stdout.Printf(TEXT("Success.\n"));
|
|
}
|
|
};
|