Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flow Traits are now stored locally for every user #199

Open
wants to merge 6 commits into
base: 5.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 1 addition & 83 deletions Source/Flow/Private/Nodes/FlowPin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,86 +37,4 @@ FORCEINLINE FString FPinRecord::DoubleDigit(const int32 Number)
{
return Number > 9 ? FString::FromInt(Number) : TEXT("0") + FString::FromInt(Number);
}
#endif

//////////////////////////////////////////////////////////////////////////
// Pin Trait

void FFlowPinTrait::AllowTrait()
{
if (!bTraitAllowed)
{
bTraitAllowed = true;
bEnabled = true;
}
}

void FFlowPinTrait::DisallowTrait()
{
if (bTraitAllowed)
{
bTraitAllowed = false;
bEnabled = false;
}
}

bool FFlowPinTrait::IsAllowed() const
{
return bTraitAllowed;
}

void FFlowPinTrait::EnableTrait()
{
if (bTraitAllowed && !bEnabled)
{
bEnabled = true;
}
}

void FFlowPinTrait::DisableTrait()
{
if (bTraitAllowed && bEnabled)
{
bEnabled = false;
}
}

void FFlowPinTrait::ToggleTrait()
{
if (bTraitAllowed)
{
bTraitAllowed = false;
bEnabled = false;
}
else
{
bTraitAllowed = true;
bEnabled = true;
}
}

bool FFlowPinTrait::CanEnable() const
{
return bTraitAllowed && !bEnabled;
}

bool FFlowPinTrait::IsEnabled() const
{
return bTraitAllowed && bEnabled;
}

void FFlowPinTrait::MarkAsHit()
{
bHit = true;
}

void FFlowPinTrait::ResetHit()
{
bHit = false;
}

bool FFlowPinTrait::IsHit() const
{
return bHit;
}

#endif
45 changes: 0 additions & 45 deletions Source/Flow/Public/Nodes/FlowPin.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,48 +210,3 @@ struct FLOW_API FPinRecord
FORCEINLINE static FString DoubleDigit(const int32 Number);
};
#endif

// It can represent any trait added on the specific node instance, i.e. breakpoint
USTRUCT()
struct FLOW_API FFlowPinTrait
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved FFlowPinTrait to UFlowDebuggerSubsystem as it is used only in Editor module and represents only debug feature

{
GENERATED_USTRUCT_BODY()

protected:
UPROPERTY()
uint8 bTraitAllowed : 1;

UPROPERTY()
uint8 bEnabled : 1;
uint8 bHit : 1;

public:
FFlowPinTrait()
: bTraitAllowed(false)
, bEnabled(false)
, bHit(false)
{
};

explicit FFlowPinTrait(const bool bInitialState)
: bTraitAllowed(bInitialState)
, bEnabled(bInitialState)
, bHit(false)
{
};

void AllowTrait();
void DisallowTrait();
bool IsAllowed() const;

void EnableTrait();
void DisableTrait();
void ToggleTrait();

bool CanEnable() const;
bool IsEnabled() const;

void MarkAsHit();
void ResetHit();
bool IsHit() const;
};
Loading