Added UComboAction class setting to the action node base class.

This commit is contained in:
Jamie Greunbaum 2023-10-02 00:57:44 -04:00
parent a8786b87fc
commit 3d06c5723e
2 changed files with 37 additions and 11 deletions

View File

@ -39,6 +39,11 @@ bool UComboActionGraphNode_ActionNodeBase::ValidateNodeRuntime_Implementation()
return false;
}
if (!this->ComboAction)
{
return false;
}
if (this->MaxChildrenNodes > -1 && this->ChildrenNodes.Num() > this->MaxChildrenNodes)
{
return false;
@ -89,6 +94,24 @@ bool UComboActionGraphNode_ActionNodeBase::ValidateNode(TArray<FText> &Validatio
ValidationsMessages.Add(FText::FromString(RichFormat ? RichTextReturn : TextReturn));
}
if (!this->ComboAction)
{
bResult = false;
const FString RichTextReturn =
FString("* ").
Append("<RichTextBlock.Bold>").
Append(NodeTitle.ToString()).
Append("</>").
Append(": Does not reference a valid combo action!");
const FString TextReturn =
FString(NodeTitle.ToString()).
Append(": Does not reference a valid combo action!");
ValidationsMessages.Add(FText::FromString(RichFormat ? RichTextReturn : TextReturn));
}
if (this->MaxChildrenNodes > -1 && this->ChildrenNodes.Num() > this->MaxChildrenNodes)
{
const FString RichTextReturn = FString("* ")

View File

@ -28,18 +28,15 @@ public:
virtual void ProcessNode(const TScriptInterface<class IComboActionGraphManagerInterface> &Manager) override;
virtual void PreProcessNode(const TScriptInterface<class IComboActionGraphManagerInterface> &Manager) override;
/**
* Returns the Dialogue Data Row name.
* Might be invalid
*
* @return The Dialogue Data Row name.
*/
UFUNCTION(BlueprintCallable, BlueprintPure, Category="Combo Input|Action")
class UComboInputAsset *GetComboInput() const { return this->ComboInput; }
UFUNCTION(BlueprintCallable, BlueprintPure, Category="Combo Input|Action")
enum EComboActionTriggerEvent GetTriggerEvent() const { return this->TriggerEvent; }
UFUNCTION(BlueprintCallable, BlueprintPure, Category="Combo Input|Action")
class UComboAction *GetComboAction() const { return this->ComboAction; }
virtual bool ValidateNodeRuntime_Implementation() const override;
public:
@ -47,7 +44,7 @@ public:
#if WITH_EDITORONLY_DATA
/**
* Shows read-only Texts with localization of selected Dialogue Row.
* Shows read-only Texts with localization of selected row.
*/
UPROPERTY(Transient, VisibleAnywhere, Category="Base", meta=(MultiLine=true, ShowOnlyInnerProperties))
TArray<FText> Preview;
@ -57,14 +54,20 @@ public:
#endif
protected:
/** Name of row in the table that we want */
// Combo input to respond to in order to reach this action.
UPROPERTY(BlueprintReadOnly, EditAnywhere, Category="Combo Input|Action")
TObjectPtr<class UComboInputAsset> ComboInput;
/** Name of row in the table that we want */
UPROPERTY(BlueprintReadOnly, EditAnywhere, Category="Combo Input|Action"/*, meta=(EditCondition="ComboInput != nullptr")*/)
// Trigger event to respond to in order to reach this action.
UPROPERTY(BlueprintReadOnly, EditAnywhere, Category="Combo Input|Action")
EComboActionTriggerEvent TriggerEvent = EComboActionTriggerEvent::Activated;
// Combo action to fire upon this node's activation.
UPROPERTY(BlueprintReadOnly, EditAnywhere, Category = "Combo Input|Action")
TObjectPtr<class UComboAction> ComboAction;
#if WITH_EDITOR
virtual bool ValidateNode(TArray<FText> &ValidationMessages, const bool RichFormat) override;