FSMPropertyInteractionManager¶
Module: SMSystemEditor
#include <SMPropertyInteractionManager.h>
Description¶
Manager class for interacting with graph properties. Selecting, hovering, and toggling connector displays can be done through here.
Note:
This is currently instanced per USMGraphNode_StateNodeBase, and we attempt to scope interactions to a single SGraphPanel. Selections and hover should only show up for one active panel, with IO connections potentially displayed across graph panels to assist with drag and drop. Ideally, we would have the manager at the SGraphPanel level, but extending the Blueprint Editor's graph panel is not practical when this works almost as well.
Public Classes¶
| Name | |
|---|---|
| struct | FBulkInteractionArgs |
| struct | FConnectedPropertyInteractionArgs |
| struct | FInteractionArgs |
Public Functions¶
| Name | |
|---|---|
| FSMPropertyInteractionManager(USMGraphNode_StateNodeBase * InStateNodeOwner) | |
| ~FSMPropertyInteractionManager() | |
| bool | SetPropertyInteraction(USMGraphK2Node_PropertyNode_Base * InProperty, const ESMPropertyInteractionType InInteractionType, const FInteractionArgs & InInteractionArgs =FInteractionArgs()) |
| void | SetAllPropertyInteractions(const ESMPropertyInteractionType InInteractionType, const FBulkInteractionArgs & InInteractionArgs =FBulkInteractionArgs()) |
| void | TogglePropertySelection(USMGraphK2Node_PropertyNode_Base * InProperty, const TOptional< TWeakPtr< SGraphPanel > > & InGraphPanel =TOptional< TWeakPtr< SGraphPanel > >()) |
| void | DeselectAllProperties() |
| bool | IsPropertySelected(const USMGraphK2Node_PropertyNode_Base * InProperty, bool bRequireDirectSelection =false) const |
| bool | IsPropertyHovered(const USMGraphK2Node_PropertyNode_Base * InProperty) const |
| bool | IsPropertyInteractedWith(const USMGraphK2Node_PropertyNode_Base * InProperty, TSharedPtr< FSMPropertyInteractionData > * OutInteractionData =nullptr, const TOptional< TWeakPtr< SGraphPanel > > & InGraphPanel =TOptional< TWeakPtr< SGraphPanel > >()) const |
| bool | IsPropertyDirectlyInteractedWith(const USMGraphK2Node_PropertyNode_Base * InProperty, bool bRequireDirectSelection, const TOptional< TWeakPtr< SGraphPanel > > & InGraphPanel =TOptional< TWeakPtr< SGraphPanel > >()) const |
| USMGraphK2Node_PropertyNode_Base * | GetSelectedProperty(bool bRequireDirectSelection =false) const |
| TSharedPtr< FSMPropertyInteractionData > | GetPropertyInteractionData(const USMGraphK2Node_PropertyNode_Base * InProperty) const |
| void | RemoveTemporaryOwnerState(const TWeakObjectPtr< USMGraphNode_StateNodeBase > & OwnerState) |
| void | ReapplyConnectedSelections() |
| const TWeakPtr< SGraphPanel > & | GetScopedGraphPanel() const |
| DECLARE_MULTICAST_DELEGATE_TwoParams(FOnExpansionStateChanged , USMGraphK2Node_PropertyNode_Base * , bool ) | |
| FOnExpansionStateChanged & | GetOnExpansionStateChanged() |
| void | SetAllPropertyInteractionsForGraph(USMGraph * InGraph, const ESMPropertyInteractionType InInteractionType, const FBulkInteractionArgs & InInteractionArgs =FBulkInteractionArgs()) |
| FInteractionArgs | BuildInteractionArgsForExternalSelections(ESMPropertyInteractionType InInteraction, const TOptional< TWeakPtr< SGraphPanel > > & InGraphPanel =TOptional< TWeakPtr< SGraphPanel > >()) |
| ESMPropertyInteractionType | GetInteractionTypeFlagsForExternalSelection(ESMPropertyInteractionType InInteraction) |
| bool | IsGraphPanelSupported(const TWeakPtr< const SGraphPanel > & InGraphPanel) |
Public Attributes¶
| Name | |
|---|---|
| FLinearColor | PropertySelectedColor |
| FLinearColor | PropertyHoveredColor |
| FLinearColor | PropertySelectedAndHoveredColor |
Public Functions Documentation¶
function FSMPropertyInteractionManager¶
function ~FSMPropertyInteractionManager¶
function SetPropertyInteraction¶
bool SetPropertyInteraction(
USMGraphK2Node_PropertyNode_Base * InProperty,
const ESMPropertyInteractionType InInteractionType,
const FInteractionArgs & InInteractionArgs =FInteractionArgs()
)
Notify a property is being interacted with.
Return: True if the property changed, false if there was no change.
function SetAllPropertyInteractions¶
void SetAllPropertyInteractions(
const ESMPropertyInteractionType InInteractionType,
const FBulkInteractionArgs & InInteractionArgs =FBulkInteractionArgs()
)
Set the interaction for all properties.
function TogglePropertySelection¶
void TogglePropertySelection(
USMGraphK2Node_PropertyNode_Base * InProperty,
const TOptional< TWeakPtr< SGraphPanel > > & InGraphPanel =TOptional< TWeakPtr< SGraphPanel > >()
)
Toggle the property selection state of a property.
function DeselectAllProperties¶
Make sure all selected properties are no longer selected.
function IsPropertySelected¶
bool IsPropertySelected(
const USMGraphK2Node_PropertyNode_Base * InProperty,
bool bRequireDirectSelection =false
) const
Checks if a property is selected.
Parameters:
InProperty- The property to check.
bRequireDirectSelection- If the property needs to have been directly selected, rather than indirectly such as from another state.
function IsPropertyHovered¶
Checks if a property is hovered.
function IsPropertyInteractedWith¶
bool IsPropertyInteractedWith(
const USMGraphK2Node_PropertyNode_Base * InProperty,
TSharedPtr< FSMPropertyInteractionData > * OutInteractionData =nullptr,
const TOptional< TWeakPtr< SGraphPanel > > & InGraphPanel =TOptional< TWeakPtr< SGraphPanel > >()
) const
Checks for any level of interaction with a property.
Parameters:
InProperty- The property to check for interaction.
OutInteractionData- [Optional] The interaction data of the property.
InGraphPanel- [Optional] If this check should be scoped to a specific graph panel.
Return: True if the property is interacted with.
function IsPropertyDirectlyInteractedWith¶
bool IsPropertyDirectlyInteractedWith(
const USMGraphK2Node_PropertyNode_Base * InProperty,
bool bRequireDirectSelection,
const TOptional< TWeakPtr< SGraphPanel > > & InGraphPanel =TOptional< TWeakPtr< SGraphPanel > >()
) const
If a property has direct interaction, such as hover or selection.
function GetSelectedProperty¶
Get the first selected property.
function GetPropertyInteractionData¶
TSharedPtr< FSMPropertyInteractionData > GetPropertyInteractionData(
const USMGraphK2Node_PropertyNode_Base * InProperty
) const
Get the interaction state of a property.
function RemoveTemporaryOwnerState¶
Removes a temporary owner state.
function ReapplyConnectedSelections¶
Look for updated connections and reapply any selections.
function GetScopedGraphPanel¶
Retrieve the currently scoped graph panel.
function DECLARE_MULTICAST_DELEGATE_TwoParams¶
DECLARE_MULTICAST_DELEGATE_TwoParams(
FOnExpansionStateChanged ,
USMGraphK2Node_PropertyNode_Base * ,
bool
)
function GetOnExpansionStateChanged¶
function SetAllPropertyInteractionsForGraph¶
static void SetAllPropertyInteractionsForGraph(
USMGraph * InGraph,
const ESMPropertyInteractionType InInteractionType,
const FBulkInteractionArgs & InInteractionArgs =FBulkInteractionArgs()
)
Run interactions for all states in a graph.
function BuildInteractionArgsForExternalSelections¶
static FInteractionArgs BuildInteractionArgsForExternalSelections(
ESMPropertyInteractionType InInteraction,
const TOptional< TWeakPtr< SGraphPanel > > & InGraphPanel =TOptional< TWeakPtr< SGraphPanel > >()
)
Build interaction args which can propagate to connected nodes depending on the interaction type.
function GetInteractionTypeFlagsForExternalSelection¶
static ESMPropertyInteractionType GetInteractionTypeFlagsForExternalSelection(
ESMPropertyInteractionType InInteraction
)
Get the correct flags to use given an external selection. IE, SetSelect will produce multiple selection type flags, and UnsetSelect will produce multiple unselect type flags.
function IsGraphPanelSupported¶
Checks if a graph panel is supported for interaction.
Public Attributes Documentation¶
variable PropertySelectedColor¶
Color when property selected.
variable PropertyHoveredColor¶
Color when property hovered.
variable PropertySelectedAndHoveredColor¶
Color when both selected and highlighted.
Private Attributes Documentation¶
variable InteractedPropertyData¶
TMap< TWeakObjectPtr< USMGraphK2Node_PropertyNode_Base >, TSharedPtr< FSMPropertyInteractionData > > InteractedPropertyData;
Property nodes to their current interaction level.
variable OwningStateNode¶
The state node which owns this manager.
variable OwningBlueprint¶
Weak object ptr to the owning blueprint.
variable TemporaryOwningStateNodes¶
Other states which temporarily are our "owner". This occurs if another state is making an interaction request (selection) on this manager.
variable TemporaryControlledStateNodes¶
Other state nodes which we temporarily control. This is primarily for if we are selecting properties on another manager.
variable NodeSelectionChangedHandle¶
When the owning state machine blueprint editor changes its selection.
variable BlueprintEditorOpenedHandle¶
Handles for when a BP editor is opened or closed.
variable BlueprintEditorClosedHandle¶
variable OnExpansionStateChangedEvent¶
Called when the interaction manager changes the expansion state.
variable ScopedGraphPanel¶
Scope highlight and selection requests to this graph panel.