Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxwell21 committed Apr 14, 2018
2 parents 9c540c3 + ce12447 commit e102960
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void UStateMachine::CheckTransitionForCurrentState()
if (!CurrentState.IsValid() || CurrentState.TransitionNames.Num() == 0)
return;

for (auto TransitionName : this->CurrentState.TransitionNames)
for (const auto& TransitionName : this->CurrentState.TransitionNames)
{
bool Result = false;
this->ExecuteInnerFunction(*TransitionName, &Result);
Expand Down
4 changes: 2 additions & 2 deletions Source/UT_Framework/Public/Object/StateMachine/StateMachine.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class UStateMachineBlueprintGeneratedClass;
class UWorld;

USTRUCT(BlueprintType, Blueprintable)
struct FTransition
struct UT_FRAMEWORK_API FTransition
{
GENERATED_BODY()

Expand Down Expand Up @@ -53,7 +53,7 @@ struct FTransition
};

USTRUCT(BlueprintType, Blueprintable)
struct FState
struct UT_FRAMEWORK_API FState
{
GENERATED_BODY()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include "SStateMachineGraphNode_Transition.h"
#include "StateMachineTransition_Default.h"
#include "StateMachineUtilities.h"
#include "StateMachineBlueprint.h"
#include "StateMachine.h"
#include "Widgets/SBoxPanel.h"
#include "SImage.h"
#include "SSpacer.h"
Expand Down Expand Up @@ -265,4 +267,30 @@ FSlateColor SStateMachineGraphNode::GetBorderBackgroundColor() const
return InactiveStateColor;
}

void SStateMachineGraphNode::GetNodeInfoPopups(FNodeInfoContext* Context, TArray<FGraphInformationPopupInfo>& Popups) const
{
UStateMachineBlueprint* StateMachineBlueprint = Cast<UStateMachineBlueprint>(Cast<UStateMachineGraph>(GraphNode->GetGraph())->StateMachineBlueprint);
UStateMachineGraphNode* StateMachineGraphNode = Cast<UStateMachineGraphNode>(GraphNode);

if (StateMachineGraphNode->GetRootNode() || !StateMachineGraphNode->State)
return;

if (StateMachineBlueprint)
{
if (UStateMachine* StateMachine = Cast<UStateMachine>(StateMachineBlueprint->GetObjectBeingDebugged()))
{
if (StateMachine->CurrentState.IsValid())
{
FString StateName = StateMachine->CurrentState.Name;
if (StateName != StateMachineGraphNode->State->RuntimeData.Name)
return;

FLinearColor CurrentStateColor(1.f, 0.5f, 0.25f);
FString StateText = FString::Printf(TEXT("%s ACTIVE"), *StateName);
new (Popups) FGraphInformationPopupInfo(nullptr, CurrentStateColor, StateText);
}
}
}
}

#undef LOCTEXT_NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class UT_FRAMEWORKEDITOR_API SStateMachineGraphNode : public SGraphNode
virtual const FSlateBrush* GetShadowBrush(bool bSelected) const override;
void OnNameTextCommited(const FText& InText, ETextCommit::Type CommitInfo);
bool OnVerifyNameTextChanged(const FText& InText, FText& OutErrorMessage);
virtual void GetNodeInfoPopups(FNodeInfoContext* Context, TArray<FGraphInformationPopupInfo>& Popups) const override;
// End of SGraphNode interface

virtual FSlateColor GetNodeColor() const;
Expand All @@ -78,4 +79,5 @@ class UT_FRAMEWORKEDITOR_API SStateMachineGraphNode : public SGraphNode
FText GetPreviewCornerText() const;
const FSlateBrush* GetNameIcon() const;
FSlateColor GetBorderBackgroundColor() const;

};

0 comments on commit e102960

Please sign in to comment.