9#include "Kismet/GameplayStatics.h"
16 bool bHasAnyWeak =
false;
17 bool bHasSuccessfulWeak =
false;
26 bHasSuccessfulWeak = bHasSuccessfulWeak || bSatisfied;
35 return bHasSuccessfulWeak || !bHasAnyWeak;
40 bool bHasParticipant =
true;
52 TEXT(
"Custom Condition is empty (not valid). IsConditionMet returning false.\nContext:\n\t%s, Participant = %s"),
131 ValueToCheckAgainst = IDlgDialogueParticipant::Execute_GetFloatValue(OtherParticipant,
OtherVariableName);
135 ValueToCheckAgainst = FNYReflectionHelper::GetVariable<FNYFloatProperty, float>(OtherParticipant,
OtherVariableName);
142 return FMath::IsNearlyEqual(Value, ValueToCheckAgainst);
145 return Value > ValueToCheckAgainst;
148 return Value >= ValueToCheckAgainst;
151 return Value < ValueToCheckAgainst;
154 return Value <= ValueToCheckAgainst;
157 return !FMath::IsNearlyEqual(Value, ValueToCheckAgainst);
161 TEXT(
"Invalid Operation in float based condition.\nContext:\n\t%s"),
170 int32 ValueToCheckAgainst =
IntValue;
181 ValueToCheckAgainst = IDlgDialogueParticipant::Execute_GetIntValue(OtherParticipant,
OtherVariableName);
185 ValueToCheckAgainst = FNYReflectionHelper::GetVariable<FNYIntProperty, int32>(OtherParticipant,
OtherVariableName);
192 return Value == ValueToCheckAgainst;
195 return Value > ValueToCheckAgainst;
198 return Value >= ValueToCheckAgainst;
201 return Value < ValueToCheckAgainst;
204 return Value <= ValueToCheckAgainst;
207 return Value != ValueToCheckAgainst;
211 TEXT(
"Invalid Operation in int based condition.\nContext:\n\t%s"),
220 bool bResult = bValue;
229 bool bValueToCheckAgainst;
232 bValueToCheckAgainst = IDlgDialogueParticipant::Execute_GetBoolValue(OtherParticipant,
OtherVariableName);
236 bValueToCheckAgainst = FNYReflectionHelper::GetVariable<FNYBoolProperty, bool>(OtherParticipant,
OtherVariableName);
240 bResult = bValue == bValueToCheckAgainst;
259 ValueToCheckAgainst = IDlgDialogueParticipant::Execute_GetNameValue(OtherParticipant,
OtherVariableName);
263 ValueToCheckAgainst = FNYReflectionHelper::GetVariable<FNYNameProperty, FName>(OtherParticipant,
OtherVariableName);
267 const bool bResult = ValueToCheckAgainst == Value;
279 TEXT(
"%s FAILED because the PARTICIPANT is INVALID.\nContext:\n\t%s, ConditionType = %s"),
300 if (FDlgHelper::ConvertEnumToString<EDlgConditionType>(TEXT(
"EDlgConditionType"), Type,
false, EnumValue))
EDlgConditionType
UENUM(BlueprintType)
static FDlgLogger & Get()
void Errorf(const FmtType &Fmt, Types... Args)
bool IsConditionMet(const UDlgContext *Context, const UObject *Participant)
UFUNCTION(BlueprintCallable, BlueprintNativeEvent, Category = "Dialogue")
const FDlgHistory & GetHistoryOfThisContext() const
FGuid GetDialogueGUID() const
UFUNCTION(BlueprintPure, Category = "Dialogue|Data")
const UObject * GetParticipant(FName ParticipantName) const
FString GetContextString() const
UFUNCTION(BlueprintPure, Category = "Dialogue|Context")
const UDlgNode * GetNodeFromIndex(int32 NodeIndex) const
const UDlgNode * GetNodeFromGUID(const FGuid &NodeGUID) const
UCLASS(BlueprintType, Abstract, EditInlineNew, ClassGroup = "Dialogue")
bool HasAnySatisfiedChild(const UDlgContext &Context, TSet< const UDlgNode * > AlreadyVisitedNodes) const
float FloatValue
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dialogue|Condition")
UDlgConditionCustom * CustomCondition
UPROPERTY(Instanced, EditAnywhere, BlueprintReadWrite, Category = "Dialogue|Condition")
FName OtherParticipantName
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dialogue|Condition")
bool IsConditionMet(const UDlgContext &Context, const UObject *Participant) const
FGuid GUID
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Dialogue|Condition")
bool CheckFloat(const UDlgContext &Context, float Value) const
static FString ConditionTypeToString(EDlgConditionType Type)
int32 IntValue
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dialogue|Condition")
FName OtherVariableName
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dialogue|Condition")
bool IsParticipantInvolved() const
bool ValidateIsParticipantValid(const UDlgContext &Context, const FString &ContextString, const UObject *Participant) const
bool IsSecondParticipantInvolved() const
bool CheckBool(const UDlgContext &Context, bool bValue) const
bool CheckName(const UDlgContext &Context, FName Value) const
static bool EvaluateArray(const UDlgContext &Context, const TArray< FDlgCondition > &ConditionsArray, FName DefaultParticipantName=NAME_None)
bool bLongTermMemory
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dialogue|Condition")
bool CheckInt(const UDlgContext &Context, int32 Value) const
EDlgCompare CompareType
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dialogue|Condition")
EDlgOperation Operation
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dialogue|Condition")
FName NameValue
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dialogue|Condition")
bool bBoolValue
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dialogue|Condition")
EDlgConditionType ConditionType
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dialogue|Condition")
FName ParticipantName
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dialogue|Condition")
FName CallbackName
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dialogue|Condition")
bool Contains(int32 NodeIndex, const FGuid &NodeGUID) const
bool IsNodeVisited(const FGuid &DialogueGUID, int32 NodeIndex, const FGuid &NodeGUID) const
static FDlgMemory & Get()