CogSample: Add a window with the Team of the selection.

This commit is contained in:
Arnaud Jamin
2023-11-05 01:10:22 -04:00
parent c44171b113
commit 34e08a9e2a
4 changed files with 68 additions and 1 deletions
+3
View File
@@ -44,6 +44,7 @@
#include "CogInputWindow_Actions.h"
#include "CogInputWindow_Gamepad.h"
#include "CogSampleLogCategories.h"
#include "CogSampleWindow_Team.h"
#include "CogWindowManager.h"
#include "GameFramework/GameUserSettings.h"
@@ -181,6 +182,8 @@ void ACogSampleGameState::InitializeCog()
CogWindowManager->AddWindow<FCogAbilityWindow_OwnedTags>("Gameplay.Owned Tags");
CogWindowManager->AddWindow<FCogSampleWindow_Team>("Gameplay.Team");
CogWindowManager->AddWindow<FCogAbilityWindow_Tweaks>("Gameplay.Tweaks");
//---------------------------------------
+37
View File
@@ -0,0 +1,37 @@
#include "CogSampleWindow_Team.h"
#if ENABLE_COG
#include "CogImguiHelper.h"
#include "CogWindowHelper.h"
#include "CogWindowWidgets.h"
#include "CogSampleTeamInterface.h"
//--------------------------------------------------------------------------------------------------------------------------
void FCogSampleWindow_Team::Initialize()
{
Super::Initialize();
}
//--------------------------------------------------------------------------------------------------------------------------
void FCogSampleWindow_Team::RenderHelp()
{
ImGui::Text("A window part of the sample project.");
}
//--------------------------------------------------------------------------------------------------------------------------
void FCogSampleWindow_Team::RenderContent()
{
Super::RenderContent();
if (ICogSampleTeamInterface* TeamInterface = Cast<ICogSampleTeamInterface>(GetSelection()))
{
int32 Team = TeamInterface->GetTeam();
if (ImGui::DragInt("Team", &Team, 0.1f, 0, 10))
{
TeamInterface->SetTeam(Team);
}
}
}
#endif //ENABLE_COG
+26
View File
@@ -0,0 +1,26 @@
#pragma once
#include "CoreMinimal.h"
#include "CogCommon.h"
#if ENABLE_COG
#include "CogWindow.h"
//--------------------------------------------------------------------------------------------------------------------------
class FCogSampleWindow_Team : public FCogWindow
{
typedef FCogWindow Super;
public:
virtual void Initialize() override;
protected:
virtual void RenderHelp() override;
virtual void RenderContent() override;
};
#endif //ENABLE_COG
+2 -1
View File
@@ -5,6 +5,7 @@
- CogWindow: Try to remove CogWindow dependency to cogimgui. Should only depends on imgui (currently use setdpiscale of cogimgui)
- CogWindow: Overlay window should have achnoring options (top bottom left right center mid)
- CogWindow: Hide menu is not saved anymore
- CogWindow: DPI change on mousewheel should be a command with a key bind as the rest.
- CogEngine: More stats in the stats window
- CogEngine: Overlay mode of stats.
@@ -16,7 +17,7 @@
- CogEngine: Improve collision window: Add Query Type, Single or Multi, By Channel or Object Type, Object Type.
- CogEngine: Add multi selection to the selection window actor filter (Character+GameState for example).
- CogSample: Add a custom window in sample (changing the character faction)
- CogSample: Add more info in the team window
- CogSample: Create more abilities
- CogSample: Push Model
- CogSample: Add timescale game tweak