mirror of
https://github.com/Ed94/Cog.git
synced 2026-08-02 12:48:14 +00:00
improve behavior tree window
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
#include "BehaviorTree/BehaviorTree.h"
|
#include "BehaviorTree/BehaviorTree.h"
|
||||||
#include "BehaviorTree/BTCompositeNode.h"
|
#include "BehaviorTree/BTCompositeNode.h"
|
||||||
#include "BehaviorTree/BTNode.h"
|
#include "BehaviorTree/BTNode.h"
|
||||||
|
#include "BehaviorTree/Tasks/BTTask_BlueprintBase.h"
|
||||||
#include "BehaviorTree/Tasks/BTTask_Wait.h"
|
#include "BehaviorTree/Tasks/BTTask_Wait.h"
|
||||||
#include "BrainComponent.h"
|
#include "BrainComponent.h"
|
||||||
#include "CogWindowWidgets.h"
|
#include "CogWindowWidgets.h"
|
||||||
@@ -98,7 +99,17 @@ void UCogAIWindow_BehaviorTree::RenderContent()
|
|||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void UCogAIWindow_BehaviorTree::RenderNode(UBehaviorTreeComponent* BehaviorTreeComponent, const UBTNode* Node, bool OpenAllChildren)
|
void UCogAIWindow_BehaviorTree::RenderNode(UBehaviorTreeComponent* BehaviorTreeComponent, const UBTNode* Node, bool OpenAllChildren)
|
||||||
{
|
{
|
||||||
const char* NodeName = TCHAR_TO_ANSI(*Node->GetNodeName());
|
FString NodeNameStr;
|
||||||
|
if (const UBTTask_BlueprintBase* Wait = Cast<UBTTask_BlueprintBase>(Node))
|
||||||
|
{
|
||||||
|
NodeNameStr = Node->GetNodeName();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NodeNameStr = Node->GetStaticDescription();
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* NodeName = TCHAR_TO_ANSI(*NodeNameStr);
|
||||||
const bool ShowNode = Filter.PassFilter(NodeName);
|
const bool ShowNode = Filter.PassFilter(NodeName);
|
||||||
|
|
||||||
const UBTCompositeNode* CompositeNode = Cast<UBTCompositeNode>(Node);
|
const UBTCompositeNode* CompositeNode = Cast<UBTCompositeNode>(Node);
|
||||||
@@ -162,13 +173,7 @@ void UCogAIWindow_BehaviorTree::RenderNode(UBehaviorTreeComponent* BehaviorTreeC
|
|||||||
{
|
{
|
||||||
ImGui::BeginTooltip();
|
ImGui::BeginTooltip();
|
||||||
ImGui::BeginDisabled();
|
ImGui::BeginDisabled();
|
||||||
ImGui::Text(TCHAR_TO_ANSI(*Node->GetStaticDescription()));
|
ImGui::Text(NodeName);
|
||||||
|
|
||||||
if (const UBTTask_Wait* Wait = Cast<UBTTask_Wait>(Node))
|
|
||||||
{
|
|
||||||
ImGui::Text("Wait: %0.2fs", Wait->WaitTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui::EndDisabled();
|
ImGui::EndDisabled();
|
||||||
ImGui::EndTooltip();
|
ImGui::EndTooltip();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ namespace CogSampleLog
|
|||||||
FCogDebugLog::AddLogCategory(LogCogPossession, "Possession", "Log about the possession of player controller over a Character");
|
FCogDebugLog::AddLogCategory(LogCogPossession, "Possession", "Log about the possession of player controller over a Character");
|
||||||
FCogDebugLog::AddLogCategory(LogCogRotation, "Rotation", "Debug Draw a Character Rotation");
|
FCogDebugLog::AddLogCategory(LogCogRotation, "Rotation", "Debug Draw a Character Rotation");
|
||||||
FCogDebugLog::AddLogCategory(LogCogSkeleton, "Skeleton", "Debug Draw a Character Skeleton");
|
FCogDebugLog::AddLogCategory(LogCogSkeleton, "Skeleton", "Debug Draw a Character Skeleton");
|
||||||
FCogDebugLog::AddLogCategory(LogCogTargetAcquisition, "Target Acquisition", "Debug Draw a Character Collision");
|
FCogDebugLog::AddLogCategory(LogCogTargetAcquisition, "Target Acquisition", "Debug Draw the target acquisition debug draw");
|
||||||
FCogDebugLog::AddLogCategory(LogGameplayEffects, "Gameplay Effects", "Unreal Gameplay Effect Log");
|
FCogDebugLog::AddLogCategory(LogGameplayEffects, "Gameplay Effects", "Unreal Gameplay Effect Log");
|
||||||
#endif //ENABLE_COG
|
#endif //ENABLE_COG
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user