UE Wingman renaming complete.
This commit is contained in:
58
Plugins/UEWingman/Source/UEWingman/Public/WingBlueprintVar.h
Normal file
58
Plugins/UEWingman/Source/UEWingman/Public/WingBlueprintVar.h
Normal file
@@ -0,0 +1,58 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "WingProperty.h"
|
||||
#include "Engine/Blueprint.h"
|
||||
#include "WingBlueprintVar.generated.h"
|
||||
|
||||
// Editor-friendly view of a blueprint variable's properties.
|
||||
// Wraps an FBPVariableDescription, exposing commonly-used flags
|
||||
// and metadata as simple UPROPERTYs that the property system can
|
||||
// populate from JSON.
|
||||
USTRUCT()
|
||||
struct FBlueprintVar
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
FBPVariableDescription* Desc = nullptr;
|
||||
WingProperty DefaultValueProp;
|
||||
|
||||
FBlueprintVar() = default;
|
||||
FBlueprintVar(UBlueprint* BP, const FString& VarName);
|
||||
|
||||
bool NotFound() const { return Desc == nullptr; }
|
||||
|
||||
UPROPERTY(EditAnywhere, meta=(Optional, Description="Default value in Unreal text format"))
|
||||
FString DefaultValue;
|
||||
|
||||
UPROPERTY(EditAnywhere, meta=(Optional, Description="Variable description/tooltip"))
|
||||
FString Description;
|
||||
|
||||
UPROPERTY(EditAnywhere, meta=(Optional, Description="Allow editing on instances"))
|
||||
bool InstanceEditable = false;
|
||||
|
||||
UPROPERTY(EditAnywhere, meta=(Optional, Description="Read-only in blueprints"))
|
||||
bool BlueprintReadOnly = false;
|
||||
|
||||
UPROPERTY(EditAnywhere, meta=(Optional, Description="Expose as a pin when spawning"))
|
||||
bool ExposeOnSpawn = false;
|
||||
|
||||
UPROPERTY(EditAnywhere, meta=(Optional, Description="Private to this blueprint"))
|
||||
bool Private = false;
|
||||
|
||||
UPROPERTY(EditAnywhere, meta=(Optional, Description="Expose to cinematics/sequencer"))
|
||||
bool ExposeToCinematics = false;
|
||||
|
||||
// Load from Desc, populate from JSON, save back to Desc.
|
||||
bool ApplyJson(const FJsonObject* Json);
|
||||
|
||||
// Print all properties and their current values.
|
||||
void Dump();
|
||||
|
||||
private:
|
||||
void LoadFlags();
|
||||
void LoadDefault();
|
||||
void SaveFlags();
|
||||
bool SaveDefault();
|
||||
TArray<WingProperty> MergedProperties();
|
||||
};
|
||||
Reference in New Issue
Block a user