Skip to content

Commit

Permalink
Allow GetInputPins from BP (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
brwarner authored Oct 8, 2021
1 parent b417bb5 commit f0e4a8e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Source/ArticyRuntime/Private/ArticyFlowPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ IArticyFlowObject* UArticyFlowPlayer::GetUnshadowedNode(IArticyFlowObject* Node)

TArray<UArticyFlowPin*> pins;
auto inputPinsOwner = Cast<IArticyInputPinsProvider>(pinOwner);
pins.Append(*inputPinsOwner->GetInputPins());
pins.Append(*inputPinsOwner->GetInputPinsPtr());
auto outputPinsOwner = Cast<IArticyOutputPinsProvider>(pinOwner);
pins.Append(*outputPinsOwner->GetOutputPinsPtr());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ bool IArticyInputPinsProvider::TrySubmerge(class UArticyFlowPlayer* Player, TArr
{
bool bSubmerged = false;

auto inPins = GetInputPins();
auto inPins = GetInputPinsPtr();
if(ensure(inPins) && inPins->Num() > 0)
{
//if there is more than one pin or the single pin has more connections,
Expand All @@ -40,8 +40,17 @@ bool IArticyInputPinsProvider::TrySubmerge(class UArticyFlowPlayer* Player, TArr
return bSubmerged;
}

const TArray<UArticyInputPin*>* IArticyInputPinsProvider::GetInputPins() const
const TArray<UArticyInputPin*>* IArticyInputPinsProvider::GetInputPinsPtr() const
{
const static auto name = FName("InputPins");
return Cast<IArticyReflectable>(this)->GetPropPtr<TArray<UArticyInputPin*>>(name);
}

TArray<UArticyInputPin*> IArticyInputPinsProvider::GetInputPins_Implementation() const
{
auto Pins = GetInputPinsPtr();
if (Pins)
return *Pins;
else
return TArray<UArticyInputPin*>();
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ class ARTICYRUNTIME_API IArticyInputPinsProvider : public IArticyFlowObject
* it starts on a pin), exploration of pins will happen automatically as they are reached.
*/
bool TrySubmerge(class UArticyFlowPlayer* Player, TArray<FArticyBranch>& OutBranches, const uint32& Depth, const bool bForceShadowed);

const TArray<UArticyInputPin*>* GetInputPins() const;

const TArray<UArticyInputPin*>* GetInputPinsPtr() const;

UFUNCTION(BlueprintCallable, BlueprintNativeEvent, Category = "Articy")
TArray<UArticyInputPin*> GetInputPins() const;

TArray<UArticyInputPin*> GetInputPins_Implementation() const;
};

0 comments on commit f0e4a8e

Please sign in to comment.