Added the ability to disable combo action nodes. Enabling them will come later.

This commit is contained in:
Jamie Greunbaum 2023-10-03 01:47:24 -04:00
parent dcaac98f50
commit 7505a70575
3 changed files with 22 additions and 9 deletions

View File

@ -149,9 +149,13 @@ const UComboActionGraphNode *UComboManagerComponent::FindActiveNodeData(const UC
if (const UComboActionGraphNode_ActionNode *ActionNode = Cast<UComboActionGraphNode_ActionNode>(GraphNode))
{
if (ActionNode->GetComboInput() == Input && ActionNode->GetTriggerEvent() == EComboActionTriggerEvent::Activated)
{
// If we found the right node, only acknowledge it if it's enabled. Otherwise just skip it.
if (ActionNode->bEnabled)
{
ComboAction = ActionNode->GetComboAction();
NextNode = ActionNode;
}
break;
}
}

View File

@ -19,6 +19,7 @@ UComboActionGraphNode::UComboActionGraphNode()
this->CompatibleGraphType = UComboActionGraph::StaticClass();
this->BackgroundColor = FLinearColor::Black;
this->bEnabled = true;
this->bAllowInputNodes = true;
this->bAllowOutputNodes = true;

View File

@ -81,21 +81,29 @@ protected:
#pragma region Editable
public:
/**
* The array of allowed input classes for this Dialogue Node.
* Only nodes with classes from this array can be connected as inputs to this node.
* Can be used to restrict the types of inputs this node can accept.
* Whether the node is enabled by default. Disabled nodes will be ignored by the
* combo manager until they are enabled again programmatically. This allows actions
* to be unlockable during gameplay.
*/
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Combo Input|Action")
TArray<TSubclassOf<class UComboActionGraphNode>> AllowedInputClasses;
UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category="Combo Input|Action")
uint8 bEnabled : 1;
/**
* The maximum number of children nodes that this node can have.
* If this value is -1, then there is no limit on the number of children nodes.
* Can be used to enforce a maximum number of connections for certain types of nodes.
* If this value is -1, then there is no limit on the number of children nodes.
* Can be used to enforce a maximum number of connections for certain types of nodes.
*/
UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category="Combo Input|Action")
int32 MaxChildrenNodes = -1;
/**
* The array of allowed input classes for this Dialogue Node.
* Only nodes with classes from this array can be connected as inputs to this node.
* Can be used to restrict the types of inputs this node can accept.
*/
UPROPERTY(BlueprintReadOnly, Category="Combo Input|Action")
TArray<TSubclassOf<class UComboActionGraphNode>> AllowedInputClasses;
#pragma endregion
#pragma endregion