mirror of
https://github.com/Ed94/Cog.git
synced 2026-08-06 07:38:46 +00:00
Add a CogAll module to ease the integration for projects that want all windows
This commit is contained in:
@@ -188,6 +188,19 @@ void RenderSnap(bool* SnapEnable, float* Snap)
|
|||||||
ImGui::PopItemWidth();
|
ImGui::PopItemWidth();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
bool FCogDebug_Gizmo::Draw(const char* Id, const APlayerController& InPlayerController, USceneComponent& SceneComponent, ECogDebug_GizmoFlags Flags)
|
||||||
|
{
|
||||||
|
FTransform Transform = SceneComponent.GetComponentTransform();
|
||||||
|
if (Draw(Id, InPlayerController, Transform, Flags))
|
||||||
|
{
|
||||||
|
SceneComponent.SetWorldTransform(Transform);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
bool FCogDebug_Gizmo::Draw(const char* Id, const APlayerController& InPlayerController, FTransform& InOutTransform, ECogDebug_GizmoFlags Flags)
|
bool FCogDebug_Gizmo::Draw(const char* Id, const APlayerController& InPlayerController, FTransform& InOutTransform, ECogDebug_GizmoFlags Flags)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ struct FCogDebugSettings
|
|||||||
float GizmoCursorSelectionThreshold = 10.0f;
|
float GizmoCursorSelectionThreshold = 10.0f;
|
||||||
|
|
||||||
UPROPERTY(Config)
|
UPROPERTY(Config)
|
||||||
float GizmoTranslationAxisLength = 50.0f;
|
float GizmoTranslationAxisLength = 80.0f;
|
||||||
|
|
||||||
UPROPERTY(Config)
|
UPROPERTY(Config)
|
||||||
bool GizmoTranslationSnapEnable = false;
|
bool GizmoTranslationSnapEnable = false;
|
||||||
@@ -126,10 +126,10 @@ struct FCogDebugSettings
|
|||||||
float GizmoScaleSnapValue = 1.0f;
|
float GizmoScaleSnapValue = 1.0f;
|
||||||
|
|
||||||
UPROPERTY(Config)
|
UPROPERTY(Config)
|
||||||
float GizmoScaleBoxOffset = 50.0f;
|
float GizmoScaleBoxOffset = 85.0f;
|
||||||
|
|
||||||
UPROPERTY(Config)
|
UPROPERTY(Config)
|
||||||
float GizmoScaleBoxExtent = 2.0f;
|
float GizmoScaleBoxExtent = 5.0f;
|
||||||
|
|
||||||
UPROPERTY(Config)
|
UPROPERTY(Config)
|
||||||
float GizmoScaleSpeed = 0.01f;
|
float GizmoScaleSpeed = 0.01f;
|
||||||
|
|||||||
@@ -77,9 +77,13 @@ struct FCogDebug_GizmoElement
|
|||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
struct COGDEBUG_API FCogDebug_Gizmo
|
struct COGDEBUG_API FCogDebug_Gizmo
|
||||||
{
|
{
|
||||||
|
bool Draw(const char* Id, const APlayerController& InPlayerController, USceneComponent& SceneComponent, ECogDebug_GizmoFlags Flags = ECogDebug_GizmoFlags::None);
|
||||||
|
|
||||||
bool Draw(const char* Id, const APlayerController& InPlayerController, FTransform& InOutTransform, ECogDebug_GizmoFlags Flags = ECogDebug_GizmoFlags::None);
|
bool Draw(const char* Id, const APlayerController& InPlayerController, FTransform& InOutTransform, ECogDebug_GizmoFlags Flags = ECogDebug_GizmoFlags::None);
|
||||||
|
|
||||||
ECogDebug_GizmoElementType DraggedElementType = ECogDebug_GizmoElementType::MAX;
|
ECogDebug_GizmoElementType DraggedElementType = ECogDebug_GizmoElementType::MAX;
|
||||||
|
|
||||||
FVector2D CursorOffset = FVector2D::ZeroVector;
|
FVector2D CursorOffset = FVector2D::ZeroVector;
|
||||||
|
|
||||||
FTransform InitialTransform = FTransform::Identity;
|
FTransform InitialTransform = FTransform::Identity;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -106,11 +106,8 @@ void FCogEngineWindow_CollisionTester::RenderContent()
|
|||||||
|
|
||||||
if (const APlayerController* LocalPlayerController = GetLocalPlayerController())
|
if (const APlayerController* LocalPlayerController = GetLocalPlayerController())
|
||||||
{
|
{
|
||||||
FTransform Transform = CollisionTester->EndComponent->GetComponentTransform();
|
StartGizmo.Draw("CollisionTesterStartGizmo", *LocalPlayerController, *CollisionTester->StartComponent);
|
||||||
if (EndGizmo.Draw("CollisionTesterEndGizmo", *LocalPlayerController, Transform, ECogDebug_GizmoFlags::NoRotation | ECogDebug_GizmoFlags::NoScale))
|
EndGizmo.Draw("CollisionTesterEndGizmo", *LocalPlayerController, *CollisionTester->EndComponent, ECogDebug_GizmoFlags::NoRotation | ECogDebug_GizmoFlags::NoScale);
|
||||||
{
|
|
||||||
CollisionTester->EndComponent->SetWorldTransform(Transform);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FCogWindowWidgets::SetNextItemToShortWidth();
|
FCogWindowWidgets::SetNextItemToShortWidth();
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ protected:
|
|||||||
|
|
||||||
TObjectPtr<UCogEngineConfig_CollisionTester> Config = nullptr;
|
TObjectPtr<UCogEngineConfig_CollisionTester> Config = nullptr;
|
||||||
|
|
||||||
|
FCogDebug_Gizmo StartGizmo;
|
||||||
FCogDebug_Gizmo EndGizmo;
|
FCogDebug_Gizmo EndGizmo;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
"FileVersion": 3,
|
||||||
|
"Version": 1,
|
||||||
|
"VersionName": "1.0",
|
||||||
|
"FriendlyName": "CogAll",
|
||||||
|
"Description": "",
|
||||||
|
"Category": "Other",
|
||||||
|
"CreatedBy": "Arnaud Jamin",
|
||||||
|
"CreatedByURL": "",
|
||||||
|
"DocsURL": "",
|
||||||
|
"MarketplaceURL": "",
|
||||||
|
"SupportURL": "",
|
||||||
|
"CanContainContent": true,
|
||||||
|
"IsBetaVersion": false,
|
||||||
|
"IsExperimentalVersion": false,
|
||||||
|
"Installed": false,
|
||||||
|
"Modules": [
|
||||||
|
{
|
||||||
|
"Name": "CogAll",
|
||||||
|
"Type": "Runtime",
|
||||||
|
"LoadingPhase": "Default"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Plugins": [
|
||||||
|
{
|
||||||
|
"Name": "Cog",
|
||||||
|
"Enabled": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "CogAbility",
|
||||||
|
"Enabled": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "CogInput",
|
||||||
|
"Enabled": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "CogAI",
|
||||||
|
"Enabled": true
|
||||||
|
}
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
using UnrealBuildTool;
|
||||||
|
|
||||||
|
public class CogAll : ModuleRules
|
||||||
|
{
|
||||||
|
public CogAll(ReadOnlyTargetRules Target) : base(Target)
|
||||||
|
{
|
||||||
|
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
|
||||||
|
|
||||||
|
PublicDependencyModuleNames.AddRange(
|
||||||
|
new []
|
||||||
|
{
|
||||||
|
"Core",
|
||||||
|
"CoreUObject",
|
||||||
|
"CogCommon",
|
||||||
|
"CogAbility",
|
||||||
|
"CogAI",
|
||||||
|
"CogEngine",
|
||||||
|
"CogInput",
|
||||||
|
"CogWindow",
|
||||||
|
"Engine",
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,124 @@
|
|||||||
|
#include "CogAll.h"
|
||||||
|
|
||||||
|
#include "CogAbilityWindow_Abilities.h"
|
||||||
|
#include "CogAbilityWindow_Attributes.h"
|
||||||
|
#include "CogAbilityWindow_Cheats.h"
|
||||||
|
#include "CogAbilityWindow_Effects.h"
|
||||||
|
#include "CogAbilityWindow_Pools.h"
|
||||||
|
#include "CogAbilityWindow_Tags.h"
|
||||||
|
#include "CogAbilityWindow_Tweaks.h"
|
||||||
|
#include "CogAIWindow_BehaviorTree.h"
|
||||||
|
#include "CogAIWindow_Blackboard.h"
|
||||||
|
#include "CogEngineWindow_CollisionTester.h"
|
||||||
|
#include "CogEngineWindow_CollisionViewer.h"
|
||||||
|
#include "CogEngineWindow_CommandBindings.h"
|
||||||
|
#include "CogEngineWindow_DebugSettings.h"
|
||||||
|
#include "CogEngineWindow_ImGui.h"
|
||||||
|
#include "CogEngineWindow_Inspector.h"
|
||||||
|
#include "CogEngineWindow_LogCategories.h"
|
||||||
|
#include "CogEngineWindow_Metrics.h"
|
||||||
|
#include "CogEngineWindow_NetEmulation.h"
|
||||||
|
#include "CogEngineWindow_OutputLog.h"
|
||||||
|
#include "CogEngineWindow_Plots.h"
|
||||||
|
#include "CogEngineWindow_Scalability.h"
|
||||||
|
#include "CogEngineWindow_Selection.h"
|
||||||
|
#include "CogEngineWindow_Skeleton.h"
|
||||||
|
#include "CogEngineWindow_Slate.h"
|
||||||
|
#include "CogEngineWindow_Spawns.h"
|
||||||
|
#include "CogEngineWindow_Stats.h"
|
||||||
|
#include "CogEngineWindow_TimeScale.h"
|
||||||
|
#include "CogEngineWindow_Transform.h"
|
||||||
|
#include "CogInputWindow_Actions.h"
|
||||||
|
#include "CogInputWindow_Gamepad.h"
|
||||||
|
#include "CogWindowManager.h"
|
||||||
|
|
||||||
|
#include "GameFramework/Character.h"
|
||||||
|
#include "GameFramework/GameStateBase.h"
|
||||||
|
#include "GameFramework/GameUserSettings.h"
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
void Cog::AddAllWindows(UCogWindowManager& CogWindowManager)
|
||||||
|
{
|
||||||
|
//---------------------------------------
|
||||||
|
// Engine
|
||||||
|
//---------------------------------------
|
||||||
|
CogWindowManager.AddWindow<FCogEngineWindow_CollisionTester>("Engine.Collision Tester");
|
||||||
|
|
||||||
|
CogWindowManager.AddWindow<FCogEngineWindow_CollisionViewer>("Engine.Collision Viewer");
|
||||||
|
|
||||||
|
CogWindowManager.AddWindow<FCogEngineWindow_CommandBindings>("Engine.Command Bindings");
|
||||||
|
|
||||||
|
CogWindowManager.AddWindow<FCogEngineWindow_DebugSettings>("Engine.Debug Settings");
|
||||||
|
|
||||||
|
CogWindowManager.AddWindow<FCogEngineWindow_ImGui>("Engine.ImGui");
|
||||||
|
|
||||||
|
FCogEngineWindow_Inspector* Inspector = CogWindowManager.AddWindow<FCogEngineWindow_Inspector>("Engine.Inspector");
|
||||||
|
Inspector->AddFavorite(GEngine->GetGameUserSettings(), [](UObject* Object)
|
||||||
|
{
|
||||||
|
if (UGameUserSettings* UserSettings = Cast<UGameUserSettings>(Object))
|
||||||
|
{
|
||||||
|
UserSettings->ApplySettings(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
CogWindowManager.AddWindow<FCogEngineWindow_LogCategories>("Engine.Log Categories");
|
||||||
|
|
||||||
|
CogWindowManager.AddWindow<FCogEngineWindow_NetEmulation>("Engine.Net Emulation");
|
||||||
|
|
||||||
|
CogWindowManager.AddWindow<FCogEngineWindow_OutputLog>("Engine.Output Log");
|
||||||
|
|
||||||
|
CogWindowManager.AddWindow<FCogEngineWindow_Metrics>("Engine.Metrics");
|
||||||
|
|
||||||
|
CogWindowManager.AddWindow<FCogEngineWindow_Plots>("Engine.Plots");
|
||||||
|
|
||||||
|
FCogEngineWindow_Selection* SelectionWindow = CogWindowManager.AddWindow<FCogEngineWindow_Selection>("Engine.Selection");
|
||||||
|
SelectionWindow->SetActorClasses({ ACharacter::StaticClass(), AActor::StaticClass(), AGameModeBase::StaticClass(), AGameStateBase::StaticClass() });
|
||||||
|
SelectionWindow->SetTraceType(UEngineTypes::ConvertToTraceType(ECC_Pawn));
|
||||||
|
|
||||||
|
CogWindowManager.AddWindow<FCogEngineWindow_Scalability>("Engine.Scalability");
|
||||||
|
|
||||||
|
CogWindowManager.AddWindow<FCogEngineWindow_Skeleton>("Engine.Skeleton");
|
||||||
|
|
||||||
|
CogWindowManager.AddWindow<FCogEngineWindow_Slate>("Engine.Slate");
|
||||||
|
|
||||||
|
CogWindowManager.AddWindow<FCogEngineWindow_Spawns>("Engine.Spawns");
|
||||||
|
|
||||||
|
FCogEngineWindow_Stats* StatsWindow = CogWindowManager.AddWindow<FCogEngineWindow_Stats>("Engine.Stats");
|
||||||
|
|
||||||
|
CogWindowManager.AddWindow<FCogEngineWindow_TimeScale>("Engine.Time Scale");
|
||||||
|
|
||||||
|
CogWindowManager.AddWindow<FCogEngineWindow_Transform>("Engine.Transform");
|
||||||
|
|
||||||
|
//---------------------------------------
|
||||||
|
// Abilities
|
||||||
|
//---------------------------------------
|
||||||
|
CogWindowManager.AddWindow<FCogAbilityWindow_Abilities>("Gameplay.Abilities");
|
||||||
|
|
||||||
|
CogWindowManager.AddWindow<FCogAbilityWindow_Attributes>("Gameplay.Attributes");
|
||||||
|
|
||||||
|
CogWindowManager.AddWindow<FCogAbilityWindow_BlockedTags>("Gameplay.Blocking Tags");
|
||||||
|
|
||||||
|
CogWindowManager.AddWindow<FCogAbilityWindow_Cheats>("Gameplay.Cheats");
|
||||||
|
|
||||||
|
CogWindowManager.AddWindow<FCogAbilityWindow_Effects>("Gameplay.Effects");
|
||||||
|
|
||||||
|
CogWindowManager.AddWindow<FCogAbilityWindow_Pools>("Gameplay.Pools");
|
||||||
|
|
||||||
|
CogWindowManager.AddWindow<FCogAbilityWindow_OwnedTags>("Gameplay.Owned Tags");
|
||||||
|
|
||||||
|
CogWindowManager.AddWindow<FCogAbilityWindow_Tweaks>("Gameplay.Tweaks");
|
||||||
|
|
||||||
|
//---------------------------------------
|
||||||
|
// AI
|
||||||
|
//---------------------------------------
|
||||||
|
CogWindowManager.AddWindow<FCogAIWindow_BehaviorTree>("AI.Behavior Tree");
|
||||||
|
|
||||||
|
CogWindowManager.AddWindow<FCogAIWindow_Blackboard>("AI.Blackboard");
|
||||||
|
|
||||||
|
//---------------------------------------
|
||||||
|
// Input
|
||||||
|
//---------------------------------------
|
||||||
|
CogWindowManager.AddWindow<FCogInputWindow_Actions>("Input.Actions");
|
||||||
|
|
||||||
|
CogWindowManager.AddWindow<FCogInputWindow_Gamepad>("Input.Gamepad");
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
#include "CogAllModule.h"
|
||||||
|
|
||||||
|
#define LOCTEXT_NAMESPACE "FCogAllModule"
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FCogAllModule::StartupModule()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
void FCogAllModule::ShutdownModule()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#undef LOCTEXT_NAMESPACE
|
||||||
|
|
||||||
|
IMPLEMENT_MODULE(FCogAllModule, CogAll)
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "CoreMinimal.h"
|
||||||
|
|
||||||
|
class UCogWindowManager;
|
||||||
|
|
||||||
|
namespace Cog
|
||||||
|
{
|
||||||
|
void COGALL_API AddAllWindows(UCogWindowManager& CogWindowManager);
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "CoreMinimal.h"
|
||||||
|
#include "Modules/ModuleManager.h"
|
||||||
|
|
||||||
|
class COGALL_API FCogAllModule : public IModuleInterface
|
||||||
|
{
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
static inline FCogAllModule &Get() { return FModuleManager::LoadModuleChecked<FCogAllModule>("CogAll"); }
|
||||||
|
|
||||||
|
/** IModuleInterface implementation */
|
||||||
|
virtual void StartupModule() override;
|
||||||
|
virtual void ShutdownModule() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
};
|
||||||
@@ -26,13 +26,14 @@ public class CogSample : ModuleRules
|
|||||||
{
|
{
|
||||||
PublicDependencyModuleNames.AddRange(new string[]
|
PublicDependencyModuleNames.AddRange(new string[]
|
||||||
{
|
{
|
||||||
"CogDebug",
|
|
||||||
"CogImgui",
|
|
||||||
"CogWindow",
|
|
||||||
"CogEngine",
|
|
||||||
"CogAbility",
|
"CogAbility",
|
||||||
"CogAI",
|
"CogAI",
|
||||||
|
"CogAll",
|
||||||
|
"CogDebug",
|
||||||
|
"CogEngine",
|
||||||
|
"CogImgui",
|
||||||
"CogInput",
|
"CogInput",
|
||||||
|
"CogWindow",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -355,6 +355,8 @@ void ACogSampleCharacter::TryFinishInitialize()
|
|||||||
ACogAbilityReplicator::TryApplyAllTweaksOnActor(this);
|
ACogAbilityReplicator::TryApplyAllTweaksOnActor(this);
|
||||||
#endif //ENABLE_COG
|
#endif //ENABLE_COG
|
||||||
|
|
||||||
|
RefreshScale();
|
||||||
|
|
||||||
RegisterToAbilitySystemEvents();
|
RegisterToAbilitySystemEvents();
|
||||||
|
|
||||||
bIsInitialized = true;
|
bIsInitialized = true;
|
||||||
@@ -679,12 +681,13 @@ void ACogSampleCharacter::OnGhostTagNewOrRemoved(const FGameplayTag InTag, int32
|
|||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
void ACogSampleCharacter::OnScaleAttributeChanged(const FOnAttributeChangeData& Data)
|
void ACogSampleCharacter::OnScaleAttributeChanged(const FOnAttributeChangeData& Data)
|
||||||
{
|
{
|
||||||
//----------------------------------------------------------------------------------
|
RefreshScale();
|
||||||
// 'Data.NewValue' is not used because it seems to only corresponds to the changes
|
}
|
||||||
// of the BaseValue which do not account for the temporary modifiers.
|
|
||||||
//----------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
|
void ACogSampleCharacter::RefreshScale()
|
||||||
const float CurrentScaleValue = AbilitySystem->GetNumericAttribute(Data.Attribute);
|
{
|
||||||
|
const float CurrentScaleValue = AbilitySystem->GetNumericAttribute(UCogSampleAttributeSet_Misc::GetScaleAttribute());
|
||||||
Scale = CurrentScaleValue;
|
Scale = CurrentScaleValue;
|
||||||
|
|
||||||
MARK_PROPERTY_DIRTY_FROM_NAME(ACogSampleCharacter, Scale, this);
|
MARK_PROPERTY_DIRTY_FROM_NAME(ACogSampleCharacter, Scale, this);
|
||||||
|
|||||||
@@ -344,6 +344,8 @@ protected:
|
|||||||
|
|
||||||
void UpdateActiveAbilitySlots();
|
void UpdateActiveAbilitySlots();
|
||||||
|
|
||||||
|
void RefreshScale();
|
||||||
|
|
||||||
UFUNCTION()
|
UFUNCTION()
|
||||||
void OnRep_Scale();
|
void OnRep_Scale();
|
||||||
|
|
||||||
|
|||||||
@@ -1,48 +1,14 @@
|
|||||||
#include "CogSampleGameState.h"
|
#include "CogSampleGameState.h"
|
||||||
|
|
||||||
#include "CogSampleAbilitySystemComponent.h"
|
#include "CogSampleAbilitySystemComponent.h"
|
||||||
#include "GameFramework/Character.h"
|
|
||||||
#include "GameFramework/GameMode.h"
|
|
||||||
#include "GameFramework/GameState.h"
|
#include "GameFramework/GameState.h"
|
||||||
#include "Modules/ModuleManager.h"
|
#include "Modules/ModuleManager.h"
|
||||||
|
|
||||||
#if ENABLE_COG
|
#if ENABLE_COG
|
||||||
#include "CogAbilityWindow_Abilities.h"
|
#include "CogAll.h"
|
||||||
#include "CogAbilityWindow_Attributes.h"
|
|
||||||
#include "CogAbilityWindow_Cheats.h"
|
|
||||||
#include "CogAbilityWindow_Effects.h"
|
|
||||||
#include "CogAbilityWindow_Pools.h"
|
|
||||||
#include "CogAbilityWindow_Tags.h"
|
|
||||||
#include "CogAbilityWindow_Tweaks.h"
|
|
||||||
#include "CogAIWindow_BehaviorTree.h"
|
|
||||||
#include "CogAIWindow_Blackboard.h"
|
|
||||||
#include "CogDebugPlot.h"
|
#include "CogDebugPlot.h"
|
||||||
#include "CogEngineWindow_CollisionTester.h"
|
|
||||||
#include "CogEngineWindow_CollisionViewer.h"
|
|
||||||
#include "CogEngineWindow_CommandBindings.h"
|
|
||||||
#include "CogEngineWindow_DebugSettings.h"
|
|
||||||
#include "CogEngineWindow_ImGui.h"
|
|
||||||
#include "CogEngineWindow_Inspector.h"
|
|
||||||
#include "CogEngineWindow_LogCategories.h"
|
|
||||||
#include "CogEngineWindow_Metrics.h"
|
|
||||||
#include "CogEngineWindow_NetEmulation.h"
|
|
||||||
#include "CogEngineWindow_OutputLog.h"
|
|
||||||
#include "CogEngineWindow_Plots.h"
|
|
||||||
#include "CogEngineWindow_Scalability.h"
|
|
||||||
#include "CogEngineWindow_Selection.h"
|
|
||||||
#include "CogEngineWindow_Skeleton.h"
|
|
||||||
#include "CogEngineWindow_Slate.h"
|
|
||||||
#include "CogEngineWindow_Spawns.h"
|
|
||||||
#include "CogEngineWindow_Stats.h"
|
|
||||||
#include "CogEngineWindow_TimeScale.h"
|
|
||||||
#include "CogEngineWindow_Transform.h"
|
|
||||||
#include "CogInputWindow_Actions.h"
|
|
||||||
#include "CogInputWindow_Gamepad.h"
|
|
||||||
#include "CogSampleWindow_Team.h"
|
#include "CogSampleWindow_Team.h"
|
||||||
#include "CogWindowManager.h"
|
#include "CogWindowManager.h"
|
||||||
|
|
||||||
#include "GameFramework/GameUserSettings.h"
|
|
||||||
|
|
||||||
#endif //ENABLE_COG
|
#endif //ENABLE_COG
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
@@ -67,7 +33,10 @@ void ACogSampleGameState::BeginPlay()
|
|||||||
AbilitySystemComponent->InitAbilityActorInfo(this, this);
|
AbilitySystemComponent->InitAbilityActorInfo(this, this);
|
||||||
|
|
||||||
#if ENABLE_COG
|
#if ENABLE_COG
|
||||||
InitializeCog();
|
CogWindowManager = NewObject<UCogWindowManager>(this);
|
||||||
|
CogWindowManagerRef = CogWindowManager;
|
||||||
|
Cog::AddAllWindows(*CogWindowManager);
|
||||||
|
CogWindowManager->AddWindow<FCogSampleWindow_Team>("Gameplay.Team");
|
||||||
#endif //ENABLE_COG
|
#endif //ENABLE_COG
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,11 +66,6 @@ void ACogSampleGameState::Tick(float DeltaSeconds)
|
|||||||
FCogDebugPlot::PlotValue(this, "Frame Rate", GAverageFPS);
|
FCogDebugPlot::PlotValue(this, "Frame Rate", GAverageFPS);
|
||||||
FCogDebugPlot::PlotValue(this, "Frame Time", GAverageMS);
|
FCogDebugPlot::PlotValue(this, "Frame Time", GAverageMS);
|
||||||
|
|
||||||
//const float LocalWorldTime = GetWorld()->GetTimeSeconds();
|
|
||||||
//const float ServerWorldTime = GetServerWorldTimeSeconds();
|
|
||||||
//const float ServerWorldTimeDelta = LocalWorldTime - ServerWorldTime;
|
|
||||||
//FCogDebugPlot::PlotValue(this, "Server World Time Delta", ServerWorldTimeDelta);
|
|
||||||
|
|
||||||
if (CogWindowManager != nullptr)
|
if (CogWindowManager != nullptr)
|
||||||
{
|
{
|
||||||
CogWindowManager->Tick(DeltaSeconds);
|
CogWindowManager->Tick(DeltaSeconds);
|
||||||
@@ -109,99 +73,3 @@ void ACogSampleGameState::Tick(float DeltaSeconds)
|
|||||||
|
|
||||||
#endif //ENABLE_COG
|
#endif //ENABLE_COG
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_COG
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
|
||||||
void ACogSampleGameState::InitializeCog()
|
|
||||||
{
|
|
||||||
CogWindowManager = NewObject<UCogWindowManager>(this);
|
|
||||||
CogWindowManagerRef = CogWindowManager;
|
|
||||||
|
|
||||||
//---------------------------------------
|
|
||||||
// Engine
|
|
||||||
//---------------------------------------
|
|
||||||
CogWindowManager->AddWindow<FCogEngineWindow_CollisionTester>("Engine.Collision Tester");
|
|
||||||
|
|
||||||
CogWindowManager->AddWindow<FCogEngineWindow_CollisionViewer>("Engine.Collision Viewer");
|
|
||||||
|
|
||||||
CogWindowManager->AddWindow<FCogEngineWindow_CommandBindings>("Engine.Command Bindings");
|
|
||||||
|
|
||||||
CogWindowManager->AddWindow<FCogEngineWindow_DebugSettings>("Engine.Debug Settings");
|
|
||||||
|
|
||||||
CogWindowManager->AddWindow<FCogEngineWindow_ImGui>("Engine.ImGui");
|
|
||||||
|
|
||||||
FCogEngineWindow_Inspector* Inspector = CogWindowManager->AddWindow<FCogEngineWindow_Inspector>("Engine.Inspector");
|
|
||||||
Inspector->AddFavorite(GEngine->GetGameUserSettings(), [](UObject* Object)
|
|
||||||
{
|
|
||||||
if (UGameUserSettings* UserSettings = Cast<UGameUserSettings>(Object))
|
|
||||||
{
|
|
||||||
UserSettings->ApplySettings(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
CogWindowManager->AddWindow<FCogEngineWindow_LogCategories>("Engine.Log Categories");
|
|
||||||
|
|
||||||
CogWindowManager->AddWindow<FCogEngineWindow_NetEmulation>("Engine.Net Emulation");
|
|
||||||
|
|
||||||
CogWindowManager->AddWindow<FCogEngineWindow_OutputLog>("Engine.Output Log");
|
|
||||||
|
|
||||||
CogWindowManager->AddWindow<FCogEngineWindow_Metrics>("Engine.Metrics");
|
|
||||||
|
|
||||||
CogWindowManager->AddWindow<FCogEngineWindow_Plots>("Engine.Plots");
|
|
||||||
|
|
||||||
FCogEngineWindow_Selection* SelectionWindow = CogWindowManager->AddWindow<FCogEngineWindow_Selection>("Engine.Selection");
|
|
||||||
SelectionWindow->SetActorClasses({ ACharacter::StaticClass(), AActor::StaticClass(), AGameModeBase::StaticClass(), AGameStateBase::StaticClass() });
|
|
||||||
SelectionWindow->SetTraceType(UEngineTypes::ConvertToTraceType(ECollisionChannel::ECC_Pawn));
|
|
||||||
|
|
||||||
CogWindowManager->AddWindow<FCogEngineWindow_Scalability>("Engine.Scalability");
|
|
||||||
|
|
||||||
CogWindowManager->AddWindow<FCogEngineWindow_Skeleton>("Engine.Skeleton");
|
|
||||||
|
|
||||||
CogWindowManager->AddWindow<FCogEngineWindow_Slate>("Engine.Slate");
|
|
||||||
|
|
||||||
CogWindowManager->AddWindow<FCogEngineWindow_Spawns>("Engine.Spawns");
|
|
||||||
|
|
||||||
FCogEngineWindow_Stats* StatsWindow = CogWindowManager->AddWindow<FCogEngineWindow_Stats>("Engine.Stats");
|
|
||||||
|
|
||||||
CogWindowManager->AddWindow<FCogEngineWindow_TimeScale>("Engine.Time Scale");
|
|
||||||
|
|
||||||
CogWindowManager->AddWindow<FCogEngineWindow_Transform>("Engine.Transform");
|
|
||||||
|
|
||||||
//---------------------------------------
|
|
||||||
// Abilities
|
|
||||||
//---------------------------------------
|
|
||||||
CogWindowManager->AddWindow<FCogAbilityWindow_Abilities>("Gameplay.Abilities");
|
|
||||||
|
|
||||||
CogWindowManager->AddWindow<FCogAbilityWindow_Attributes>("Gameplay.Attributes");
|
|
||||||
|
|
||||||
CogWindowManager->AddWindow<FCogAbilityWindow_BlockedTags>("Gameplay.Blocking Tags");
|
|
||||||
|
|
||||||
CogWindowManager->AddWindow<FCogAbilityWindow_Cheats>("Gameplay.Cheats");
|
|
||||||
|
|
||||||
CogWindowManager->AddWindow<FCogAbilityWindow_Effects>("Gameplay.Effects");
|
|
||||||
|
|
||||||
CogWindowManager->AddWindow<FCogAbilityWindow_Pools>("Gameplay.Pools");
|
|
||||||
|
|
||||||
CogWindowManager->AddWindow<FCogAbilityWindow_OwnedTags>("Gameplay.Owned Tags");
|
|
||||||
|
|
||||||
CogWindowManager->AddWindow<FCogSampleWindow_Team>("Gameplay.Team");
|
|
||||||
|
|
||||||
CogWindowManager->AddWindow<FCogAbilityWindow_Tweaks>("Gameplay.Tweaks");
|
|
||||||
|
|
||||||
//---------------------------------------
|
|
||||||
// AI
|
|
||||||
//---------------------------------------
|
|
||||||
CogWindowManager->AddWindow<FCogAIWindow_BehaviorTree>("AI.Behavior Tree");
|
|
||||||
|
|
||||||
CogWindowManager->AddWindow<FCogAIWindow_Blackboard>("AI.Blackboard");
|
|
||||||
|
|
||||||
//---------------------------------------
|
|
||||||
// Input
|
|
||||||
//---------------------------------------
|
|
||||||
CogWindowManager->AddWindow<FCogInputWindow_Actions>("Input.Actions");
|
|
||||||
|
|
||||||
CogWindowManager->AddWindow<FCogInputWindow_Gamepad>("Input.Gamepad");
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif //ENABLE_COG
|
|
||||||
|
|||||||
Reference in New Issue
Block a user