You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Overview: - An "override flag" is an inline toggle-style Boolean edit condition. These are implicitly set to true at runtime within the output struct value if any member that's bound to it is exposed as a visible input pin on a MakeStruct node. - For context, the Property Editor implicitly sets an override flag to true at edit time when a member that's bound to it is enabled for editing. These members are not otherwise labeled/exposed for direct editing. - An override flag is meant to signal to a system that the user wishes to use the bound member's value in place of the current value (whatever that may be) when the full struct value is applied. Examples: FPostProcessSettings, FMovieSceneSequencePlaybackSettings, etc. Previous UX: - All boolean edit conditions were being treated as override flags on a MakeStruct node. - Any inline toggle edit condition that did not begin with "bOverride_" or whose suffix otherwise did not match another value member could be exposed as an input on a MakeStruct node. - Override flags exposed as inputs would always be set to TRUE at runtime regardless of input if it was declared at the top of the struct and if a member value bound to it was also exposed as an input pin. After this change: - Only inline toggle edit conditions and legacy struct members that follow the "bOverride_" naming convention will be treated as an override flag on a MakeStruct node. - Inline toggle edit conditions can no longer be exposed directly as an input on a MakeStruct node. The intent was to bring the MakeStruct node UX closer to parity with the Property Editor UX. Additional notes: - Members that follow the legacy "bOverride_" naming convention were already being excluded from the optional input pin set on MakeStruct nodes if another member property name also matched its suffix. These have historically been excluded from ALL optional pin sets that utilize any FOptionalPinManager subtype (regardless of node type), so there was no change here. - Existing MakeStruct nodes that may have already exposed inline toggle edit condition members as input pins will now orphan those pins on load if connected or if set to a non-default value (true). The "correct" way to set an override flag is by choosing to expose a member that's bound to the override condition as an input. - Existing BreakStruct nodes are unchanged currently. Meaning, inline edit conditions that don't follow the legacy "bOverride_" convention can still be optionally exposed as an output pin. This UX was preserved as existing Blueprint logic could conceivably rely on the value of an override flag. - Only one implicit assignment is now emitted for each override flag binding. Previously, we were emitting one assignment statement per bound property, so it could result in redundant assignments to the same flag if more than one property was bound to it. #jira UE-147873 #rb Ben.Zeigler, Sebastian.Nordgren #preflight 632c7353c7791417aa87f3bf [CL 22164359 by phillip kavan in ue5-main branch]
66 lines
2.3 KiB
C++
66 lines
2.3 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "Containers/Array.h"
|
|
#include "CoreMinimal.h"
|
|
#include "EdGraph/EdGraphNode.h"
|
|
#include "EdGraph/EdGraphNodeUtils.h"
|
|
#include "HAL/Platform.h"
|
|
#include "Internationalization/Text.h"
|
|
#include "K2Node.h"
|
|
#include "K2Node_StructOperation.h"
|
|
#include "KismetCompilerMisc.h"
|
|
#include "UObject/ObjectMacros.h"
|
|
#include "UObject/UObjectGlobals.h"
|
|
|
|
#include "K2Node_StructMemberSet.generated.h"
|
|
|
|
class FName;
|
|
class FProperty;
|
|
class FBoolProperty;
|
|
class UEdGraphPin;
|
|
class UObject;
|
|
|
|
// Imperative kismet node that sets one or more member variables of a struct
|
|
UCLASS(MinimalAPI)
|
|
class UK2Node_StructMemberSet : public UK2Node_StructOperation
|
|
{
|
|
GENERATED_UCLASS_BODY()
|
|
|
|
UPROPERTY(EditAnywhere, Category=PinOptions, EditFixedSize)
|
|
TArray<FOptionalPinFromProperty> ShowPinForProperties;
|
|
|
|
// UObject interface
|
|
virtual void PreEditChange(FProperty* PropertyAboutToChange) override;
|
|
virtual void PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent) override;
|
|
// End of UObject interface
|
|
|
|
// UEdGraphNode interface
|
|
virtual void AllocateDefaultPins() override;
|
|
virtual FText GetTooltipText() const override;
|
|
virtual FText GetNodeTitle(ENodeTitleType::Type TitleType) const override;
|
|
// End of UEdGraphNode interface
|
|
|
|
// UK2Node interface
|
|
virtual bool IsNodePure() const override { return false; }
|
|
virtual bool NodeCausesStructuralBlueprintChange() const override { return true; }
|
|
virtual ERedirectType DoPinsMatchForReconstruction(const UEdGraphPin* NewPin, int32 NewPinIndex, const UEdGraphPin* OldPin, int32 OldPinIndex) const override;
|
|
virtual class FNodeHandlingFunctor* CreateNodeHandler(class FKismetCompilerContext& CompilerContext) const override;
|
|
// End of UK2Node interface
|
|
|
|
// Helper for AllocateDefaultPins
|
|
BLUEPRINTGRAPH_API void AllocateExecPins();
|
|
|
|
// Returns the override condition that's bound to the given property, if one exists. An override is a edit condition flag that is not exposed as an optional input pin.
|
|
BLUEPRINTGRAPH_API FBoolProperty* GetOverrideConditionForProperty(const FProperty* InProperty) const;
|
|
|
|
private:
|
|
/** Constructing FText strings can be costly, so we cache the node's title/tooltip */
|
|
FNodeTextCache CachedTooltip;
|
|
FNodeTextCache CachedNodeTitle;
|
|
|
|
TArray<FName> OldShownPins;
|
|
};
|
|
|