From 39052b2739b2be27ad64a3cc43ff46fadd781c1b Mon Sep 17 00:00:00 2001 From: Arnaud Jamin Date: Wed, 11 Oct 2023 01:28:49 -0400 Subject: [PATCH 1/6] Update README.md --- README.md | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c9462a7..cc4aca7 100644 --- a/README.md +++ b/README.md @@ -279,9 +279,15 @@ void ACogSampleGameState::BeginPlay() CogWindowManager = NewObject(this); CogWindowManagerRef = CogWindowManager; - // Add some windows + // Add and configure windows CogWindowManager->CreateWindow("Engine.Debug Settings"); CogWindowManager->CreateWindow("Engine.ImGui"); + + // Add a window that uses a data asset + UCogAbilityWindow_Cheats* CheatsWindow = CogWindowManager->CreateWindow("Gameplay.Cheats"); + CheatsWindow->SetCheatsAsset(GetFirstAssetByClass()); +``` + [...] #endif //ENABLE_COG } @@ -308,3 +314,26 @@ void ACogSampleGameState::Tick(float DeltaSeconds) #endif //ENABLE_COG } ``` + +6. Implement Cog Interfaces of the desired actor classes: + +```cpp +// CogSampleCharacter.h +UCLASS(config=Game) +class ACogSampleCharacter : public ACharacter + , public IAbilitySystemInterface + , public ICogCommonDebugFilteredActorInterface + , public ICogCommonAllegianceActorInterface + , public ICogSampleTeamInterface + , public ICogSampleTargetableInterface +``` + +```cpp +// CogSamplePlayerController.h +UCLASS(config=Game) +class ACogSamplePlayerController + : public APlayerController + , public ICogCommonPossessorInterface +``` + +7. In Unreal Editor create and configure the Data Assets From cbe0740a2ebe3e5262265f52d7ccbee01e643411 Mon Sep 17 00:00:00 2001 From: Arnaud Jamin Date: Wed, 11 Oct 2023 01:31:00 -0400 Subject: [PATCH 2/6] Update README.md --- README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index cc4aca7..d329c62 100644 --- a/README.md +++ b/README.md @@ -279,14 +279,18 @@ void ACogSampleGameState::BeginPlay() CogWindowManager = NewObject(this); CogWindowManagerRef = CogWindowManager; - // Add and configure windows + // Add windows CogWindowManager->CreateWindow("Engine.Debug Settings"); CogWindowManager->CreateWindow("Engine.ImGui"); - // Add a window that uses a data asset - UCogAbilityWindow_Cheats* CheatsWindow = CogWindowManager->CreateWindow("Gameplay.Cheats"); - CheatsWindow->SetCheatsAsset(GetFirstAssetByClass()); -``` + // Add windows that uses a data asset. The data asset must be created inside Unreal Editor. + const UCogAbilityDataAsset* AbilitiesAsset = GetFirstAssetByClass(); + + UCogAbilityWindow_Abilities* AbilitiesWindow = CogWindowManager->CreateWindow("Gameplay.Abilities"); + AbilitiesWindow->Asset = AbilitiesAsset; + + UCogAbilityWindow_Attributes* AttributesWindow = CogWindowManager->CreateWindow("Gameplay.Attributes"); + AttributesWindow->Asset = AbilitiesAsset; [...] #endif //ENABLE_COG From 3c9abe8fc05f5a080b91abd9c308cdf6283309d7 Mon Sep 17 00:00:00 2001 From: Arnaud Jamin Date: Wed, 11 Oct 2023 01:31:50 -0400 Subject: [PATCH 3/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d329c62..bf30031 100644 --- a/README.md +++ b/README.md @@ -319,7 +319,7 @@ void ACogSampleGameState::Tick(float DeltaSeconds) } ``` -6. Implement Cog Interfaces of the desired actor classes: +6. Implement Cog Interfaces on your desired actor classes: ```cpp // CogSampleCharacter.h From d47baa3ff7a9a39b453d7e52a327e26e5b504cca Mon Sep 17 00:00:00 2001 From: Arnaud Jamin Date: Wed, 11 Oct 2023 01:33:52 -0400 Subject: [PATCH 4/6] Update README.md --- README.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index bf30031..d657d30 100644 --- a/README.md +++ b/README.md @@ -196,8 +196,8 @@ The Cog repository has the following structure: Cog has multiple plugins to ease the integration for projects that do not use the `Ability System Component` or `Enhanced Input`. For the next steps, it is assumed all the plugins are used. -1. Setup up module dependencies: +- Setup up module dependencies: ```c# // CogSample.Build.cs using UnrealBuildTool; @@ -238,8 +238,8 @@ public class CogSample : ModuleRules } ``` -2. In the class of your choice (in the sample we use the GameState class) add a reference to the CogWindowManager: +- In the class of your choice (in the sample we use the GameState class) add a reference to the CogWindowManager: ```cpp // ACogSampleGameState.h #pragma once @@ -267,8 +267,9 @@ class ACogSampleGameState : public AGameStateBase #endif //ENABLE_COG }; ``` -3. Instantiate the CogWindowManager and add some windows: + +- Instantiate the CogWindowManager and add some windows: ```cpp // ACogSampleGameState.cpp void ACogSampleGameState::BeginPlay() @@ -295,18 +296,17 @@ void ACogSampleGameState::BeginPlay() [...] #endif //ENABLE_COG } - ``` -3. Define which key will toggle the input from the game to Imgui: +- Define which key will toggle the input from the game to Imgui: ```cpp // ACogSampleGameState.cpp FCogImguiModule::Get().SetToggleInputKey(FCogImGuiKeyInfo(EKeys::Insert)); ``` -4. Tick the CogWindowManager: +- Tick the CogWindowManager: ```cpp // ACogSampleGameState.cpp void ACogSampleGameState::Tick(float DeltaSeconds) @@ -319,8 +319,8 @@ void ACogSampleGameState::Tick(float DeltaSeconds) } ``` -6. Implement Cog Interfaces on your desired actor classes: +- Implement Cog Interfaces on your desired actor classes: ```cpp // CogSampleCharacter.h UCLASS(config=Game) @@ -340,4 +340,5 @@ class ACogSamplePlayerController , public ICogCommonPossessorInterface ``` -7. In Unreal Editor create and configure the Data Assets + +- In Unreal Editor create and configure the Data Assets From bb6162e4a186c089d4a9c6b19cdc9b607e445f97 Mon Sep 17 00:00:00 2001 From: Arnaud Jamin Date: Wed, 11 Oct 2023 01:36:24 -0400 Subject: [PATCH 5/6] Update README.md --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index d657d30..cbfd339 100644 --- a/README.md +++ b/README.md @@ -196,7 +196,7 @@ The Cog repository has the following structure: Cog has multiple plugins to ease the integration for projects that do not use the `Ability System Component` or `Enhanced Input`. For the next steps, it is assumed all the plugins are used. - +
- Setup up module dependencies: ```c# // CogSample.Build.cs @@ -238,7 +238,7 @@ public class CogSample : ModuleRules } ``` - +
- In the class of your choice (in the sample we use the GameState class) add a reference to the CogWindowManager: ```cpp // ACogSampleGameState.h @@ -268,7 +268,7 @@ class ACogSampleGameState : public AGameStateBase }; ``` - +
- Instantiate the CogWindowManager and add some windows: ```cpp // ACogSampleGameState.cpp @@ -298,14 +298,14 @@ void ACogSampleGameState::BeginPlay() } ``` - +
- Define which key will toggle the input from the game to Imgui: ```cpp // ACogSampleGameState.cpp FCogImguiModule::Get().SetToggleInputKey(FCogImGuiKeyInfo(EKeys::Insert)); ``` - +
- Tick the CogWindowManager: ```cpp // ACogSampleGameState.cpp @@ -319,7 +319,7 @@ void ACogSampleGameState::Tick(float DeltaSeconds) } ``` - +
- Implement Cog Interfaces on your desired actor classes: ```cpp // CogSampleCharacter.h @@ -340,5 +340,5 @@ class ACogSamplePlayerController , public ICogCommonPossessorInterface ``` - +
- In Unreal Editor create and configure the Data Assets From 1e8148f8c0c0d44a6e280fdc8490263e9f320fc1 Mon Sep 17 00:00:00 2001 From: Arnaud Jamin Date: Wed, 11 Oct 2023 01:37:57 -0400 Subject: [PATCH 6/6] Update README.md --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index cbfd339..ee58bbc 100644 --- a/README.md +++ b/README.md @@ -196,7 +196,7 @@ The Cog repository has the following structure: Cog has multiple plugins to ease the integration for projects that do not use the `Ability System Component` or `Enhanced Input`. For the next steps, it is assumed all the plugins are used. -
+ - Setup up module dependencies: ```c# // CogSample.Build.cs @@ -238,7 +238,7 @@ public class CogSample : ModuleRules } ``` -
+ - In the class of your choice (in the sample we use the GameState class) add a reference to the CogWindowManager: ```cpp // ACogSampleGameState.h @@ -268,7 +268,7 @@ class ACogSampleGameState : public AGameStateBase }; ``` -
+ - Instantiate the CogWindowManager and add some windows: ```cpp // ACogSampleGameState.cpp @@ -298,14 +298,14 @@ void ACogSampleGameState::BeginPlay() } ``` -
+ - Define which key will toggle the input from the game to Imgui: ```cpp // ACogSampleGameState.cpp FCogImguiModule::Get().SetToggleInputKey(FCogImGuiKeyInfo(EKeys::Insert)); ``` -
+ - Tick the CogWindowManager: ```cpp // ACogSampleGameState.cpp @@ -319,7 +319,7 @@ void ACogSampleGameState::Tick(float DeltaSeconds) } ``` -
+ - Implement Cog Interfaces on your desired actor classes: ```cpp // CogSampleCharacter.h @@ -340,5 +340,5 @@ class ACogSamplePlayerController , public ICogCommonPossessorInterface ``` -
+__ - In Unreal Editor create and configure the Data Assets