-
Notifications
You must be signed in to change notification settings - Fork 348
Expand file tree
/
Copy pathFlowGraphSettings.h
More file actions
205 lines (153 loc) · 7.39 KB
/
FlowGraphSettings.h
File metadata and controls
205 lines (153 loc) · 7.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
// Copyright https://github.com/MothCocoon/FlowGraph/graphs/contributors
#pragma once
#include "FlowGraphConnectionDrawingPolicy.h"
#include "Engine/DeveloperSettings.h"
#include "GameplayTagContainer.h"
#include "FlowTypes.h"
#include "Graph/FlowGraphNodesPolicy.h"
#include "FlowGraphSettings.generated.h"
class UFlowNodeBase;
USTRUCT()
struct FFlowNodeDisplayStyleConfig
{
GENERATED_BODY()
public:
FFlowNodeDisplayStyleConfig()
: TitleColor(FLinearColor::White)
{
}
FFlowNodeDisplayStyleConfig(const FGameplayTag& InTag, const FLinearColor& InNodeColor)
: Tag(InTag)
, TitleColor(InNodeColor)
{
}
FORCEINLINE bool operator ==(const FFlowNodeDisplayStyleConfig& Other) const
{
return Tag == Other.Tag;
}
FORCEINLINE bool operator !=(const FFlowNodeDisplayStyleConfig& Other) const
{
return Tag != Other.Tag;
}
FORCEINLINE bool operator <(const FFlowNodeDisplayStyleConfig& Other) const
{
return Tag < Other.Tag;
}
public:
UPROPERTY(Config, EditAnywhere, Category = "Nodes", meta = (Categories = "Flow.NodeStyle"))
FGameplayTag Tag;
UPROPERTY(Config, EditAnywhere, Category = "Nodes")
FLinearColor TitleColor;
};
/**
* Editor-only graph settings.
*/
UCLASS(Config = Editor, defaultconfig, meta = (DisplayName = "Flow Graph"))
class FLOWEDITOR_API UFlowGraphSettings : public UDeveloperSettings
{
GENERATED_UCLASS_BODY()
virtual void PostInitProperties() override;
#if WITH_EDITOR
virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
#endif
/* Show Flow Asset in Flow category of "Create Asset" menu?
* Requires restart after making a change. */
UPROPERTY(EditAnywhere, config, Category = "Default UI", meta = (ConfigRestartRequired = true))
bool bExposeFlowAssetCreation;
/* Show Flow Node blueprint in Flow category of "Create Asset" menu?
* Requires restart after making a change. */
UPROPERTY(EditAnywhere, config, Category = "Default UI", meta = (ConfigRestartRequired = true))
bool bExposeFlowNodeCreation;
/* Show Flow Asset toolbar?
* Requires restart after making a change. */
UPROPERTY(EditAnywhere, config, Category = "Default UI", meta = (ConfigRestartRequired = true))
bool bShowAssetToolbarAboveLevelEditor;
UPROPERTY(EditAnywhere, config, Category = "Default UI", meta = (ConfigRestartRequired = true))
FText FlowAssetCategoryName;
/* Use this class to create new assets. Class picker will show up if None. */
UPROPERTY(EditAnywhere, config, Category = "Default UI")
TSoftClassPtr<class UFlowAsset> DefaultFlowAssetClass;
/* Flow Asset class allowed to be assigned via Level Editor toolbar. */
UPROPERTY(EditAnywhere, config, Category = "Default UI", meta = (EditCondition = "bShowAssetToolbarAboveLevelEditor"))
TSoftClassPtr<class UFlowAsset> WorldAssetClass;
/* Hide specific nodes from the Flow Palette without changing the source code.
* Requires restart after making a change. */
UPROPERTY(EditAnywhere, config, Category = "Nodes", meta = (ConfigRestartRequired = true))
TArray<TSoftClassPtr<class UFlowNode>> NodesHiddenFromPalette;
/* Configurable map of FlowAsset subclasses to the FlowAssetNodePolicy for that subclass. */
UPROPERTY(EditAnywhere, Config, Category = "Nodes", meta = (ConfigRestartRequired = true, AllowedClasses = "/Script/Flow.FlowAsset"))
TMap<FSoftClassPath, FFlowGraphNodesPolicy> PerAssetSubclassFlowNodePolicies;
/* Allows anyone to override Flow Palette category for specific nodes without modifying source code. */
UPROPERTY(EditAnywhere, config, Category = "Nodes")
TMap<TSoftClassPtr<class UFlowNode>, FString> OverridenNodeCategories;
/* Hide default pin names on simple nodes, reduces UI clutter. */
UPROPERTY(EditAnywhere, config, Category = "Nodes")
bool bShowDefaultPinNames;
/* List of prefixes to hide on node titles and palette without need to add custom DisplayName.
* If node class has meta = (DisplayName = ... ) or BlueprintDisplayName, those texts will be displayed. */
UPROPERTY(EditAnywhere, config, Category = "Nodes")
TArray<FString> NodePrefixesToRemove;
/* Display Styles for nodes, keyed by Gameplay Tag. */
UPROPERTY(EditAnywhere, config, Category = "Nodes", meta = (TitleProperty = "{Tag}"))
TArray<FFlowNodeDisplayStyleConfig> NodeDisplayStyles;
#if WITH_EDITORONLY_DATA
/* Tags in the NodeDisplayStylesMap, used to detect when the map needs updating. */
UPROPERTY(Transient)
FGameplayTagContainer NodeDisplayStylesAuthoredTags;
/* Cached map of the data in NodeDisplayStyles for GameplayTag-keyed lookup. */
UPROPERTY(Transient)
TMap<FGameplayTag, FFlowNodeDisplayStyleConfig> NodeDisplayStylesMap;
#endif
UPROPERTY(EditAnywhere, config, Category = "Nodes", meta = (Deprecated))
TMap<EFlowNodeStyle, FLinearColor> NodeTitleColors;
UPROPERTY(Config, EditAnywhere, Category = "Nodes")
TMap<TSoftClassPtr<UFlowNode>, FLinearColor> NodeSpecificColors;
UPROPERTY(EditAnywhere, config, Category = "Nodes")
FLinearColor ExecPinColorModifier;
UPROPERTY(EditAnywhere, config, Category = "NodePopups")
FLinearColor NodeDescriptionBackground;
UPROPERTY(EditAnywhere, config, Category = "NodePopups")
FLinearColor NodeStatusBackground;
UPROPERTY(EditAnywhere, config, Category = "NodePopups")
FLinearColor NodePreloadedBackground;
UPROPERTY(config, EditAnywhere, Category = "Wires")
EFlowConnectionDrawType ConnectionDrawType;
UPROPERTY(config, EditAnywhere, Category = "Wires", meta = (EditCondition = "ConnectionDrawType == EFlowConnectionDrawType::Circuit"))
float CircuitConnectionAngle;
UPROPERTY(config, EditAnywhere, Category = "Wires", meta = (EditCondition = "ConnectionDrawType == EFlowConnectionDrawType::Circuit"))
FVector2D CircuitConnectionSpacing;
UPROPERTY(EditAnywhere, config, Category = "Wires")
FLinearColor InactiveWireColor;
UPROPERTY(EditAnywhere, config, Category = "Wires", meta = (ClampMin = 0.0f))
float InactiveWireThickness;
UPROPERTY(EditAnywhere, config, Category = "Wires", meta = (ClampMin = 1.0f))
float RecentWireDuration;
/* The color to display execution wires that were just executed. */
UPROPERTY(EditAnywhere, config, Category = "Wires")
FLinearColor RecentWireColor;
UPROPERTY(EditAnywhere, config, Category = "Wires", meta = (ClampMin = 0.0f))
float RecentWireThickness;
UPROPERTY(EditAnywhere, config, Category = "Wires")
FLinearColor RecordedWireColor;
UPROPERTY(EditAnywhere, config, Category = "Wires", meta = (ClampMin = 0.0f))
float RecordedWireThickness;
UPROPERTY(EditAnywhere, config, Category = "Wires")
FLinearColor SelectedWireColor;
UPROPERTY(EditAnywhere, config, Category = "Wires", meta = (ClampMin = 0.0f))
float SelectedWireThickness;
UPROPERTY(EditAnywhere, config, Category = "Details", meta = (ConfigRestartRequired = true))
bool bShowFlowTagsInActorDetails = true;
/** FlowComponent only. Move category Flow to the top of details panel */
UPROPERTY(EditAnywhere, config, Category = "Details")
bool bMarkFlowCategoryImportant = true;
public:
virtual FName GetCategoryName() const override { return FName("Flow Graph"); }
virtual FText GetSectionText() const override { return INVTEXT("Graph Settings"); }
/* Override-safe category query for Flow Node. */
static FString GetNodeCategoryForNode(const UFlowNodeBase& FlowNodeBase);
#if WITH_EDITOR
const TMap<FGameplayTag, FFlowNodeDisplayStyleConfig>& EnsureNodeDisplayStylesMap();
void TryAddDefaultNodeDisplayStyle(const FFlowNodeDisplayStyleConfig& StyleConfig);
const FLinearColor* LookupNodeTitleColorForNode(const UFlowNodeBase& FlowNodeBase);
#endif
};